zudoku 0.0.0-reset-hash-value.ac516c6d → 0.0.0-z06bf8c86

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 (829) hide show
  1. package/client.d.ts +8 -0
  2. package/dist/app/entry.server.js +14 -1
  3. package/dist/app/entry.server.js.map +1 -1
  4. package/dist/app/main.d.ts +91 -1
  5. package/dist/app/main.js +5 -1
  6. package/dist/app/main.js.map +1 -1
  7. package/dist/app/sentry.js +1 -1
  8. package/dist/cli/common/version-check.js +12 -3
  9. package/dist/cli/common/version-check.js.map +1 -1
  10. package/dist/config/config.d.ts +15 -44
  11. package/dist/config/loader.js +3 -1
  12. package/dist/config/loader.js.map +1 -1
  13. package/dist/config/validators/BuildSchema.d.ts +5 -4
  14. package/dist/config/validators/BuildSchema.js +23 -5
  15. package/dist/config/validators/BuildSchema.js.map +1 -1
  16. package/dist/config/validators/InputNavigationSchema.d.ts +126 -124
  17. package/dist/config/validators/InputNavigationSchema.js +1 -0
  18. package/dist/config/validators/InputNavigationSchema.js.map +1 -1
  19. package/dist/config/validators/NavigationSchema.js +8 -5
  20. package/dist/config/validators/NavigationSchema.js.map +1 -1
  21. package/dist/config/validators/ProtectedRoutesSchema.d.ts +1 -1
  22. package/dist/config/validators/validate.d.ts +264 -23
  23. package/dist/config/validators/validate.js +56 -11
  24. package/dist/config/validators/validate.js.map +1 -1
  25. package/dist/config/validators/validate.test.js +43 -0
  26. package/dist/config/validators/validate.test.js.map +1 -1
  27. package/dist/flat-config.d.ts +59 -23
  28. package/dist/index.d.ts +2 -1
  29. package/dist/index.js +2 -1
  30. package/dist/index.js.map +1 -1
  31. package/dist/lib/auth/issuer.js +3 -0
  32. package/dist/lib/auth/issuer.js.map +1 -1
  33. package/dist/lib/authentication/authentication.d.ts +19 -10
  34. package/dist/lib/authentication/components/CallbackHandler.js +1 -1
  35. package/dist/lib/authentication/components/CallbackHandler.js.map +1 -1
  36. package/dist/lib/authentication/components/OAuthErrorPage.js +1 -1
  37. package/dist/lib/authentication/components/OAuthErrorPage.js.map +1 -1
  38. package/dist/lib/authentication/components/SignIn.js +8 -5
  39. package/dist/lib/authentication/components/SignIn.js.map +1 -1
  40. package/dist/lib/authentication/components/SignOut.js +6 -6
  41. package/dist/lib/authentication/components/SignOut.js.map +1 -1
  42. package/dist/lib/authentication/components/SignUp.js +7 -5
  43. package/dist/lib/authentication/components/SignUp.js.map +1 -1
  44. package/dist/lib/authentication/hook.d.ts +5 -2
  45. package/dist/lib/authentication/hook.js +22 -8
  46. package/dist/lib/authentication/hook.js.map +1 -1
  47. package/dist/lib/authentication/providers/auth0.js +18 -9
  48. package/dist/lib/authentication/providers/auth0.js.map +1 -1
  49. package/dist/lib/authentication/providers/azureb2c.d.ts +4 -4
  50. package/dist/lib/authentication/providers/azureb2c.js +3 -3
  51. package/dist/lib/authentication/providers/azureb2c.js.map +1 -1
  52. package/dist/lib/authentication/providers/clerk.js +2 -24
  53. package/dist/lib/authentication/providers/clerk.js.map +1 -1
  54. package/dist/lib/authentication/providers/firebase.d.ts +4 -0
  55. package/dist/lib/authentication/providers/firebase.js +273 -0
  56. package/dist/lib/authentication/providers/firebase.js.map +1 -0
  57. package/dist/lib/authentication/providers/openid.d.ts +7 -7
  58. package/dist/lib/authentication/providers/openid.js +3 -3
  59. package/dist/lib/authentication/providers/openid.js.map +1 -1
  60. package/dist/lib/authentication/providers/supabase/SupabaseAuthUI.d.ts +8 -0
  61. package/dist/lib/authentication/providers/supabase/SupabaseAuthUI.js +39 -0
  62. package/dist/lib/authentication/providers/supabase/SupabaseAuthUI.js.map +1 -0
  63. package/dist/lib/authentication/providers/supabase.js +36 -46
  64. package/dist/lib/authentication/providers/supabase.js.map +1 -1
  65. package/dist/lib/authentication/state.d.ts +1 -5
  66. package/dist/lib/authentication/state.js +2 -14
  67. package/dist/lib/authentication/state.js.map +1 -1
  68. package/dist/lib/authentication/ui/EmailVerificationUi.d.ts +4 -0
  69. package/dist/lib/authentication/ui/EmailVerificationUi.js +34 -0
  70. package/dist/lib/authentication/ui/EmailVerificationUi.js.map +1 -0
  71. package/dist/lib/authentication/ui/ZudokuAuthUi.d.ts +29 -0
  72. package/dist/lib/authentication/ui/ZudokuAuthUi.js +160 -0
  73. package/dist/lib/authentication/ui/ZudokuAuthUi.js.map +1 -0
  74. package/dist/lib/authentication/ui/icons/Apple.d.ts +3 -0
  75. package/dist/lib/authentication/ui/icons/Apple.js +4 -0
  76. package/dist/lib/authentication/ui/icons/Apple.js.map +1 -0
  77. package/dist/lib/authentication/ui/icons/Facebook.d.ts +3 -0
  78. package/dist/lib/authentication/ui/icons/Facebook.js +4 -0
  79. package/dist/lib/authentication/ui/icons/Facebook.js.map +1 -0
  80. package/dist/lib/authentication/ui/icons/Github.d.ts +3 -0
  81. package/dist/lib/authentication/ui/icons/Github.js +4 -0
  82. package/dist/lib/authentication/ui/icons/Github.js.map +1 -0
  83. package/dist/lib/authentication/ui/icons/Google.d.ts +3 -0
  84. package/dist/lib/authentication/ui/icons/Google.js +4 -0
  85. package/dist/lib/authentication/ui/icons/Google.js.map +1 -0
  86. package/dist/lib/authentication/ui/icons/Microsoft.d.ts +3 -0
  87. package/dist/lib/authentication/ui/icons/Microsoft.js +4 -0
  88. package/dist/lib/authentication/ui/icons/Microsoft.js.map +1 -0
  89. package/dist/lib/authentication/ui/icons/X.d.ts +3 -0
  90. package/dist/lib/authentication/ui/icons/X.js +4 -0
  91. package/dist/lib/authentication/ui/icons/X.js.map +1 -0
  92. package/dist/lib/authentication/utils/relativeRedirectUrl.d.ts +1 -0
  93. package/dist/lib/authentication/utils/relativeRedirectUrl.js +8 -0
  94. package/dist/lib/authentication/utils/relativeRedirectUrl.js.map +1 -0
  95. package/dist/lib/components/Autocomplete.d.ts +3 -1
  96. package/dist/lib/components/Autocomplete.js +6 -2
  97. package/dist/lib/components/Autocomplete.js.map +1 -1
  98. package/dist/lib/components/Heading.d.ts +1 -1
  99. package/dist/lib/components/Layout.js +3 -2
  100. package/dist/lib/components/Layout.js.map +1 -1
  101. package/dist/lib/components/Mermaid.d.ts +7 -0
  102. package/dist/lib/components/Mermaid.js +42 -0
  103. package/dist/lib/components/Mermaid.js.map +1 -0
  104. package/dist/lib/components/PagefindSearchMeta.d.ts +8 -0
  105. package/dist/lib/components/PagefindSearchMeta.js +7 -0
  106. package/dist/lib/components/PagefindSearchMeta.js.map +1 -0
  107. package/dist/lib/components/Pagination.js +2 -2
  108. package/dist/lib/components/Pagination.js.map +1 -1
  109. package/dist/lib/components/Zudoku.js +5 -8
  110. package/dist/lib/components/Zudoku.js.map +1 -1
  111. package/dist/lib/components/index.d.ts +7 -2
  112. package/dist/lib/components/index.js +4 -0
  113. package/dist/lib/components/index.js.map +1 -1
  114. package/dist/lib/components/navigation/NavigationItem.js +4 -4
  115. package/dist/lib/components/navigation/NavigationItem.js.map +1 -1
  116. package/dist/lib/components/navigation/Toc.js +1 -1
  117. package/dist/lib/components/navigation/Toc.js.map +1 -1
  118. package/dist/lib/core/RouteGuard.d.ts +1 -1
  119. package/dist/lib/core/RouteGuard.js +22 -25
  120. package/dist/lib/core/RouteGuard.js.map +1 -1
  121. package/dist/lib/core/ZudokuContext.d.ts +1 -0
  122. package/dist/lib/core/ZudokuContext.js +2 -0
  123. package/dist/lib/core/ZudokuContext.js.map +1 -1
  124. package/dist/lib/core/__internal.d.ts +1 -1
  125. package/dist/lib/core/plugins.d.ts +14 -4
  126. package/dist/lib/core/plugins.js +1 -0
  127. package/dist/lib/core/plugins.js.map +1 -1
  128. package/dist/lib/core/react-query.d.ts +1 -0
  129. package/dist/lib/core/react-query.js +2 -0
  130. package/dist/lib/core/react-query.js.map +1 -0
  131. package/dist/lib/core/transform-config.d.ts +2 -0
  132. package/dist/lib/core/transform-config.js +22 -0
  133. package/dist/lib/core/transform-config.js.map +1 -0
  134. package/dist/lib/errors/ErrorAlert.js +1 -1
  135. package/dist/lib/errors/ErrorMessage.d.ts +3 -0
  136. package/dist/lib/errors/ErrorMessage.js +16 -0
  137. package/dist/lib/errors/ErrorMessage.js.map +1 -0
  138. package/dist/lib/errors/RouterError.d.ts +3 -1
  139. package/dist/lib/errors/RouterError.js +3 -2
  140. package/dist/lib/errors/RouterError.js.map +1 -1
  141. package/dist/lib/hooks/index.d.ts +4 -2
  142. package/dist/lib/oas/graphql/circular.d.ts +2 -0
  143. package/dist/lib/oas/graphql/circular.js +32 -10
  144. package/dist/lib/oas/graphql/circular.js.map +1 -1
  145. package/dist/lib/oas/graphql/circular.test.d.ts +1 -0
  146. package/dist/lib/oas/graphql/circular.test.js +152 -0
  147. package/dist/lib/oas/graphql/circular.test.js.map +1 -0
  148. package/dist/lib/oas/graphql/index.js +7 -3
  149. package/dist/lib/oas/graphql/index.js.map +1 -1
  150. package/dist/lib/oas/parser/index.d.ts +1 -0
  151. package/dist/lib/oas/parser/index.js +7 -3
  152. package/dist/lib/oas/parser/index.js.map +1 -1
  153. package/dist/lib/plugins/api-keys/ProtectedRoute.js +4 -1
  154. package/dist/lib/plugins/api-keys/ProtectedRoute.js.map +1 -1
  155. package/dist/lib/plugins/api-keys/SettingsApiKeys.js +9 -172
  156. package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -1
  157. package/dist/lib/plugins/api-keys/index.d.ts +11 -4
  158. package/dist/lib/plugins/api-keys/index.js +36 -22
  159. package/dist/lib/plugins/api-keys/index.js.map +1 -1
  160. package/dist/lib/plugins/api-keys/settings/ApiKeyItem.d.ts +12 -0
  161. package/dist/lib/plugins/api-keys/settings/ApiKeyItem.js +133 -0
  162. package/dist/lib/plugins/api-keys/settings/ApiKeyItem.js.map +1 -0
  163. package/dist/lib/plugins/api-keys/settings/ApiKeyList.d.ts +4 -0
  164. package/dist/lib/plugins/api-keys/settings/ApiKeyList.js +33 -0
  165. package/dist/lib/plugins/api-keys/settings/ApiKeyList.js.map +1 -0
  166. package/dist/lib/plugins/api-keys/settings/RevealApiKey.d.ts +6 -0
  167. package/dist/lib/plugins/api-keys/settings/RevealApiKey.js +39 -0
  168. package/dist/lib/plugins/api-keys/settings/RevealApiKey.js.map +1 -0
  169. package/dist/lib/plugins/markdown/MdxPage.d.ts +2 -1
  170. package/dist/lib/plugins/markdown/MdxPage.js +3 -2
  171. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  172. package/dist/lib/plugins/markdown/index.d.ts +1 -0
  173. package/dist/lib/plugins/markdown/index.js +1 -1
  174. package/dist/lib/plugins/markdown/index.js.map +1 -1
  175. package/dist/lib/plugins/openapi/CollapsibleCode.d.ts +1 -0
  176. package/dist/lib/plugins/openapi/CollapsibleCode.js +2 -1
  177. package/dist/lib/plugins/openapi/CollapsibleCode.js.map +1 -1
  178. package/dist/lib/plugins/openapi/DownloadSchemaButton.d.ts +3 -0
  179. package/dist/lib/plugins/openapi/DownloadSchemaButton.js +47 -0
  180. package/dist/lib/plugins/openapi/DownloadSchemaButton.js.map +1 -0
  181. package/dist/lib/plugins/openapi/Endpoint.js +3 -6
  182. package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
  183. package/dist/lib/plugins/openapi/GeneratedExampleSidecarBox.d.ts +5 -0
  184. package/dist/lib/plugins/openapi/GeneratedExampleSidecarBox.js +10 -0
  185. package/dist/lib/plugins/openapi/GeneratedExampleSidecarBox.js.map +1 -0
  186. package/dist/lib/plugins/openapi/OasProvider.js +26 -13
  187. package/dist/lib/plugins/openapi/OasProvider.js.map +1 -1
  188. package/dist/lib/plugins/openapi/OperationList.js +15 -5
  189. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  190. package/dist/lib/plugins/openapi/OperationListItem.d.ts +2 -1
  191. package/dist/lib/plugins/openapi/OperationListItem.js +4 -3
  192. package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
  193. package/dist/lib/plugins/openapi/ParamInfos.js +1 -0
  194. package/dist/lib/plugins/openapi/ParamInfos.js.map +1 -1
  195. package/dist/lib/plugins/openapi/ParameterList.js +7 -4
  196. package/dist/lib/plugins/openapi/ParameterList.js.map +1 -1
  197. package/dist/lib/plugins/openapi/ParameterListItem.js +17 -6
  198. package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
  199. package/dist/lib/plugins/openapi/RequestBodySidecarBox.d.ts +9 -2
  200. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js +5 -2
  201. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
  202. package/dist/lib/plugins/openapi/ResponsesSidecarBox.d.ts +4 -2
  203. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js +26 -4
  204. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
  205. package/dist/lib/plugins/openapi/SchemaList.js +2 -1
  206. package/dist/lib/plugins/openapi/SchemaList.js.map +1 -1
  207. package/dist/lib/plugins/openapi/Sidecar.d.ts +2 -2
  208. package/dist/lib/plugins/openapi/Sidecar.js +64 -28
  209. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  210. package/dist/lib/plugins/openapi/SidecarBox.js +4 -4
  211. package/dist/lib/plugins/openapi/SidecarBox.js.map +1 -1
  212. package/dist/lib/plugins/openapi/SidecarExamples.d.ts +9 -2
  213. package/dist/lib/plugins/openapi/SidecarExamples.js +24 -43
  214. package/dist/lib/plugins/openapi/SidecarExamples.js.map +1 -1
  215. package/dist/lib/plugins/openapi/components/ConstValue.js +1 -1
  216. package/dist/lib/plugins/openapi/components/ConstValue.js.map +1 -1
  217. package/dist/lib/plugins/openapi/components/EnumValues.js +1 -1
  218. package/dist/lib/plugins/openapi/components/EnumValues.js.map +1 -1
  219. package/dist/lib/plugins/openapi/components/NonHighlightedCode.d.ts +4 -0
  220. package/dist/lib/plugins/openapi/components/NonHighlightedCode.js +5 -0
  221. package/dist/lib/plugins/openapi/components/NonHighlightedCode.js.map +1 -0
  222. package/dist/lib/plugins/openapi/components/ResponseContent.js +5 -6
  223. package/dist/lib/plugins/openapi/components/ResponseContent.js.map +1 -1
  224. package/dist/lib/plugins/openapi/index.js +15 -14
  225. package/dist/lib/plugins/openapi/index.js.map +1 -1
  226. package/dist/lib/plugins/openapi/interfaces.d.ts +32 -13
  227. package/dist/lib/plugins/openapi/playground/BodyPanel.js +67 -15
  228. package/dist/lib/plugins/openapi/playground/BodyPanel.js.map +1 -1
  229. package/dist/lib/plugins/openapi/playground/CollapsibleHeader.js +2 -2
  230. package/dist/lib/plugins/openapi/playground/CollapsibleHeader.js.map +1 -1
  231. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js +1 -1
  232. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js.map +1 -1
  233. package/dist/lib/plugins/openapi/playground/Headers.js +23 -83
  234. package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -1
  235. package/dist/lib/plugins/openapi/playground/ParamsGrid.d.ts +10 -2
  236. package/dist/lib/plugins/openapi/playground/ParamsGrid.js +8 -1
  237. package/dist/lib/plugins/openapi/playground/ParamsGrid.js.map +1 -1
  238. package/dist/lib/plugins/openapi/playground/PathParams.js +2 -3
  239. package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
  240. package/dist/lib/plugins/openapi/playground/Playground.d.ts +7 -0
  241. package/dist/lib/plugins/openapi/playground/Playground.js +70 -28
  242. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  243. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +3 -2
  244. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -1
  245. package/dist/lib/plugins/openapi/playground/QueryParams.js +16 -40
  246. package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
  247. package/dist/lib/plugins/openapi/playground/RequestLoginDialog.d.ts +2 -1
  248. package/dist/lib/plugins/openapi/playground/RequestLoginDialog.js +10 -2
  249. package/dist/lib/plugins/openapi/playground/RequestLoginDialog.js.map +1 -1
  250. package/dist/lib/plugins/openapi/playground/request-panel/MultipartField.d.ts +8 -0
  251. package/dist/lib/plugins/openapi/playground/request-panel/MultipartField.js +19 -0
  252. package/dist/lib/plugins/openapi/playground/request-panel/MultipartField.js.map +1 -0
  253. package/dist/lib/plugins/openapi/playground/request-panel/UrlQueryParams.js +1 -1
  254. package/dist/lib/plugins/openapi/playground/request-panel/UrlQueryParams.js.map +1 -1
  255. package/dist/lib/plugins/openapi/playground/request-panel/fieldManager/useKeyValueFieldManager.test.d.ts +1 -0
  256. package/dist/lib/plugins/openapi/playground/request-panel/fieldManager/useKeyValueFieldManager.test.js +540 -0
  257. package/dist/lib/plugins/openapi/playground/request-panel/fieldManager/useKeyValueFieldManager.test.js.map +1 -0
  258. package/dist/lib/plugins/openapi/playground/request-panel/useKeyValueFieldManager.d.ts +40 -0
  259. package/dist/lib/plugins/openapi/playground/request-panel/useKeyValueFieldManager.js +205 -0
  260. package/dist/lib/plugins/openapi/playground/request-panel/useKeyValueFieldManager.js.map +1 -0
  261. package/dist/lib/plugins/openapi/playground/result-panel/Highlight.d.ts +1 -1
  262. package/dist/lib/plugins/openapi/playground/result-panel/ResponseStatusBar.js +1 -1
  263. package/dist/lib/plugins/openapi/playground/result-panel/ResponseStatusBar.js.map +1 -1
  264. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js +23 -21
  265. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js.map +1 -1
  266. package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js +1 -1
  267. package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js.map +1 -1
  268. package/dist/lib/plugins/openapi/playground/useRememberSkipLoginDialog.js +2 -0
  269. package/dist/lib/plugins/openapi/playground/useRememberSkipLoginDialog.js.map +1 -1
  270. package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js +1 -1
  271. package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js.map +1 -1
  272. package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js +17 -8
  273. package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js.map +1 -1
  274. package/dist/lib/plugins/openapi/schema/SchemaView.d.ts +1 -1
  275. package/dist/lib/plugins/openapi/schema/SchemaView.js +31 -16
  276. package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
  277. package/dist/lib/plugins/openapi/schema/UnionView.js +2 -5
  278. package/dist/lib/plugins/openapi/schema/UnionView.js.map +1 -1
  279. package/dist/lib/plugins/openapi/schema/union-helpers.js +0 -1
  280. package/dist/lib/plugins/openapi/schema/union-helpers.js.map +1 -1
  281. package/dist/lib/plugins/openapi/schema/utils.d.ts +2 -2
  282. package/dist/lib/plugins/openapi/schema/utils.js +11 -3
  283. package/dist/lib/plugins/openapi/schema/utils.js.map +1 -1
  284. package/dist/lib/plugins/openapi/util/createHttpSnippet.js +24 -1
  285. package/dist/lib/plugins/openapi/util/createHttpSnippet.js.map +1 -1
  286. package/dist/lib/plugins/openapi/util/generateSchemaExample.js +9 -11
  287. package/dist/lib/plugins/openapi/util/generateSchemaExample.js.map +1 -1
  288. package/dist/lib/plugins/openapi/util/getRoutes.d.ts +9 -1
  289. package/dist/lib/plugins/openapi/util/getRoutes.js +30 -2
  290. package/dist/lib/plugins/openapi/util/getRoutes.js.map +1 -1
  291. package/dist/lib/plugins/search-pagefind/IndexingDialog.d.ts +3 -0
  292. package/dist/lib/plugins/search-pagefind/IndexingDialog.js +64 -0
  293. package/dist/lib/plugins/search-pagefind/IndexingDialog.js.map +1 -0
  294. package/dist/lib/plugins/search-pagefind/PagefindSearch.js +22 -5
  295. package/dist/lib/plugins/search-pagefind/PagefindSearch.js.map +1 -1
  296. package/dist/lib/plugins/search-pagefind/ResultList.js +5 -4
  297. package/dist/lib/plugins/search-pagefind/ResultList.js.map +1 -1
  298. package/dist/lib/shiki.d.ts +2 -2
  299. package/dist/lib/shiki.js +31 -14
  300. package/dist/lib/shiki.js.map +1 -1
  301. package/dist/lib/ui/Badge.d.ts +3 -3
  302. package/dist/lib/ui/Badge.js +9 -7
  303. package/dist/lib/ui/Badge.js.map +1 -1
  304. package/dist/lib/ui/Button.d.ts +2 -2
  305. package/dist/lib/ui/Button.js +10 -8
  306. package/dist/lib/ui/Button.js.map +1 -1
  307. package/dist/lib/ui/ButtonGroup.d.ts +11 -0
  308. package/dist/lib/ui/ButtonGroup.js +28 -0
  309. package/dist/lib/ui/ButtonGroup.js.map +1 -0
  310. package/dist/lib/ui/Callout.d.ts +5 -5
  311. package/dist/lib/ui/Callout.js +5 -5
  312. package/dist/lib/ui/Callout.js.map +1 -1
  313. package/dist/lib/ui/Checkbox.d.ts +2 -2
  314. package/dist/lib/ui/Checkbox.js +4 -4
  315. package/dist/lib/ui/Checkbox.js.map +1 -1
  316. package/dist/lib/ui/CodeBlock.d.ts +0 -1
  317. package/dist/lib/ui/CodeBlock.js +1 -1
  318. package/dist/lib/ui/CodeBlock.js.map +1 -1
  319. package/dist/lib/ui/Collapsible.d.ts +4 -4
  320. package/dist/lib/ui/Collapsible.js +11 -4
  321. package/dist/lib/ui/Collapsible.js.map +1 -1
  322. package/dist/lib/ui/Command.js +2 -2
  323. package/dist/lib/ui/Command.js.map +1 -1
  324. package/dist/lib/ui/Dialog.d.ts +12 -18
  325. package/dist/lib/ui/Dialog.js +30 -17
  326. package/dist/lib/ui/Dialog.js.map +1 -1
  327. package/dist/lib/ui/DropdownMenu.d.ts +21 -23
  328. package/dist/lib/ui/DropdownMenu.js +47 -32
  329. package/dist/lib/ui/DropdownMenu.js.map +1 -1
  330. package/dist/lib/ui/EmbeddedCodeBlock.d.ts +3 -2
  331. package/dist/lib/ui/EmbeddedCodeBlock.js +4 -3
  332. package/dist/lib/ui/EmbeddedCodeBlock.js.map +1 -1
  333. package/dist/lib/ui/Frame.d.ts +8 -0
  334. package/dist/lib/ui/Frame.js +22 -0
  335. package/dist/lib/ui/Frame.js.map +1 -0
  336. package/dist/lib/ui/Item.d.ts +23 -0
  337. package/dist/lib/ui/Item.js +67 -0
  338. package/dist/lib/ui/Item.js.map +1 -0
  339. package/dist/lib/ui/Kbd.d.ts +3 -0
  340. package/dist/lib/ui/Kbd.js +10 -0
  341. package/dist/lib/ui/Kbd.js.map +1 -0
  342. package/dist/lib/ui/NativeSelect.d.ts +5 -0
  343. package/dist/lib/ui/NativeSelect.js +14 -0
  344. package/dist/lib/ui/NativeSelect.js.map +1 -0
  345. package/dist/lib/ui/ReactComponentDoc.d.ts +1 -1
  346. package/dist/lib/ui/ReactComponentDoc.js +2 -2
  347. package/dist/lib/ui/ReactComponentDoc.js.map +1 -1
  348. package/dist/lib/ui/Select.d.ts +13 -11
  349. package/dist/lib/ui/Select.js +34 -23
  350. package/dist/lib/ui/Select.js.map +1 -1
  351. package/dist/lib/ui/Separator.d.ts +4 -0
  352. package/dist/lib/ui/Separator.js +8 -0
  353. package/dist/lib/ui/Separator.js.map +1 -0
  354. package/dist/lib/ui/SyntaxHighlight.d.ts +1 -0
  355. package/dist/lib/ui/SyntaxHighlight.js.map +1 -1
  356. package/dist/lib/ui/Tooltip.d.ts +7 -7
  357. package/dist/lib/ui/Tooltip.js +16 -10
  358. package/dist/lib/ui/Tooltip.js.map +1 -1
  359. package/dist/lib/util/MdxComponents.d.ts +3 -1
  360. package/dist/lib/util/MdxComponents.js +5 -2
  361. package/dist/lib/util/MdxComponents.js.map +1 -1
  362. package/dist/lib/util/createVariantComponent.d.ts +5 -2
  363. package/dist/lib/util/createVariantComponent.js +5 -2
  364. package/dist/lib/util/createVariantComponent.js.map +1 -1
  365. package/dist/lib/util/flattenAllOf.d.ts +4 -0
  366. package/dist/lib/util/flattenAllOf.js +88 -0
  367. package/dist/lib/util/flattenAllOf.js.map +1 -0
  368. package/dist/lib/util/flattenAllOf.test.d.ts +1 -0
  369. package/dist/lib/util/flattenAllOf.test.js +587 -0
  370. package/dist/lib/util/flattenAllOf.test.js.map +1 -0
  371. package/dist/lib/util/invariant.d.ts +1 -1
  372. package/dist/lib/util/invariant.js +2 -2
  373. package/dist/lib/util/invariant.js.map +1 -1
  374. package/dist/lib/util/readFrontmatter.d.ts +6 -0
  375. package/dist/lib/util/readFrontmatter.js +12 -0
  376. package/dist/lib/util/readFrontmatter.js.map +1 -0
  377. package/dist/lib/util/syncZustandState.d.ts +5 -0
  378. package/dist/lib/util/syncZustandState.js +14 -0
  379. package/dist/lib/util/syncZustandState.js.map +1 -0
  380. package/dist/vite/api/SchemaManager.d.ts +20 -2
  381. package/dist/vite/api/SchemaManager.js +79 -31
  382. package/dist/vite/api/SchemaManager.js.map +1 -1
  383. package/dist/vite/api/SchemaManager.test.js +113 -2
  384. package/dist/vite/api/SchemaManager.test.js.map +1 -1
  385. package/dist/vite/config.js +13 -1
  386. package/dist/vite/config.js.map +1 -1
  387. package/dist/vite/dev-server.js +25 -0
  388. package/dist/vite/dev-server.js.map +1 -1
  389. package/dist/vite/error-handler.js +1 -5
  390. package/dist/vite/error-handler.js.map +1 -1
  391. package/dist/vite/mdx/remark-last-modified.js +57 -3
  392. package/dist/vite/mdx/remark-last-modified.js.map +1 -1
  393. package/dist/vite/mdx/remark-link-rewrite.js +1 -1
  394. package/dist/vite/pagefind-dev-index.d.ts +16 -0
  395. package/dist/vite/pagefind-dev-index.js +68 -0
  396. package/dist/vite/pagefind-dev-index.js.map +1 -0
  397. package/dist/vite/plugin-api-keys.js +5 -1
  398. package/dist/vite/plugin-api-keys.js.map +1 -1
  399. package/dist/vite/plugin-api.js +57 -8
  400. package/dist/vite/plugin-api.js.map +1 -1
  401. package/dist/vite/plugin-docs.js +1 -1
  402. package/dist/vite/plugin-docs.js.map +1 -1
  403. package/dist/vite/plugin-frontmatter.js +3 -5
  404. package/dist/vite/plugin-frontmatter.js.map +1 -1
  405. package/dist/vite/plugin-markdown-export.js +8 -7
  406. package/dist/vite/plugin-markdown-export.js.map +1 -1
  407. package/dist/vite/plugin-mdx.js +36 -30
  408. package/dist/vite/plugin-mdx.js.map +1 -1
  409. package/dist/vite/plugin-theme.js +10 -1
  410. package/dist/vite/plugin-theme.js.map +1 -1
  411. package/dist/vite/prerender/prerender.js +1 -19
  412. package/dist/vite/prerender/prerender.js.map +1 -1
  413. package/dist/vite/prerender/utils.d.ts +2 -0
  414. package/dist/vite/prerender/utils.js +30 -0
  415. package/dist/vite/prerender/utils.js.map +1 -0
  416. package/dist/vite/prerender/worker.js +3 -0
  417. package/dist/vite/prerender/worker.js.map +1 -1
  418. package/dist/vite/zuplo.d.ts +13 -0
  419. package/dist/vite/zuplo.js +15 -0
  420. package/dist/vite/zuplo.js.map +1 -0
  421. package/lib/ActionButton-B0CXL1Lq.js +25 -0
  422. package/lib/ActionButton-B0CXL1Lq.js.map +1 -0
  423. package/lib/Button-GUVe7pmt.js +54 -0
  424. package/lib/Button-GUVe7pmt.js.map +1 -0
  425. package/lib/{Card-KFniaZn5.js → Card-DCdq37aA.js} +2 -2
  426. package/lib/{Card-KFniaZn5.js.map → Card-DCdq37aA.js.map} +1 -1
  427. package/lib/ClaudeLogo-DJ9bU-sO.js +69 -0
  428. package/lib/ClaudeLogo-DJ9bU-sO.js.map +1 -0
  429. package/lib/{Command-CJY6q3PF.js → Command-N6VujV30.js} +26 -26
  430. package/lib/Command-N6VujV30.js.map +1 -0
  431. package/lib/Dialog-hlvmmQ_c.js +144 -0
  432. package/lib/Dialog-hlvmmQ_c.js.map +1 -0
  433. package/lib/{Drawer-Ci7XwhqT.js → Drawer-Ch7927PF.js} +7 -7
  434. package/lib/{Drawer-Ci7XwhqT.js.map → Drawer-Ch7927PF.js.map} +1 -1
  435. package/lib/DropdownMenu-DN0jNrjj.js +104 -0
  436. package/lib/DropdownMenu-DN0jNrjj.js.map +1 -0
  437. package/lib/Frame-DKlOmSkU.js +205 -0
  438. package/lib/Frame-DKlOmSkU.js.map +1 -0
  439. package/lib/HydrationBoundary-CNF2ZV3E.js +601 -0
  440. package/lib/HydrationBoundary-CNF2ZV3E.js.map +1 -0
  441. package/lib/IndexingDialog-D0YdGfbn.js +100 -0
  442. package/lib/IndexingDialog-D0YdGfbn.js.map +1 -0
  443. package/lib/Input-Cx-GeKoF.js +22 -0
  444. package/lib/Input-Cx-GeKoF.js.map +1 -0
  445. package/lib/MdxPage-stpAoBtx.js +210 -0
  446. package/lib/MdxPage-stpAoBtx.js.map +1 -0
  447. package/lib/Mermaid-Koc3z8mU.js +102 -0
  448. package/lib/Mermaid-Koc3z8mU.js.map +1 -0
  449. package/lib/{OAuthErrorPage-DJUOdr6Q.js → OAuthErrorPage-DJ811Bn_.js} +16 -16
  450. package/lib/OAuthErrorPage-DJ811Bn_.js.map +1 -0
  451. package/lib/OasProvider-CS_ASmBB.js +48 -0
  452. package/lib/OasProvider-CS_ASmBB.js.map +1 -0
  453. package/lib/OperationList-Dq_AB4W9.js +5820 -0
  454. package/lib/OperationList-Dq_AB4W9.js.map +1 -0
  455. package/lib/RouteGuard--A04ESy8.js +77 -0
  456. package/lib/RouteGuard--A04ESy8.js.map +1 -0
  457. package/lib/{SchemaList-1eLKXqn8.js → SchemaList-BJZJv1gD.js} +28 -27
  458. package/lib/SchemaList-BJZJv1gD.js.map +1 -0
  459. package/lib/SchemaView-U4JMYB3N.js +438 -0
  460. package/lib/SchemaView-U4JMYB3N.js.map +1 -0
  461. package/lib/Secret-BDBqq4p3.js +243 -0
  462. package/lib/Secret-BDBqq4p3.js.map +1 -0
  463. package/lib/Separator-BXt1LYnm.js +27 -0
  464. package/lib/Separator-BXt1LYnm.js.map +1 -0
  465. package/lib/SignUp-DCBViNUi.js +50 -0
  466. package/lib/SignUp-DCBViNUi.js.map +1 -0
  467. package/lib/{SyntaxHighlight-B0laqAqK.js → SyntaxHighlight-Dshjn3Zf.js} +1784 -1699
  468. package/lib/SyntaxHighlight-Dshjn3Zf.js.map +1 -0
  469. package/lib/{Toc-KzXCRqrX.js → Toc-Cgz6CPiE.js} +6 -6
  470. package/lib/Toc-Cgz6CPiE.js.map +1 -0
  471. package/lib/ZudokuContext-BZB1TWdT.js +387 -0
  472. package/lib/ZudokuContext-BZB1TWdT.js.map +1 -0
  473. package/lib/___vite-browser-external_commonjs-proxy-BttVsNON.js +9 -0
  474. package/lib/___vite-browser-external_commonjs-proxy-BttVsNON.js.map +1 -0
  475. package/lib/chunk-EPOLDU6W-C6C8jAwd.js +8558 -0
  476. package/lib/chunk-EPOLDU6W-C6C8jAwd.js.map +1 -0
  477. package/lib/{circular-D6wbrxuf.js → circular-BmMJjG1v.js} +6459 -6030
  478. package/lib/circular-BmMJjG1v.js.map +1 -0
  479. package/lib/{cn-dYga0KKN.js → cn-5-Gd1Dss.js} +531 -498
  480. package/lib/cn-5-Gd1Dss.js.map +1 -0
  481. package/lib/createServer-CLSZ7hWJ.js +16693 -0
  482. package/lib/createServer-CLSZ7hWJ.js.map +1 -0
  483. package/lib/createVariantComponent-Dc0vtOvr.js +18 -0
  484. package/lib/createVariantComponent-Dc0vtOvr.js.map +1 -0
  485. package/lib/{errors-XqO6MsfU.js → errors-b9I-fAOY.js} +3 -3
  486. package/lib/{errors-XqO6MsfU.js.map → errors-b9I-fAOY.js.map} +1 -1
  487. package/lib/firebase-BCXX7Qv5.js +7614 -0
  488. package/lib/firebase-BCXX7Qv5.js.map +1 -0
  489. package/lib/hook-BGlHBdET.js +52 -0
  490. package/lib/hook-BGlHBdET.js.map +1 -0
  491. package/lib/{ErrorAlert-VBJ8aHH7.js → index-CL8eDnQW.js} +5503 -4505
  492. package/lib/index-CL8eDnQW.js.map +1 -0
  493. package/lib/index-CrcNWbel.js.map +1 -1
  494. package/lib/index-DBjOT2H1.js +133 -0
  495. package/lib/index-DBjOT2H1.js.map +1 -0
  496. package/lib/index-O9RHI87z.js +3680 -0
  497. package/lib/index-O9RHI87z.js.map +1 -0
  498. package/lib/{index-C5L4favO.js → index-UOLtazB8.js} +2 -2
  499. package/lib/{index-C5L4favO.js.map → index-UOLtazB8.js.map} +1 -1
  500. package/lib/index.esm-BYObtETB.js.map +1 -1
  501. package/lib/{index.esm-BnYHxCYC.js → index.esm-B_0dvNjB.js} +20 -20
  502. package/lib/{index.esm-BnYHxCYC.js.map → index.esm-B_0dvNjB.js.map} +1 -1
  503. package/lib/index.esm-C5CBsVzN.js +34 -0
  504. package/lib/index.esm-C5CBsVzN.js.map +1 -0
  505. package/lib/{invariant-Bm-FVUQE.js → invariant-BJAl77rw.js} +6 -6
  506. package/lib/invariant-BJAl77rw.js.map +1 -0
  507. package/lib/jsx-runtime-BzflLqGi.js.map +1 -1
  508. package/lib/{mutation-CdGPxHNX.js → mutation-BISOc7OM.js} +70 -44
  509. package/lib/mutation-BISOc7OM.js.map +1 -0
  510. package/lib/ui/Accordion.js +1 -1
  511. package/lib/ui/ActionButton.js +2 -2
  512. package/lib/ui/Alert.js +1 -1
  513. package/lib/ui/AlertDialog.js +1 -1
  514. package/lib/ui/Badge.js +27 -13
  515. package/lib/ui/Badge.js.map +1 -1
  516. package/lib/ui/Breadcrumb.js +1 -1
  517. package/lib/ui/Button.js +28 -25
  518. package/lib/ui/Button.js.map +1 -1
  519. package/lib/ui/ButtonGroup.js +77 -0
  520. package/lib/ui/ButtonGroup.js.map +1 -0
  521. package/lib/ui/Callout.js +19 -19
  522. package/lib/ui/Callout.js.map +1 -1
  523. package/lib/ui/Card.js +1 -1
  524. package/lib/ui/Carousel.js +1 -1
  525. package/lib/ui/Carousel.js.map +1 -1
  526. package/lib/ui/Checkbox.js +29 -26
  527. package/lib/ui/Checkbox.js.map +1 -1
  528. package/lib/ui/CodeBlock.js +217 -7
  529. package/lib/ui/CodeBlock.js.map +1 -1
  530. package/lib/ui/Collapsible.js +32 -5
  531. package/lib/ui/Collapsible.js.map +1 -1
  532. package/lib/ui/Command.js +5 -5
  533. package/lib/ui/Command.js.map +1 -1
  534. package/lib/ui/Dialog.js +136 -106
  535. package/lib/ui/Dialog.js.map +1 -1
  536. package/lib/ui/Drawer.js +3 -3
  537. package/lib/ui/DropdownMenu.js +227 -140
  538. package/lib/ui/DropdownMenu.js.map +1 -1
  539. package/lib/ui/EmbeddedCodeBlock.js +36 -32
  540. package/lib/ui/EmbeddedCodeBlock.js.map +1 -1
  541. package/lib/ui/Form.js +1 -1
  542. package/lib/ui/Frame.js +81 -0
  543. package/lib/ui/Frame.js.map +1 -0
  544. package/lib/ui/HoverCard.js +1 -1
  545. package/lib/ui/Input.js +1 -1
  546. package/lib/ui/Item.js +188 -0
  547. package/lib/ui/Item.js.map +1 -0
  548. package/lib/ui/Kbd.js +32 -0
  549. package/lib/ui/Kbd.js.map +1 -0
  550. package/lib/ui/Label.js +1 -1
  551. package/lib/ui/NativeSelect.js +57 -0
  552. package/lib/ui/NativeSelect.js.map +1 -0
  553. package/lib/ui/Pagination.js +1 -1
  554. package/lib/ui/Popover.js +1 -1
  555. package/lib/ui/Progress.js +1 -1
  556. package/lib/ui/RadioGroup.js +1 -1
  557. package/lib/ui/ReactComponentDoc.js +13 -13
  558. package/lib/ui/ReactComponentDoc.js.map +1 -1
  559. package/lib/ui/ScrollArea.js +1 -1
  560. package/lib/ui/Secret.js +1 -1
  561. package/lib/ui/Select.js +166 -116
  562. package/lib/ui/Select.js.map +1 -1
  563. package/lib/ui/Separator.js +27 -0
  564. package/lib/ui/Separator.js.map +1 -0
  565. package/lib/ui/Skeleton.js +1 -1
  566. package/lib/ui/Slider.js +1 -1
  567. package/lib/ui/Switch.js +1 -1
  568. package/lib/ui/SyntaxHighlight.js +4 -4
  569. package/lib/ui/Tabs.js +11 -11
  570. package/lib/ui/Textarea.js +1 -1
  571. package/lib/ui/Toggle.js +1 -1
  572. package/lib/ui/ToggleGroup.js +1 -1
  573. package/lib/ui/Tooltip.js +55 -28
  574. package/lib/ui/Tooltip.js.map +1 -1
  575. package/lib/ui/Value.js +1 -1
  576. package/lib/ui/util.js +1 -1
  577. package/lib/useMutation-CFMGlAMW.js +119 -0
  578. package/lib/useMutation-CFMGlAMW.js.map +1 -0
  579. package/lib/useSuspenseQuery-CSB_rVek.js +1226 -0
  580. package/lib/useSuspenseQuery-CSB_rVek.js.map +1 -0
  581. package/lib/zudoku.__internal.js +826 -1325
  582. package/lib/zudoku.__internal.js.map +1 -1
  583. package/lib/zudoku.auth-auth0.js +19 -19
  584. package/lib/zudoku.auth-auth0.js.map +1 -1
  585. package/lib/zudoku.auth-azureb2c.js +28 -28
  586. package/lib/zudoku.auth-azureb2c.js.map +1 -1
  587. package/lib/zudoku.auth-clerk.js +41 -64
  588. package/lib/zudoku.auth-clerk.js.map +1 -1
  589. package/lib/zudoku.auth-firebase.js +10 -0
  590. package/lib/zudoku.auth-firebase.js.map +1 -0
  591. package/lib/zudoku.auth-openid.js +52 -55
  592. package/lib/zudoku.auth-openid.js.map +1 -1
  593. package/lib/zudoku.auth-supabase.js +107 -60
  594. package/lib/zudoku.auth-supabase.js.map +1 -1
  595. package/lib/zudoku.components.js +23 -21
  596. package/lib/zudoku.hooks.js +11 -24
  597. package/lib/zudoku.hooks.js.map +1 -1
  598. package/lib/zudoku.mermaid.js +10 -0
  599. package/lib/zudoku.mermaid.js.map +1 -0
  600. package/lib/zudoku.plugin-api-catalog.js +8 -8
  601. package/lib/zudoku.plugin-api-keys.js +607 -543
  602. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  603. package/lib/zudoku.plugin-custom-pages.js +1 -1
  604. package/lib/zudoku.plugin-markdown.js +10 -9
  605. package/lib/zudoku.plugin-markdown.js.map +1 -1
  606. package/lib/zudoku.plugin-openapi.js +6 -7
  607. package/lib/zudoku.plugin-openapi.js.map +1 -1
  608. package/lib/zudoku.plugin-redirect.js +1 -1
  609. package/lib/zudoku.plugin-search-pagefind.js +185 -226
  610. package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
  611. package/lib/zudoku.plugins.js +9 -8
  612. package/lib/zudoku.plugins.js.map +1 -1
  613. package/lib/zudoku.react-query.js +440 -0
  614. package/lib/zudoku.react-query.js.map +1 -0
  615. package/lib/zudoku.router.js +1130 -1404
  616. package/lib/zudoku.router.js.map +1 -1
  617. package/package.json +77 -45
  618. package/src/app/entry.server.tsx +16 -6
  619. package/src/app/main.css +61 -9
  620. package/src/app/main.tsx +5 -1
  621. package/src/app/sentry.ts +1 -1
  622. package/src/lib/auth/issuer.ts +3 -0
  623. package/src/lib/authentication/authentication.ts +29 -5
  624. package/src/lib/authentication/components/CallbackHandler.tsx +1 -1
  625. package/src/lib/authentication/components/OAuthErrorPage.tsx +1 -1
  626. package/src/lib/authentication/components/SignIn.tsx +10 -5
  627. package/src/lib/authentication/components/SignOut.tsx +7 -6
  628. package/src/lib/authentication/components/SignUp.tsx +8 -8
  629. package/src/lib/authentication/hook.ts +37 -10
  630. package/src/lib/authentication/providers/auth0.tsx +23 -11
  631. package/src/lib/authentication/providers/azureb2c.tsx +10 -3
  632. package/src/lib/authentication/providers/clerk.tsx +9 -28
  633. package/src/lib/authentication/providers/firebase.tsx +376 -0
  634. package/src/lib/authentication/providers/openid.tsx +18 -15
  635. package/src/lib/authentication/providers/supabase/SupabaseAuthUI.tsx +75 -0
  636. package/src/lib/authentication/providers/supabase.tsx +61 -59
  637. package/src/lib/authentication/state.ts +3 -23
  638. package/src/lib/authentication/ui/EmailVerificationUi.tsx +129 -0
  639. package/src/lib/authentication/ui/ZudokuAuthUi.tsx +477 -0
  640. package/src/lib/authentication/ui/icons/Apple.tsx +10 -0
  641. package/src/lib/authentication/ui/icons/Facebook.tsx +15 -0
  642. package/src/lib/authentication/ui/icons/Github.tsx +16 -0
  643. package/src/lib/authentication/ui/icons/Google.tsx +16 -0
  644. package/src/lib/authentication/ui/icons/Microsoft.tsx +12 -0
  645. package/src/lib/authentication/ui/icons/X.tsx +10 -0
  646. package/src/lib/authentication/utils/relativeRedirectUrl.ts +12 -0
  647. package/src/lib/components/Autocomplete.tsx +11 -2
  648. package/src/lib/components/Layout.tsx +3 -2
  649. package/src/lib/components/Mermaid.tsx +68 -0
  650. package/src/lib/components/PagefindSearchMeta.tsx +14 -0
  651. package/src/lib/components/Pagination.tsx +4 -5
  652. package/src/lib/components/Zudoku.tsx +7 -10
  653. package/src/lib/components/index.ts +4 -0
  654. package/src/lib/components/navigation/NavigationItem.tsx +16 -23
  655. package/src/lib/components/navigation/Toc.tsx +3 -3
  656. package/src/lib/core/RouteGuard.tsx +69 -43
  657. package/src/lib/core/ZudokuContext.ts +3 -0
  658. package/src/lib/core/plugins.ts +23 -3
  659. package/src/lib/core/react-query.ts +1 -0
  660. package/src/lib/core/transform-config.ts +29 -0
  661. package/src/lib/errors/ErrorAlert.tsx +1 -1
  662. package/src/lib/errors/ErrorMessage.tsx +38 -0
  663. package/src/lib/errors/RouterError.tsx +7 -2
  664. package/src/lib/oas/graphql/circular.test.ts +186 -0
  665. package/src/lib/oas/graphql/circular.ts +49 -10
  666. package/src/lib/oas/graphql/index.ts +7 -3
  667. package/src/lib/oas/parser/index.ts +10 -3
  668. package/src/lib/plugins/api-keys/ProtectedRoute.tsx +11 -7
  669. package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +36 -476
  670. package/src/lib/plugins/api-keys/index.tsx +76 -32
  671. package/src/lib/plugins/api-keys/settings/ApiKeyItem.tsx +342 -0
  672. package/src/lib/plugins/api-keys/settings/ApiKeyList.tsx +67 -0
  673. package/src/lib/plugins/api-keys/settings/RevealApiKey.tsx +124 -0
  674. package/src/lib/plugins/markdown/MdxPage.tsx +4 -1
  675. package/src/lib/plugins/markdown/index.tsx +2 -0
  676. package/src/lib/plugins/openapi/CollapsibleCode.tsx +5 -3
  677. package/src/lib/plugins/openapi/DownloadSchemaButton.tsx +115 -0
  678. package/src/lib/plugins/openapi/Endpoint.tsx +20 -27
  679. package/src/lib/plugins/openapi/GeneratedExampleSidecarBox.tsx +52 -0
  680. package/src/lib/plugins/openapi/OasProvider.tsx +38 -17
  681. package/src/lib/plugins/openapi/OperationList.tsx +46 -21
  682. package/src/lib/plugins/openapi/OperationListItem.tsx +15 -12
  683. package/src/lib/plugins/openapi/ParamInfos.tsx +1 -0
  684. package/src/lib/plugins/openapi/ParameterList.tsx +37 -23
  685. package/src/lib/plugins/openapi/ParameterListItem.tsx +105 -54
  686. package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +48 -7
  687. package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +101 -33
  688. package/src/lib/plugins/openapi/SchemaList.tsx +4 -0
  689. package/src/lib/plugins/openapi/Sidecar.tsx +148 -67
  690. package/src/lib/plugins/openapi/SidecarBox.tsx +26 -4
  691. package/src/lib/plugins/openapi/SidecarExamples.tsx +91 -79
  692. package/src/lib/plugins/openapi/components/ConstValue.tsx +1 -1
  693. package/src/lib/plugins/openapi/components/EnumValues.tsx +2 -2
  694. package/src/lib/plugins/openapi/components/NonHighlightedCode.tsx +22 -0
  695. package/src/lib/plugins/openapi/components/ResponseContent.tsx +63 -53
  696. package/src/lib/plugins/openapi/index.tsx +25 -36
  697. package/src/lib/plugins/openapi/interfaces.ts +33 -7
  698. package/src/lib/plugins/openapi/playground/BodyPanel.tsx +246 -30
  699. package/src/lib/plugins/openapi/playground/CollapsibleHeader.tsx +10 -6
  700. package/src/lib/plugins/openapi/playground/ExamplesDropdown.tsx +3 -2
  701. package/src/lib/plugins/openapi/playground/Headers.tsx +103 -219
  702. package/src/lib/plugins/openapi/playground/ParamsGrid.tsx +33 -1
  703. package/src/lib/plugins/openapi/playground/PathParams.tsx +26 -34
  704. package/src/lib/plugins/openapi/playground/Playground.tsx +88 -35
  705. package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +10 -31
  706. package/src/lib/plugins/openapi/playground/QueryParams.tsx +82 -136
  707. package/src/lib/plugins/openapi/playground/RequestLoginDialog.tsx +20 -1
  708. package/src/lib/plugins/openapi/playground/request-panel/MultipartField.tsx +91 -0
  709. package/src/lib/plugins/openapi/playground/request-panel/UrlQueryParams.tsx +1 -1
  710. package/src/lib/plugins/openapi/playground/request-panel/fieldManager/useKeyValueFieldManager.test.tsx +872 -0
  711. package/src/lib/plugins/openapi/playground/request-panel/useKeyValueFieldManager.ts +349 -0
  712. package/src/lib/plugins/openapi/playground/result-panel/ResponseStatusBar.tsx +2 -2
  713. package/src/lib/plugins/openapi/playground/result-panel/ResponseTab.tsx +102 -62
  714. package/src/lib/plugins/openapi/playground/result-panel/ResultPanel.tsx +1 -1
  715. package/src/lib/plugins/openapi/playground/useRememberSkipLoginDialog.tsx +3 -0
  716. package/src/lib/plugins/openapi/schema/SchemaExampleAndDefault.tsx +1 -1
  717. package/src/lib/plugins/openapi/schema/SchemaPropertyItem.tsx +89 -55
  718. package/src/lib/plugins/openapi/schema/SchemaView.tsx +100 -60
  719. package/src/lib/plugins/openapi/schema/UnionView.tsx +6 -17
  720. package/src/lib/plugins/openapi/schema/union-helpers.ts +0 -1
  721. package/src/lib/plugins/openapi/schema/utils.ts +20 -6
  722. package/src/lib/plugins/openapi/util/createHttpSnippet.ts +29 -1
  723. package/src/lib/plugins/openapi/util/generateSchemaExample.ts +11 -11
  724. package/src/lib/plugins/openapi/util/getRoutes.tsx +38 -3
  725. package/src/lib/plugins/search-pagefind/IndexingDialog.tsx +163 -0
  726. package/src/lib/plugins/search-pagefind/PagefindSearch.tsx +61 -22
  727. package/src/lib/plugins/search-pagefind/ResultList.tsx +8 -3
  728. package/src/lib/shiki.ts +37 -14
  729. package/src/lib/ui/Badge.tsx +21 -12
  730. package/src/lib/ui/Button.tsx +11 -9
  731. package/src/lib/ui/ButtonGroup.tsx +82 -0
  732. package/src/lib/ui/Callout.tsx +10 -5
  733. package/src/lib/ui/Checkbox.tsx +23 -24
  734. package/src/lib/ui/CodeBlock.tsx +3 -4
  735. package/src/lib/ui/Collapsible.tsx +26 -4
  736. package/src/lib/ui/Command.tsx +3 -3
  737. package/src/lib/ui/Dialog.tsx +112 -106
  738. package/src/lib/ui/DropdownMenu.tsx +226 -170
  739. package/src/lib/ui/EmbeddedCodeBlock.tsx +24 -19
  740. package/src/lib/ui/Frame.tsx +81 -0
  741. package/src/lib/ui/Item.tsx +192 -0
  742. package/src/lib/ui/Kbd.tsx +28 -0
  743. package/src/lib/ui/NativeSelect.tsx +47 -0
  744. package/src/lib/ui/ReactComponentDoc.tsx +17 -17
  745. package/src/lib/ui/Select.tsx +153 -126
  746. package/src/lib/ui/Separator.tsx +25 -0
  747. package/src/lib/ui/SyntaxHighlight.tsx +6 -1
  748. package/src/lib/ui/Tooltip.tsx +54 -32
  749. package/src/lib/util/MdxComponents.tsx +5 -5
  750. package/src/lib/util/createVariantComponent.tsx +31 -5
  751. package/src/lib/util/flattenAllOf.test.ts +689 -0
  752. package/src/lib/util/flattenAllOf.ts +122 -0
  753. package/src/lib/util/invariant.ts +2 -1
  754. package/src/lib/util/readFrontmatter.ts +13 -0
  755. package/src/lib/util/syncZustandState.ts +22 -0
  756. package/src/shiki/langs/c3.js +1 -0
  757. package/src/shiki/langs/gn.js +1 -0
  758. package/src/shiki/langs/markdown-nix.js +1 -0
  759. package/src/shiki/langs/moonbit.js +1 -0
  760. package/src/shiki/langs/openscad.js +1 -0
  761. package/dist/lib/plugins/openapi/playground/InlineInput.d.ts +0 -4
  762. package/dist/lib/plugins/openapi/playground/InlineInput.js +0 -3
  763. package/dist/lib/plugins/openapi/playground/InlineInput.js.map +0 -1
  764. package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupConnector.d.ts +0 -5
  765. package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupConnector.js +0 -7
  766. package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupConnector.js.map +0 -1
  767. package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupItem.d.ts +0 -4
  768. package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupItem.js +0 -10
  769. package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupItem.js.map +0 -1
  770. package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupView.d.ts +0 -5
  771. package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupView.js +0 -16
  772. package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupView.js.map +0 -1
  773. package/dist/vite/create-pagefind-index.d.ts +0 -4
  774. package/dist/vite/create-pagefind-index.js +0 -12
  775. package/dist/vite/create-pagefind-index.js.map +0 -1
  776. package/lib/Button-DmS4u8Lj.js +0 -51
  777. package/lib/Button-DmS4u8Lj.js.map +0 -1
  778. package/lib/CodeBlock-CanTUJLl.js +0 -221
  779. package/lib/CodeBlock-CanTUJLl.js.map +0 -1
  780. package/lib/Command-CJY6q3PF.js.map +0 -1
  781. package/lib/Dialog-BOl0QB3n.js +0 -114
  782. package/lib/Dialog-BOl0QB3n.js.map +0 -1
  783. package/lib/DropdownMenu-BZ2NKQ3K.js +0 -126
  784. package/lib/DropdownMenu-BZ2NKQ3K.js.map +0 -1
  785. package/lib/ErrorAlert-VBJ8aHH7.js.map +0 -1
  786. package/lib/MdxPage-DFRNwSsc.js +0 -239
  787. package/lib/MdxPage-DFRNwSsc.js.map +0 -1
  788. package/lib/OAuthErrorPage-DJUOdr6Q.js.map +0 -1
  789. package/lib/OasProvider-BMUgPYQU.js +0 -36
  790. package/lib/OasProvider-BMUgPYQU.js.map +0 -1
  791. package/lib/OperationList-DVig5I94.js +0 -5446
  792. package/lib/OperationList-DVig5I94.js.map +0 -1
  793. package/lib/Pagination-CT4VUR6u.js +0 -37
  794. package/lib/Pagination-CT4VUR6u.js.map +0 -1
  795. package/lib/RouteGuard-BPWQlxy5.js +0 -56
  796. package/lib/RouteGuard-BPWQlxy5.js.map +0 -1
  797. package/lib/RouterError-fm21cqlj.js +0 -41
  798. package/lib/RouterError-fm21cqlj.js.map +0 -1
  799. package/lib/SchemaList-1eLKXqn8.js.map +0 -1
  800. package/lib/SchemaView-fq3uKfOA.js +0 -458
  801. package/lib/SchemaView-fq3uKfOA.js.map +0 -1
  802. package/lib/Select-CPoGZU_V.js +0 -372
  803. package/lib/Select-CPoGZU_V.js.map +0 -1
  804. package/lib/SignUp-BraHuRN_.js +0 -56
  805. package/lib/SignUp-BraHuRN_.js.map +0 -1
  806. package/lib/SyntaxHighlight-B0laqAqK.js.map +0 -1
  807. package/lib/Toc-KzXCRqrX.js.map +0 -1
  808. package/lib/ZudokuContext-BXTZApgy.js +0 -1506
  809. package/lib/ZudokuContext-BXTZApgy.js.map +0 -1
  810. package/lib/chunk-PVWAREVJ-BO6B-RAk.js +0 -7965
  811. package/lib/chunk-PVWAREVJ-BO6B-RAk.js.map +0 -1
  812. package/lib/circular-D6wbrxuf.js.map +0 -1
  813. package/lib/cn-dYga0KKN.js.map +0 -1
  814. package/lib/createServer-C5aY10Bc.js +0 -12559
  815. package/lib/createServer-C5aY10Bc.js.map +0 -1
  816. package/lib/hook-CAebs2rv.js +0 -31
  817. package/lib/hook-CAebs2rv.js.map +0 -1
  818. package/lib/index-BPSpOxTK.js +0 -1058
  819. package/lib/index-BPSpOxTK.js.map +0 -1
  820. package/lib/index-Bb9AsFlk.js +0 -3318
  821. package/lib/index-Bb9AsFlk.js.map +0 -1
  822. package/lib/invariant-Bm-FVUQE.js.map +0 -1
  823. package/lib/mutation-CdGPxHNX.js.map +0 -1
  824. package/lib/useExposedProps-Cd7Yg_uG.js +0 -113
  825. package/lib/useExposedProps-Cd7Yg_uG.js.map +0 -1
  826. package/src/lib/plugins/openapi/playground/InlineInput.tsx +0 -6
  827. package/src/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupConnector.tsx +0 -36
  828. package/src/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupItem.tsx +0 -25
  829. package/src/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupView.tsx +0 -42
@@ -1,56 +1,179 @@
1
1
  import { j as e } from "./jsx-runtime-BzflLqGi.js";
2
- import { CircleSlashIcon as z, CheckIcon as ue, XIcon as he, PencilLineIcon as fe, RefreshCwIcon as pe, TrashIcon as me, KeyRoundIcon as xe } from "lucide-react";
3
- import { R as ye } from "./RouterError-fm21cqlj.js";
4
- import { i as I } from "./invariant-Bm-FVUQE.js";
5
- import { O as ge, b as je } from "./chunk-PVWAREVJ-BO6B-RAk.js";
6
- import { u as Ce } from "./hook-CAebs2rv.js";
7
- import { D as ve, a as Y } from "./ErrorAlert-VBJ8aHH7.js";
8
- import { Button as w } from "./ui/Button.js";
9
- import { a as se, i as ne, b as we } from "./ZudokuContext-BXTZApgy.js";
10
- import { u as O, A as M, a as q, b as be, S as ke, c as Ne, d as Ke, e as Ee, f as De, g as Z, h as Ae } from "./Select-CPoGZU_V.js";
11
- import * as L from "react";
12
- import Pe, { createContext as Q, useRef as E, useLayoutEffect as Ie, useEffect as ie, useId as _, useContext as B, useInsertionEffect as Re, useMemo as F, useCallback as Se, Children as Te, isValidElement as Oe, useState as K, forwardRef as Me } from "react";
13
- import { C as qe, a as $e } from "./Card-KFniaZn5.js";
14
- import { e as H, f as D, D as V, g as G, a as J, b as U, c as W, d as re } from "./Dialog-BOl0QB3n.js";
15
- import { Input as ae } from "./ui/Input.js";
16
- import { c as A } from "./cn-dYga0KKN.js";
17
- import { a as ze } from "./index.esm-BYObtETB.js";
18
- import { B as Fe } from "./Button-DmS4u8Lj.js";
19
- import { S as Le } from "./Spinner-CI6bRyZw.js";
20
- import { useAuth as Qe } from "./zudoku.hooks.js";
21
- const _e = () => {
22
- const t = Ce();
23
- return t.isAuthEnabled && t.isPending ? null : t.isAuthenticated ? /* @__PURE__ */ e.jsx(ge, {}) : t.isAuthEnabled ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col justify-center gap-2 items-center h-1/2", children: [
24
- "Please login first to view this page",
25
- /* @__PURE__ */ e.jsx(w, { onClick: () => t.login(), children: "Login" })
26
- ] }) : /* @__PURE__ */ e.jsx("div", { className: "flex flex-col justify-center gap-2 items-center h-1/2", children: /* @__PURE__ */ e.jsxs(ve, { className: "max-w-[600px]", children: [
27
- "Authentication needs to be enabled for API keys to work. Enable it in your Zudoku configuration under ",
28
- /* @__PURE__ */ e.jsx("code", { children: "authentication" }),
29
- "."
30
- ] }) });
31
- }, Be = Q({});
32
- function oe(t) {
33
- const i = E(null);
34
- return i.current === null && (i.current = t()), i.current;
2
+ import { TrashIcon as me, CircleSlashIcon as z, CheckIcon as xe, XIcon as ye, PencilLineIcon as ge, RefreshCwIcon as je, KeyRoundIcon as ve } from "lucide-react";
3
+ import { Z as M, i as E } from "./invariant-BJAl77rw.js";
4
+ import * as F from "react";
5
+ import { createContext as Q, useRef as A, useLayoutEffect as Ce, useEffect as ie, useId as H, useContext as V, useInsertionEffect as we, useMemo as L, useCallback as ke, Children as Ee, isValidElement as Ie, useState as I } from "react";
6
+ import { D as be, c as Ke, d as ee, B as De, E as Pe } from "./index-CL8eDnQW.js";
7
+ import { b as re } from "./index-DBjOT2H1.js";
8
+ import { F as Ae, g as Se, j as Re, h as Ne, d as Oe, I as Te, a as qe, b as Me, k as Fe, c as $e } from "./Frame-DKlOmSkU.js";
9
+ import { A as D, a as P, b as ae } from "./Mermaid-Koc3z8mU.js";
10
+ import { e as _, f as S, D as B, g as Z, a as G, b as J, c as Y, d as oe } from "./Dialog-hlvmmQ_c.js";
11
+ import { Button as le } from "./ui/Button.js";
12
+ import { a as ce, u as ze } from "./useSuspenseQuery-CSB_rVek.js";
13
+ import { u as q } from "./useMutation-CFMGlAMW.js";
14
+ import { a as Le } from "./index.esm-BYObtETB.js";
15
+ import { u as Qe } from "./chunk-EPOLDU6W-C6C8jAwd.js";
16
+ import { A as He } from "./ActionButton-B0CXL1Lq.js";
17
+ import { S as Ve, a as _e, b as Be, c as Ze, d as Ge, e as te, f as Je } from "./Secret-BDBqq4p3.js";
18
+ import { a as U } from "./ZudokuContext-BZB1TWdT.js";
19
+ import { Input as Ye } from "./ui/Input.js";
20
+ import { c as W } from "./cn-5-Gd1Dss.js";
21
+ import { B as k } from "./Button-GUVe7pmt.js";
22
+ import { I as Ue } from "./Input-Cx-GeKoF.js";
23
+ function We({ error: t }) {
24
+ const a = t instanceof Error ? t.message : "Something went wrong", s = process.env.NODE_ENV === "development", n = t instanceof M ? t.developerHint : void 0, r = t instanceof M ? t.title : "Something went wrong", i = t instanceof Error ? t.stack : void 0, o = t instanceof Error ? t.cause : void 0, d = o instanceof Error ? String(o.stack) : i;
25
+ return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
26
+ /* @__PURE__ */ e.jsxs(D, { variant: "destructive", children: [
27
+ /* @__PURE__ */ e.jsx(P, { children: r }),
28
+ /* @__PURE__ */ e.jsx(ae, { children: a })
29
+ ] }),
30
+ s && n && /* @__PURE__ */ e.jsx(be, { className: "mb-4", children: n }),
31
+ s && d && /* @__PURE__ */ e.jsx(
32
+ Ke,
33
+ {
34
+ className: "max-h-[400px] [&>pre]:p-4",
35
+ language: "js",
36
+ code: d
37
+ }
38
+ )
39
+ ] });
35
40
  }
36
- const He = typeof window < "u", Ve = He ? Ie : ie, le = /* @__PURE__ */ Q(null);
37
- function Ge(t) {
41
+ const Xe = ({
42
+ service: t,
43
+ onOpenChange: a
44
+ }) => {
45
+ const s = U(), n = ce(), r = Qe(), i = Le({
46
+ defaultValues: {
47
+ expiresOn: "30"
48
+ }
49
+ }), o = re(), d = q({
50
+ mutationFn: ({ description: c, expiresOn: u }) => {
51
+ if (!t.createKey)
52
+ throw new Error("createKey not implemented");
53
+ const p = u !== "never" ? et(Number(u)) : void 0;
54
+ return t.createKey({
55
+ apiKey: {
56
+ description: c || "Secret Key",
57
+ expiresOn: p
58
+ },
59
+ context: s,
60
+ auth: o
61
+ });
62
+ },
63
+ onSuccess: async () => {
64
+ await n.invalidateQueries({ queryKey: ["api-keys"] }), await r("/settings/api-keys/");
65
+ }
66
+ });
67
+ return t.createKey ? /* @__PURE__ */ e.jsxs(
68
+ "form",
69
+ {
70
+ onSubmit: i.handleSubmit(
71
+ (c) => d.mutate(
72
+ { ...c },
73
+ {
74
+ onSuccess: () => a(!1)
75
+ }
76
+ )
77
+ ),
78
+ children: [
79
+ d.error && /* @__PURE__ */ e.jsxs(D, { variant: "destructive", className: "mb-4", children: [
80
+ /* @__PURE__ */ e.jsx(P, { children: "Error" }),
81
+ /* @__PURE__ */ e.jsx(ae, { children: d.error.message })
82
+ ] }),
83
+ /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 flex-col text-sm font-medium", children: [
84
+ "Name",
85
+ /* @__PURE__ */ e.jsx(Ye, { ...i.register("description") }),
86
+ "Expiration",
87
+ /* @__PURE__ */ e.jsxs(
88
+ Ve,
89
+ {
90
+ onValueChange: (c) => i.setValue("expiresOn", c),
91
+ defaultValue: i.getValues("expiresOn"),
92
+ children: [
93
+ /* @__PURE__ */ e.jsx(_e, { children: /* @__PURE__ */ e.jsx(Be, {}) }),
94
+ /* @__PURE__ */ e.jsx(Ze, { children: /* @__PURE__ */ e.jsxs(Ge, { children: [
95
+ [7, 30, 60, 90].map((c) => /* @__PURE__ */ e.jsxs(te, { value: String(c), children: [
96
+ c,
97
+ " days"
98
+ ] }, c)),
99
+ /* @__PURE__ */ e.jsx(te, { value: "never", children: "Never" })
100
+ ] }) })
101
+ ]
102
+ }
103
+ ),
104
+ /* @__PURE__ */ e.jsxs(_, { children: [
105
+ /* @__PURE__ */ e.jsx(S, { asChild: !0, children: /* @__PURE__ */ e.jsx(le, { variant: "outline", children: "Cancel" }) }),
106
+ /* @__PURE__ */ e.jsx(He, { isPending: d.isPending, children: "Generate Key" })
107
+ ] })
108
+ ] })
109
+ ]
110
+ }
111
+ ) : null;
112
+ }, et = (t) => {
113
+ const a = /* @__PURE__ */ new Date();
114
+ return a.setDate(a.getDate() + t), a.toISOString();
115
+ }, de = ({
116
+ service: t,
117
+ isOpen: a,
118
+ onOpenChange: s,
119
+ trigger: n,
120
+ buttonVariant: r = "outline"
121
+ }) => {
122
+ const i = /* @__PURE__ */ e.jsx(le, { variant: r, children: "Create API Key" });
123
+ return /* @__PURE__ */ e.jsxs(B, { open: a, onOpenChange: s, children: [
124
+ /* @__PURE__ */ e.jsx(Z, { asChild: !0, children: n ?? i }),
125
+ /* @__PURE__ */ e.jsxs(G, { children: [
126
+ /* @__PURE__ */ e.jsx(J, { children: /* @__PURE__ */ e.jsx(Y, { children: "Create API Key" }) }),
127
+ /* @__PURE__ */ e.jsx(Xe, { service: t, onOpenChange: s })
128
+ ] })
129
+ ] });
130
+ }, tt = Q({});
131
+ function ue(t) {
132
+ const a = A(null);
133
+ return a.current === null && (a.current = t()), a.current;
134
+ }
135
+ const st = typeof window < "u", nt = st ? Ce : ie, fe = /* @__PURE__ */ Q(null);
136
+ function it(t) {
38
137
  return typeof t == "object" && t !== null;
39
138
  }
40
- function Je(t) {
41
- return Ge(t) && "offsetHeight" in t;
139
+ function rt(t) {
140
+ return it(t) && "offsetHeight" in t;
42
141
  }
43
- const Ue = Q({
142
+ const at = Q({
44
143
  transformPagePoint: (t) => t,
45
144
  isStatic: !1,
46
145
  reducedMotion: "never"
47
146
  });
48
- class We extends L.Component {
49
- getSnapshotBeforeUpdate(i) {
147
+ function se(t, a) {
148
+ if (typeof t == "function")
149
+ return t(a);
150
+ t != null && (t.current = a);
151
+ }
152
+ function ot(...t) {
153
+ return (a) => {
154
+ let s = !1;
155
+ const n = t.map((r) => {
156
+ const i = se(r, a);
157
+ return !s && typeof i == "function" && (s = !0), i;
158
+ });
159
+ if (s)
160
+ return () => {
161
+ for (let r = 0; r < n.length; r++) {
162
+ const i = n[r];
163
+ typeof i == "function" ? i() : se(t[r], null);
164
+ }
165
+ };
166
+ };
167
+ }
168
+ function lt(...t) {
169
+ return F.useCallback(ot(...t), t);
170
+ }
171
+ class ct extends F.Component {
172
+ getSnapshotBeforeUpdate(a) {
50
173
  const s = this.props.childRef.current;
51
- if (s && i.isPresent && !this.props.isPresent) {
52
- const n = s.offsetParent, r = Je(n) && n.offsetWidth || 0, a = this.props.sizeRef.current;
53
- a.height = s.offsetHeight || 0, a.width = s.offsetWidth || 0, a.top = s.offsetTop, a.left = s.offsetLeft, a.right = r - a.width - a.left;
174
+ if (s && a.isPresent && !this.props.isPresent) {
175
+ const n = s.offsetParent, r = rt(n) && n.offsetWidth || 0, i = this.props.sizeRef.current;
176
+ i.height = s.offsetHeight || 0, i.width = s.offsetWidth || 0, i.top = s.offsetTop, i.left = s.offsetLeft, i.right = r - i.width - i.left;
54
177
  }
55
178
  return null;
56
179
  }
@@ -63,574 +186,502 @@ class We extends L.Component {
63
186
  return this.props.children;
64
187
  }
65
188
  }
66
- function Xe({ children: t, isPresent: i, anchorX: s, root: n }) {
67
- const r = _(), a = E(null), l = E({
189
+ function dt({ children: t, isPresent: a, anchorX: s, root: n }) {
190
+ const r = H(), i = A(null), o = A({
68
191
  width: 0,
69
192
  height: 0,
70
193
  top: 0,
71
194
  left: 0,
72
195
  right: 0
73
- }), { nonce: u } = B(Ue);
74
- return Re(() => {
75
- const { width: h, height: d, top: g, left: f, right: m } = l.current;
76
- if (i || !a.current || !h || !d)
196
+ }), { nonce: d } = V(at), c = lt(i, t?.ref);
197
+ return we(() => {
198
+ const { width: u, height: p, top: f, left: m, right: g } = o.current;
199
+ if (a || !i.current || !u || !p)
77
200
  return;
78
- const p = s === "left" ? `left: ${f}` : `right: ${m}`;
79
- a.current.dataset.motionPopId = r;
80
- const x = document.createElement("style");
81
- u && (x.nonce = u);
82
- const j = n ?? document.head;
83
- return j.appendChild(x), x.sheet && x.sheet.insertRule(`
201
+ const j = s === "left" ? `left: ${m}` : `right: ${g}`;
202
+ i.current.dataset.motionPopId = r;
203
+ const l = document.createElement("style");
204
+ d && (l.nonce = d);
205
+ const x = n ?? document.head;
206
+ return x.appendChild(l), l.sheet && l.sheet.insertRule(`
84
207
  [data-motion-pop-id="${r}"] {
85
208
  position: absolute !important;
86
- width: ${h}px !important;
87
- height: ${d}px !important;
88
- ${p}px !important;
89
- top: ${g}px !important;
209
+ width: ${u}px !important;
210
+ height: ${p}px !important;
211
+ ${j}px !important;
212
+ top: ${f}px !important;
90
213
  }
91
214
  `), () => {
92
- j.contains(x) && j.removeChild(x);
215
+ x.contains(l) && x.removeChild(l);
93
216
  };
94
- }, [i]), e.jsx(We, { isPresent: i, childRef: a, sizeRef: l, children: L.cloneElement(t, { ref: a }) });
217
+ }, [a]), e.jsx(ct, { isPresent: a, childRef: i, sizeRef: o, children: F.cloneElement(t, { ref: c }) });
95
218
  }
96
- const Ye = ({ children: t, initial: i, isPresent: s, onExitComplete: n, custom: r, presenceAffectsLayout: a, mode: l, anchorX: u, root: h }) => {
97
- const d = oe(Ze), g = _();
98
- let f = !0, m = F(() => (f = !1, {
99
- id: g,
100
- initial: i,
219
+ const ut = ({ children: t, initial: a, isPresent: s, onExitComplete: n, custom: r, presenceAffectsLayout: i, mode: o, anchorX: d, root: c }) => {
220
+ const u = ue(ft), p = H();
221
+ let f = !0, m = L(() => (f = !1, {
222
+ id: p,
223
+ initial: a,
101
224
  isPresent: s,
102
225
  custom: r,
103
- onExitComplete: (p) => {
104
- d.set(p, !0);
105
- for (const x of d.values())
106
- if (!x)
226
+ onExitComplete: (g) => {
227
+ u.set(g, !0);
228
+ for (const j of u.values())
229
+ if (!j)
107
230
  return;
108
231
  n && n();
109
232
  },
110
- register: (p) => (d.set(p, !1), () => d.delete(p))
111
- }), [s, d, n]);
112
- return a && f && (m = { ...m }), F(() => {
113
- d.forEach((p, x) => d.set(x, !1));
114
- }, [s]), L.useEffect(() => {
115
- !s && !d.size && n && n();
116
- }, [s]), l === "popLayout" && (t = e.jsx(Xe, { isPresent: s, anchorX: u, root: h, children: t })), e.jsx(le.Provider, { value: m, children: t });
233
+ register: (g) => (u.set(g, !1), () => u.delete(g))
234
+ }), [s, u, n]);
235
+ return i && f && (m = { ...m }), L(() => {
236
+ u.forEach((g, j) => u.set(j, !1));
237
+ }, [s]), F.useEffect(() => {
238
+ !s && !u.size && n && n();
239
+ }, [s]), o === "popLayout" && (t = e.jsx(dt, { isPresent: s, anchorX: d, root: c, children: t })), e.jsx(fe.Provider, { value: m, children: t });
117
240
  };
118
- function Ze() {
241
+ function ft() {
119
242
  return /* @__PURE__ */ new Map();
120
243
  }
121
- function et(t = !0) {
122
- const i = B(le);
123
- if (i === null)
244
+ function pt(t = !0) {
245
+ const a = V(fe);
246
+ if (a === null)
124
247
  return [!0, null];
125
- const { isPresent: s, onExitComplete: n, register: r } = i, a = _();
248
+ const { isPresent: s, onExitComplete: n, register: r } = a, i = H();
126
249
  ie(() => {
127
250
  if (t)
128
- return r(a);
251
+ return r(i);
129
252
  }, [t]);
130
- const l = Se(() => t && n && n(a), [a, n, t]);
131
- return !s && n ? [!1, l] : [!0];
253
+ const o = ke(() => t && n && n(i), [i, n, t]);
254
+ return !s && n ? [!1, o] : [!0];
132
255
  }
133
256
  const R = (t) => t.key || "";
134
- function ee(t) {
135
- const i = [];
136
- return Te.forEach(t, (s) => {
137
- Oe(s) && i.push(s);
138
- }), i;
257
+ function ne(t) {
258
+ const a = [];
259
+ return Ee.forEach(t, (s) => {
260
+ Ie(s) && a.push(s);
261
+ }), a;
139
262
  }
140
- const tt = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presenceAffectsLayout: r = !0, mode: a = "sync", propagate: l = !1, anchorX: u = "left", root: h }) => {
141
- const [d, g] = et(l), f = F(() => ee(t), [t]), m = l && !d ? [] : f.map(R), p = E(!0), x = E(f), j = oe(() => /* @__PURE__ */ new Map()), [P, o] = K(f), [c, C] = K(f);
142
- Ve(() => {
143
- p.current = !1, x.current = f;
144
- for (let v = 0; v < c.length; v++) {
145
- const y = R(c[v]);
146
- m.includes(y) ? j.delete(y) : j.get(y) !== !0 && j.set(y, !1);
263
+ const ht = ({ children: t, custom: a, initial: s = !0, onExitComplete: n, presenceAffectsLayout: r = !0, mode: i = "sync", propagate: o = !1, anchorX: d = "left", root: c }) => {
264
+ const [u, p] = pt(o), f = L(() => ne(t), [t]), m = o && !u ? [] : f.map(R), g = A(!0), j = A(f), l = ue(() => /* @__PURE__ */ new Map()), [x, v] = I(f), [h, C] = I(f);
265
+ nt(() => {
266
+ g.current = !1, j.current = f;
267
+ for (let w = 0; w < h.length; w++) {
268
+ const y = R(h[w]);
269
+ m.includes(y) ? l.delete(y) : l.get(y) !== !0 && l.set(y, !1);
147
270
  }
148
- }, [c, m.length, m.join("-")]);
149
- const b = [];
150
- if (f !== P) {
151
- let v = [...f];
152
- for (let y = 0; y < c.length; y++) {
153
- const N = c[y], $ = R(N);
154
- m.includes($) || (v.splice(y, 0, N), b.push(N));
271
+ }, [h, m.length, m.join("-")]);
272
+ const K = [];
273
+ if (f !== x) {
274
+ let w = [...f];
275
+ for (let y = 0; y < h.length; y++) {
276
+ const b = h[y], $ = R(b);
277
+ m.includes($) || (w.splice(y, 0, b), K.push(b));
155
278
  }
156
- return a === "wait" && b.length && (v = b), C(ee(v)), o(f), null;
279
+ return i === "wait" && K.length && (w = K), C(ne(w)), v(f), null;
157
280
  }
158
- process.env.NODE_ENV !== "production" && a === "wait" && c.length > 1 && console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);
159
- const { forceRender: k } = B(Be);
160
- return e.jsx(e.Fragment, { children: c.map((v) => {
161
- const y = R(v), N = l && !d ? !1 : f === c || m.includes(y), $ = () => {
162
- if (j.has(y))
163
- j.set(y, !0);
281
+ process.env.NODE_ENV !== "production" && i === "wait" && h.length > 1 && console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);
282
+ const { forceRender: pe } = V(tt);
283
+ return e.jsx(e.Fragment, { children: h.map((w) => {
284
+ const y = R(w), b = o && !u ? !1 : f === h || m.includes(y), $ = () => {
285
+ if (l.has(y))
286
+ l.set(y, !0);
164
287
  else
165
288
  return;
166
289
  let X = !0;
167
- j.forEach((de) => {
168
- de || (X = !1);
169
- }), X && (k?.(), C(x.current), l && g?.(), n && n());
290
+ l.forEach((he) => {
291
+ he || (X = !1);
292
+ }), X && (pe?.(), C(j.current), o && p?.(), n && n());
170
293
  };
171
- return e.jsx(Ye, { isPresent: N, initial: !p.current || s ? void 0 : !1, custom: i, presenceAffectsLayout: r, mode: a, root: h, onExitComplete: N ? void 0 : $, anchorX: u, children: v }, y);
294
+ return e.jsx(ut, { isPresent: b, initial: !g.current || s ? void 0 : !1, custom: a, presenceAffectsLayout: r, mode: i, root: c, onExitComplete: b ? void 0 : $, anchorX: d, children: w }, y);
172
295
  }) });
173
- }, ce = Me(
174
- ({ isPending: t, children: i, className: s, ...n }, r) => /* @__PURE__ */ e.jsxs(
175
- Fe,
176
- {
177
- ref: r,
178
- disabled: t,
179
- ...n,
180
- className: A("relative", s),
181
- children: [
182
- t && /* @__PURE__ */ e.jsx("div", { className: "absolute inset-0 grid place-items-center", children: /* @__PURE__ */ e.jsx(Le, {}) }),
183
- /* @__PURE__ */ e.jsx("span", { className: A("block", t && "invisible"), children: i })
184
- ]
185
- }
186
- )
187
- );
188
- ce.displayName = "ActionButton";
189
- const st = ({
190
- service: t,
191
- onOpenChange: i
296
+ }, mt = ({
297
+ apiKey: t,
298
+ onDeleteKey: a,
299
+ className: s
192
300
  }) => {
193
- const s = se(), n = ne(), r = je(), a = ze({
194
- defaultValues: {
195
- expiresOn: "30"
196
- }
197
- }), l = Qe(), u = O({
198
- mutationFn: ({ description: h, expiresOn: d }) => {
199
- if (!t.createKey)
200
- throw new Error("createKey not implemented");
201
- const g = d !== "never" ? nt(Number(d)) : void 0;
202
- return t.createKey({
203
- apiKey: {
204
- description: h || "Secret Key",
205
- expiresOn: g
206
- },
207
- context: s,
208
- auth: l
209
- });
210
- },
211
- onSuccess: async () => {
212
- await n.invalidateQueries({ queryKey: ["api-keys"] }), await r("/settings/api-keys/");
213
- }
214
- });
215
- return t.createKey ? /* @__PURE__ */ e.jsxs(
216
- "form",
217
- {
218
- onSubmit: a.handleSubmit(
219
- (h) => u.mutate(
220
- { ...h },
221
- {
222
- onSuccess: () => i(!1)
223
- }
224
- )
301
+ const [n, r] = I(!1), { key: i, createdOn: o, expiresOn: d } = t, c = d && new Date(d) < /* @__PURE__ */ new Date(), u = d ? Math.ceil(
302
+ (new Date(d).getTime() - Date.now()) / (1e3 * 60 * 60 * 24)
303
+ ) : 1 / 0, p = u <= 7 && !c;
304
+ return /* @__PURE__ */ e.jsxs("div", { className: W("grid col-span-full grid-cols-subgrid p-6", s), children: [
305
+ /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1", children: [
306
+ /* @__PURE__ */ e.jsx(
307
+ Je,
308
+ {
309
+ className: "max-w-fit w-full",
310
+ secret: i,
311
+ status: c ? "expired" : p ? "expiring" : "active",
312
+ revealed: n,
313
+ onReveal: r
314
+ }
225
315
  ),
226
- children: [
227
- u.error && /* @__PURE__ */ e.jsxs(M, { variant: "destructive", className: "mb-4", children: [
228
- /* @__PURE__ */ e.jsx(q, { children: "Error" }),
229
- /* @__PURE__ */ e.jsx(be, { children: u.error.message })
316
+ /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1 mt-0.5 text-nowrap", children: [
317
+ o && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-muted-foreground", children: [
318
+ "Created ",
319
+ xt(o),
320
+ "."
230
321
  ] }),
231
- /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 flex-col text-sm font-medium", children: [
232
- "Name",
233
- /* @__PURE__ */ e.jsx(ae, { ...a.register("description") }),
234
- "Expiration",
235
- /* @__PURE__ */ e.jsxs(
236
- ke,
322
+ " ",
323
+ d && p && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-primary", children: [
324
+ "Expires in ",
325
+ u,
326
+ " ",
327
+ u === 1 ? "day" : "days",
328
+ "."
329
+ ] }),
330
+ d && c && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-primary", children: [
331
+ "Expired",
332
+ " ",
333
+ u === 0 ? "today." : `${u * -1} days ago.`
334
+ ] })
335
+ ] })
336
+ ] }),
337
+ /* @__PURE__ */ e.jsx("div", { className: "flex justify-end", children: d && a && /* @__PURE__ */ e.jsxs(B, { children: [
338
+ /* @__PURE__ */ e.jsx(Z, { asChild: !0, children: /* @__PURE__ */ e.jsx(k, { variant: "ghost", size: "icon", children: /* @__PURE__ */ e.jsx(me, { size: 16 }) }) }),
339
+ /* @__PURE__ */ e.jsxs(G, { children: [
340
+ /* @__PURE__ */ e.jsxs(J, { children: [
341
+ /* @__PURE__ */ e.jsx(Y, { children: "Delete API Key" }),
342
+ /* @__PURE__ */ e.jsx(oe, { children: "Are you sure you want to delete this API key?" })
343
+ ] }),
344
+ /* @__PURE__ */ e.jsxs(_, { children: [
345
+ /* @__PURE__ */ e.jsx(S, { asChild: !0, children: /* @__PURE__ */ e.jsx(k, { variant: "outline", children: "Cancel" }) }),
346
+ /* @__PURE__ */ e.jsx(S, { asChild: !0, children: /* @__PURE__ */ e.jsx(
347
+ k,
237
348
  {
238
- onValueChange: (h) => a.setValue("expiresOn", h),
239
- defaultValue: a.getValues("expiresOn"),
240
- children: [
241
- /* @__PURE__ */ e.jsx(Ne, { children: /* @__PURE__ */ e.jsx(Ke, {}) }),
242
- /* @__PURE__ */ e.jsx(Ee, { children: /* @__PURE__ */ e.jsxs(De, { children: [
243
- [7, 30, 60, 90].map((h) => /* @__PURE__ */ e.jsxs(Z, { value: String(h), children: [
244
- h,
245
- " days"
246
- ] }, h)),
247
- /* @__PURE__ */ e.jsx(Z, { value: "never", children: "Never" })
248
- ] }) })
249
- ]
349
+ onClick: () => {
350
+ a();
351
+ },
352
+ children: "Delete"
250
353
  }
251
- ),
252
- /* @__PURE__ */ e.jsxs(H, { children: [
253
- /* @__PURE__ */ e.jsx(D, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { variant: "outline", children: "Cancel" }) }),
254
- /* @__PURE__ */ e.jsx(ce, { isPending: u.isPending, children: "Generate Key" })
255
- ] })
354
+ ) })
256
355
  ] })
257
- ]
258
- }
259
- ) : null;
260
- }, nt = (t) => {
261
- const i = /* @__PURE__ */ new Date();
262
- return i.setDate(i.getDate() + t), i.toISOString();
263
- }, te = ({
264
- service: t,
265
- isOpen: i,
266
- onOpenChange: s,
267
- trigger: n,
268
- buttonVariant: r = "outline"
269
- }) => {
270
- const a = /* @__PURE__ */ e.jsx(w, { variant: r, children: "Create API Key" });
271
- return /* @__PURE__ */ e.jsxs(V, { open: i, onOpenChange: s, children: [
272
- /* @__PURE__ */ e.jsx(G, { asChild: !0, children: n ?? a }),
273
- /* @__PURE__ */ e.jsxs(J, { children: [
274
- /* @__PURE__ */ e.jsx(U, { children: /* @__PURE__ */ e.jsx(W, { children: "Create API Key" }) }),
275
- /* @__PURE__ */ e.jsx(st, { service: t, onOpenChange: s })
276
- ] })
356
+ ] })
357
+ ] }) })
277
358
  ] });
278
- }, it = ({ service: t }) => {
279
- const i = se(), s = ne(), [n, r] = K(
280
- null
281
- ), [a, l] = K(""), { data: u, isFetching: h } = we({
282
- queryFn: () => t.getConsumers(i),
283
- queryKey: ["api-keys"],
284
- retry: !1
285
- }), [d, g] = K(!1), f = O({
359
+ }, xt = (t) => {
360
+ const a = /* @__PURE__ */ new Date(), s = new Date(t), n = Math.floor((a.getTime() - s.getTime()) / 1e3), r = new Intl.RelativeTimeFormat("en", { numeric: "auto" });
361
+ return n < 60 ? r.format(-n, "second") : n < 3600 ? r.format(-Math.floor(n / 60), "minute") : n < 86400 ? r.format(-Math.floor(n / 3600), "hour") : n < 2592e3 ? r.format(-Math.floor(n / 86400), "day") : n < 31536e3 ? r.format(-Math.floor(n / 2592e3), "month") : r.format(-Math.floor(n / 31536e3), "year");
362
+ }, yt = ({
363
+ consumer: t,
364
+ onUpdate: a,
365
+ onRollKey: s,
366
+ onDeleteKey: n
367
+ }) => {
368
+ const [r, i] = I(!1), [o, d] = I(t.label), c = ce(), u = U(), p = q({
369
+ mutationFn: async (l) => {
370
+ if (!s)
371
+ throw new Error("rollKey not implemented");
372
+ return await s?.(l, u);
373
+ },
374
+ onSuccess: () => void c.invalidateQueries({ queryKey: ["api-keys"] })
375
+ }), f = q({
286
376
  mutationFn: ({
287
- consumerId: o,
288
- keyId: c
377
+ consumerId: l,
378
+ keyId: x
289
379
  }) => {
290
- if (!t.deleteKey)
380
+ if (!n)
291
381
  throw new Error("deleteKey not implemented");
292
- return t.deleteKey(o, c, i);
382
+ return n(l, x, u);
293
383
  },
294
- onMutate: async ({ consumerId: o, keyId: c }) => {
295
- await s.cancelQueries({ queryKey: ["api-keys"] });
296
- const C = s.getQueryData([
384
+ onMutate: async ({ consumerId: l, keyId: x }) => {
385
+ await c.cancelQueries({ queryKey: ["api-keys"] });
386
+ const v = c.getQueryData([
297
387
  "api-keys"
298
388
  ]);
299
- return s.setQueryData(["api-keys"], (b) => b && b.map((k) => k.id === o ? {
300
- ...k,
301
- apiKeys: k.apiKeys.filter((v) => v.id !== c)
302
- } : k)), { previousData: C };
389
+ return c.setQueryData(["api-keys"], (h) => h && h.map((C) => C.id === l ? {
390
+ ...C,
391
+ apiKeys: C.apiKeys.filter((K) => K.id !== x)
392
+ } : C)), { previousData: v };
303
393
  },
304
- onError: (o, c, C) => {
305
- C?.previousData && s.setQueryData(["api-keys"], C.previousData);
394
+ onError: (l, x, v) => {
395
+ v?.previousData && c.setQueryData(["api-keys"], v.previousData);
306
396
  },
307
397
  onSuccess: () => {
308
- s.invalidateQueries({ queryKey: ["api-keys"] });
398
+ c.invalidateQueries({ queryKey: ["api-keys"] });
309
399
  }
310
- }), m = O({
400
+ }), m = q({
311
401
  mutationFn: ({
312
- consumerId: o,
313
- label: c
402
+ consumerId: l,
403
+ label: x
314
404
  }) => {
315
- if (!t.updateConsumer)
405
+ if (!a)
316
406
  throw new Error("updateConsumer not implemented");
317
- return t.updateConsumer({ id: o, label: c }, i);
407
+ return a({ id: l, label: x }, u);
318
408
  },
319
- onMutate: async ({ consumerId: o, label: c }) => {
320
- await s.cancelQueries({ queryKey: ["api-keys"] });
321
- const C = s.getQueryData(["api-keys"]);
322
- return s.setQueryData(["api-keys"], (b) => b && b.map((k) => k.id === o ? {
323
- ...k,
324
- label: c
325
- } : k)), { previousData: C };
409
+ onMutate: async ({ consumerId: l, label: x }) => {
410
+ await c.cancelQueries({ queryKey: ["api-keys"] });
411
+ const v = c.getQueryData(["api-keys"]);
412
+ return c.setQueryData(["api-keys"], (h) => h && h.map((C) => C.id === l ? {
413
+ ...C,
414
+ label: x
415
+ } : C)), { previousData: v };
326
416
  },
327
- onError: (o, c, C) => {
328
- C?.previousData && s.setQueryData(["api-keys"], C.previousData);
417
+ onError: (l, x, v) => {
418
+ v?.previousData && c.setQueryData(["api-keys"], v.previousData);
329
419
  },
330
420
  onSuccess: () => {
331
- s.invalidateQueries({ queryKey: ["api-keys"] });
421
+ c.invalidateQueries({ queryKey: ["api-keys"] });
332
422
  }
333
- }), p = O({
334
- mutationFn: (o) => {
335
- if (!t.rollKey)
336
- throw new Error("rollKey not implemented");
337
- return t.rollKey(o, i);
338
- },
339
- onSuccess: () => s.invalidateQueries({ queryKey: ["api-keys"] })
340
- }), x = (o, c) => {
341
- r(o), l(c);
342
- }, j = (o) => {
343
- a.trim() && m.mutate({
344
- consumerId: o,
345
- label: a.trim()
346
- }), r(null), l("");
347
- }, P = () => {
348
- r(null), l("");
423
+ }), g = () => {
424
+ i(!0), d(t.label);
425
+ }, j = () => {
426
+ o.trim() && m.mutate({
427
+ label: o.trim(),
428
+ consumerId: t.id
429
+ }), i(!1);
349
430
  };
350
- return /* @__PURE__ */ e.jsxs("div", { className: "max-w-screen-md h-full pt-(--padding-content-top) pb-(--padding-content-bottom)", children: [
351
- /* @__PURE__ */ e.jsx(Y.Target, { name: "api-keys-list-page" }),
352
- /* @__PURE__ */ e.jsxs("div", { className: "flex justify-between pb-3", children: [
353
- /* @__PURE__ */ e.jsx("h1", { className: "font-medium text-2xl", children: "API Keys" }),
354
- t.createKey && /* @__PURE__ */ e.jsx(
355
- te,
356
- {
357
- service: t,
358
- isOpen: d,
359
- onOpenChange: g
360
- }
361
- )
362
- ] }),
363
- /* @__PURE__ */ e.jsx("p", { children: "Create, manage, and monitor your API keys" }),
364
- /* @__PURE__ */ e.jsx(Y.Target, { name: "api-keys-list-page-before-keys" }),
365
- /* @__PURE__ */ e.jsx("div", { className: "h-8" }),
366
- p.isError && /* @__PURE__ */ e.jsxs(M, { variant: "destructive", className: "mb-4", children: [
431
+ return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
432
+ p.isError && /* @__PURE__ */ e.jsxs(D, { variant: "destructive", className: "mb-4", children: [
367
433
  /* @__PURE__ */ e.jsx(z, { size: 16 }),
368
- /* @__PURE__ */ e.jsx(q, { children: p.error.message })
434
+ /* @__PURE__ */ e.jsx(P, { children: p.error.message })
369
435
  ] }),
370
- m.isError && /* @__PURE__ */ e.jsxs(M, { variant: "destructive", className: "mb-4", children: [
436
+ m.isError && /* @__PURE__ */ e.jsxs(D, { variant: "destructive", className: "mb-4", children: [
371
437
  /* @__PURE__ */ e.jsx(z, { size: 16 }),
372
- /* @__PURE__ */ e.jsx(q, { children: m.error.message })
438
+ /* @__PURE__ */ e.jsx(P, { children: m.error.message })
373
439
  ] }),
374
- f.isError && /* @__PURE__ */ e.jsxs(M, { variant: "destructive", className: "mb-4", children: [
440
+ f.isError && /* @__PURE__ */ e.jsxs(D, { variant: "destructive", className: "mb-4", children: [
375
441
  /* @__PURE__ */ e.jsx(z, { size: 16 }),
376
- /* @__PURE__ */ e.jsx(q, { children: f.error.message })
442
+ /* @__PURE__ */ e.jsx(P, { children: f.error.message })
377
443
  ] }),
378
- /* @__PURE__ */ e.jsx("div", { className: "", children: u.length === 0 ? /* @__PURE__ */ e.jsxs("div", { className: "flex col-span-full flex-col justify-center gap-4 items-center p-8 border rounded-sm bg-muted/30 text-muted-foreground", children: [
379
- /* @__PURE__ */ e.jsxs("p", { className: "text-center", children: [
380
- "You have no API keys yet.",
381
- /* @__PURE__ */ e.jsx("br", {}),
382
- t.createKey && "Get started and create your first key."
383
- ] }),
384
- t.createKey && /* @__PURE__ */ e.jsx(
385
- te,
386
- {
387
- service: t,
388
- isOpen: d,
389
- onOpenChange: g
390
- }
391
- )
392
- ] }) : /* @__PURE__ */ e.jsx(
393
- "ul",
444
+ /* @__PURE__ */ e.jsxs(
445
+ Ae,
394
446
  {
395
- className: A(
396
- "grid grid-cols-[1fr_min-content] divide-y divide-border col-span-6"
397
- ),
398
- children: u.map((o) => /* @__PURE__ */ e.jsxs(
399
- qe,
400
- {
401
- className: "grid grid-cols-subgrid col-span-full items-center mb-4 group",
402
- children: [
403
- /* @__PURE__ */ e.jsxs($e, { className: "border-b col-span-full grid-cols-subgrid grid", children: [
404
- /* @__PURE__ */ e.jsxs("div", { className: "h-10 flex flex-col text-sm justify-center", children: [
405
- /* @__PURE__ */ e.jsxs("div", { className: "font-medium text-lg flex items-center gap-2", children: [
406
- n === o.id ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 w-full", children: [
447
+ className: "grid grid-cols-subgrid col-span-full items-center mb-4 group",
448
+ children: [
449
+ /* @__PURE__ */ e.jsxs(Se, { className: "col-span-full flex-row items-start justify-between gap-4", children: [
450
+ /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1", children: [
451
+ r ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
452
+ /* @__PURE__ */ e.jsx(
453
+ Ue,
454
+ {
455
+ maxLength: 32,
456
+ value: o,
457
+ onChange: (l) => d(l.target.value),
458
+ onKeyDown: (l) => {
459
+ l.key === "Enter" ? j() : l.key === "Escape" && i(!1);
460
+ },
461
+ autoFocus: !0
462
+ }
463
+ ),
464
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
465
+ /* @__PURE__ */ e.jsx(
466
+ k,
467
+ {
468
+ size: "icon",
469
+ variant: "ghost",
470
+ onClick: j,
471
+ disabled: !o.trim(),
472
+ children: /* @__PURE__ */ e.jsx(xe, { size: 16 })
473
+ }
474
+ ),
475
+ /* @__PURE__ */ e.jsx(
476
+ k,
477
+ {
478
+ size: "icon",
479
+ variant: "ghost",
480
+ onClick: () => i(!1),
481
+ children: /* @__PURE__ */ e.jsx(ye, { size: 16 })
482
+ }
483
+ )
484
+ ] })
485
+ ] }) : /* @__PURE__ */ e.jsx(Re, { children: t.label }),
486
+ /* @__PURE__ */ e.jsxs(Ne, { children: [
487
+ t.createdOn && /* @__PURE__ */ e.jsxs("div", { children: [
488
+ "Created on ",
489
+ new Date(t.createdOn).toLocaleDateString()
490
+ ] }),
491
+ t.expiresOn && /* @__PURE__ */ e.jsxs("div", { children: [
492
+ "Expires on ",
493
+ new Date(t.expiresOn).toLocaleDateString()
494
+ ] })
495
+ ] })
496
+ ] }),
497
+ /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
498
+ a && /* @__PURE__ */ e.jsxs(
499
+ k,
500
+ {
501
+ variant: "ghost",
502
+ onClick: g,
503
+ className: W(
504
+ "flex gap-2",
505
+ r && "opacity-0! pointer-events-none"
506
+ ),
507
+ disabled: r,
508
+ children: [
509
+ /* @__PURE__ */ e.jsx(ge, { size: 16 }),
510
+ /* @__PURE__ */ e.jsx("span", { className: "hidden md:block", children: "Edit label" })
511
+ ]
512
+ }
513
+ ),
514
+ s && /* @__PURE__ */ e.jsxs(B, { children: [
515
+ /* @__PURE__ */ e.jsx(Z, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
516
+ k,
517
+ {
518
+ title: "Roll this key",
519
+ variant: "ghost",
520
+ disabled: p.isPending,
521
+ className: "flex items-center gap-2",
522
+ children: [
407
523
  /* @__PURE__ */ e.jsx(
408
- ae,
524
+ je,
409
525
  {
410
- maxLength: 32,
411
- value: a,
412
- onChange: (c) => l(c.target.value),
413
- onKeyDown: (c) => {
414
- c.key === "Enter" ? j(o.id) : c.key === "Escape" && P();
415
- },
416
- className: "text-lg font-medium",
417
- autoFocus: !0
526
+ size: 16,
527
+ className: p.isPending ? "animate-spin" : void 0
418
528
  }
419
529
  ),
420
- /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
421
- /* @__PURE__ */ e.jsx(
422
- w,
423
- {
424
- size: "icon",
425
- variant: "ghost",
426
- onClick: () => j(o.id),
427
- disabled: !a.trim(),
428
- children: /* @__PURE__ */ e.jsx(ue, { size: 16 })
429
- }
430
- ),
431
- /* @__PURE__ */ e.jsx(
432
- w,
433
- {
434
- size: "icon",
435
- variant: "ghost",
436
- onClick: P,
437
- children: /* @__PURE__ */ e.jsx(he, { size: 16 })
438
- }
439
- )
440
- ] })
441
- ] }) : o.label,
442
- /* @__PURE__ */ e.jsx("div", { className: "text-muted-foreground text-xs", children: o.createdOn })
530
+ /* @__PURE__ */ e.jsx("span", { className: "hidden md:block", children: "Roll key" })
531
+ ]
532
+ }
533
+ ) }),
534
+ /* @__PURE__ */ e.jsxs(G, { children: [
535
+ /* @__PURE__ */ e.jsxs(J, { children: [
536
+ /* @__PURE__ */ e.jsx(Y, { children: "Roll API Key" }),
537
+ /* @__PURE__ */ e.jsx(oe, { children: "Are you sure you want to roll this API key?" })
443
538
  ] }),
444
- /* @__PURE__ */ e.jsxs("div", { className: "text-muted-foreground text-xs", children: [
445
- o.createdOn && /* @__PURE__ */ e.jsxs("div", { children: [
446
- "Created on",
447
- " ",
448
- new Date(o.createdOn).toLocaleDateString()
449
- ] }),
450
- o.expiresOn && /* @__PURE__ */ e.jsxs("div", { children: [
451
- "Expires on",
452
- " ",
453
- new Date(o.expiresOn).toLocaleDateString()
454
- ] })
455
- ] })
456
- ] }),
457
- /* @__PURE__ */ e.jsxs("div", { className: "flex justify-end", children: [
458
- t.updateConsumer && /* @__PURE__ */ e.jsxs(
459
- w,
460
- {
461
- variant: "ghost",
462
- onClick: () => x(o.id, o.label),
463
- className: A(
464
- "flex gap-2",
465
- n === o.id && "opacity-0! pointer-events-none"
466
- ),
467
- disabled: n === o.id,
468
- children: [
469
- /* @__PURE__ */ e.jsx(fe, { size: 16 }),
470
- /* @__PURE__ */ e.jsx("span", { className: "hidden md:block", children: "Edit label" })
471
- ]
472
- }
473
- ),
474
- t.rollKey && /* @__PURE__ */ e.jsxs(V, { children: [
475
- /* @__PURE__ */ e.jsx(G, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
476
- w,
539
+ /* @__PURE__ */ e.jsxs(_, { children: [
540
+ /* @__PURE__ */ e.jsx(S, { asChild: !0, children: /* @__PURE__ */ e.jsx(k, { variant: "outline", children: "Cancel" }) }),
541
+ /* @__PURE__ */ e.jsx(S, { asChild: !0, children: /* @__PURE__ */ e.jsx(
542
+ k,
477
543
  {
478
- title: "Roll this key",
479
- variant: "ghost",
480
- disabled: p.isPending,
481
- className: "flex items-center gap-2",
482
- children: [
483
- /* @__PURE__ */ e.jsx(
484
- pe,
485
- {
486
- size: 16,
487
- className: p.isPending ? "animate-spin" : void 0
488
- }
489
- ),
490
- /* @__PURE__ */ e.jsx("span", { className: "hidden md:block", children: "Roll key" })
491
- ]
544
+ onClick: () => {
545
+ p.mutate(t.id);
546
+ },
547
+ children: "Roll Key"
492
548
  }
493
- ) }),
494
- /* @__PURE__ */ e.jsxs(J, { children: [
495
- /* @__PURE__ */ e.jsxs(U, { children: [
496
- /* @__PURE__ */ e.jsx(W, { children: "Roll API Key" }),
497
- /* @__PURE__ */ e.jsx(re, { children: "Are you sure you want to roll this API key?" })
498
- ] }),
499
- /* @__PURE__ */ e.jsxs(H, { children: [
500
- /* @__PURE__ */ e.jsx(D, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { variant: "outline", children: "Cancel" }) }),
501
- /* @__PURE__ */ e.jsx(D, { asChild: !0, children: /* @__PURE__ */ e.jsx(
502
- w,
503
- {
504
- onClick: () => {
505
- p.mutate(o.id);
506
- },
507
- children: "Roll Key"
508
- }
509
- ) })
510
- ] })
511
- ] })
549
+ ) })
512
550
  ] })
513
551
  ] })
514
- ] }),
515
- /* @__PURE__ */ e.jsx("div", { className: "col-span-full grid-cols-subgrid grid", children: /* @__PURE__ */ e.jsx(tt, { children: o.apiKeys.map((c) => /* @__PURE__ */ e.jsxs(Pe.Fragment, { children: [
516
- /* @__PURE__ */ e.jsx(
517
- at,
518
- {
519
- apiKey: c,
520
- onDeleteKey: () => {
521
- f.mutate({
522
- consumerId: o.id,
523
- keyId: c.id
524
- });
525
- },
526
- className: f.variables?.keyId === c.id && (f.isPending || h) ? "opacity-10!" : void 0
527
- }
528
- ),
529
- /* @__PURE__ */ e.jsx("div", { className: "col-span-full h-px bg-border" })
530
- ] }, c.id)) }) })
531
- ]
532
- },
533
- o.id
534
- ))
535
- }
536
- ) })
552
+ ] })
553
+ ] })
554
+ ] }),
555
+ /* @__PURE__ */ e.jsx(Oe, { className: "p-0 grid grid-cols-subgrid col-span-full divide-y divide-border", children: /* @__PURE__ */ e.jsx(ht, { children: t.apiKeys.map((l) => /* @__PURE__ */ e.jsx(
556
+ mt,
557
+ {
558
+ apiKey: l,
559
+ onDeleteKey: () => {
560
+ f.mutate({
561
+ consumerId: t.id,
562
+ keyId: l.id
563
+ });
564
+ },
565
+ className: f.variables?.keyId === l.id && f.isPending ? "opacity-10!" : void 0
566
+ },
567
+ l.id
568
+ )) }) })
569
+ ]
570
+ },
571
+ t.id
572
+ )
537
573
  ] });
538
- }, rt = (t) => {
539
- const i = /* @__PURE__ */ new Date(), s = new Date(t), n = Math.floor((i.getTime() - s.getTime()) / 1e3), r = new Intl.RelativeTimeFormat("en", { numeric: "auto" });
540
- return n < 60 ? r.format(-n, "second") : n < 3600 ? r.format(-Math.floor(n / 60), "minute") : n < 86400 ? r.format(-Math.floor(n / 3600), "hour") : n < 2592e3 ? r.format(-Math.floor(n / 86400), "day") : n < 31536e3 ? r.format(-Math.floor(n / 2592e3), "month") : r.format(-Math.floor(n / 31536e3), "year");
541
- }, at = ({
542
- apiKey: t,
543
- onDeleteKey: i,
544
- className: s
545
- }) => {
546
- const [n, r] = K(!1), { key: a, createdOn: l, expiresOn: u } = t, h = u && new Date(u) < /* @__PURE__ */ new Date(), d = u ? Math.ceil(
547
- (new Date(u).getTime() - Date.now()) / (1e3 * 60 * 60 * 24)
548
- ) : 1 / 0, g = d <= 7 && !h;
549
- return /* @__PURE__ */ e.jsxs("div", { className: A("grid col-span-full grid-cols-subgrid p-6", s), children: [
550
- /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1", children: [
551
- /* @__PURE__ */ e.jsx(
552
- Ae,
574
+ }, gt = ({ service: t }) => {
575
+ const a = U(), { data: s } = ze({
576
+ queryFn: async () => {
577
+ try {
578
+ return await t.getConsumers(a);
579
+ } catch (i) {
580
+ throw i instanceof M ? i : new M("Cannot get API keys", {
581
+ cause: i,
582
+ title: "Error getting API keys",
583
+ developerHint: "Check the response of the API request for more information."
584
+ });
585
+ }
586
+ },
587
+ queryKey: ["api-keys"],
588
+ retry: !1
589
+ }), [n, r] = I(!1);
590
+ return /* @__PURE__ */ e.jsx("div", { className: "mt-8", children: s.length === 0 ? /* @__PURE__ */ e.jsxs("div", { className: "flex col-span-full flex-col justify-center gap-4 items-center p-8 border rounded-sm bg-muted/30 text-muted-foreground", children: [
591
+ /* @__PURE__ */ e.jsxs("p", { className: "text-center", children: [
592
+ "You have no API keys yet.",
593
+ /* @__PURE__ */ e.jsx("br", {}),
594
+ t.createKey && "Get started and create your first key."
595
+ ] }),
596
+ t.createKey && /* @__PURE__ */ e.jsx(
597
+ de,
598
+ {
599
+ service: t,
600
+ isOpen: n,
601
+ onOpenChange: r
602
+ }
603
+ )
604
+ ] }) : /* @__PURE__ */ e.jsx("ul", { className: W("grid grid-cols-[1fr_min-content] col-span-6"), children: s.map((i) => /* @__PURE__ */ e.jsx(
605
+ yt,
606
+ {
607
+ consumer: i,
608
+ onUpdate: t.updateConsumer,
609
+ onRollKey: t.rollKey,
610
+ onDeleteKey: t.deleteKey
611
+ },
612
+ i.id
613
+ )) }) });
614
+ }, jt = ({ service: t }) => {
615
+ const [a, s] = I(!1), n = re();
616
+ return /* @__PURE__ */ e.jsxs("div", { className: "max-w-3xl h-full pt-(--padding-content-top) pb-(--padding-content-bottom)", children: [
617
+ /* @__PURE__ */ e.jsx(ee.Target, { name: "api-keys-list-page" }),
618
+ /* @__PURE__ */ e.jsxs("div", { className: "flex justify-between pb-3", children: [
619
+ /* @__PURE__ */ e.jsx("h1", { className: "font-medium text-2xl", children: "API Keys" }),
620
+ t.createKey && /* @__PURE__ */ e.jsx(
621
+ de,
553
622
  {
554
- className: "max-w-fit w-full",
555
- secret: a,
556
- status: h ? "expired" : g ? "expiring" : "active",
557
- revealed: n,
558
- onReveal: r
623
+ service: t,
624
+ isOpen: a,
625
+ onOpenChange: s
559
626
  }
560
- ),
561
- /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1 mt-0.5 text-nowrap", children: [
562
- l && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-muted-foreground", children: [
563
- "Created ",
564
- rt(l),
565
- "."
566
- ] }),
567
- " ",
568
- u && g && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-primary", children: [
569
- "Expires in ",
570
- d,
571
- " ",
572
- d === 1 ? "day" : "days",
573
- "."
574
- ] }),
575
- u && h && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-primary", children: [
576
- "Expired",
577
- " ",
578
- d === 0 ? "today." : `${d * -1} days ago.`
579
- ] })
580
- ] })
627
+ )
581
628
  ] }),
582
- /* @__PURE__ */ e.jsx("div", { className: "flex justify-end", children: u && i && /* @__PURE__ */ e.jsxs(V, { children: [
583
- /* @__PURE__ */ e.jsx(G, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { variant: "ghost", size: "icon", children: /* @__PURE__ */ e.jsx(me, { size: 16 }) }) }),
584
- /* @__PURE__ */ e.jsxs(J, { children: [
585
- /* @__PURE__ */ e.jsxs(U, { children: [
586
- /* @__PURE__ */ e.jsx(W, { children: "Delete API Key" }),
587
- /* @__PURE__ */ e.jsx(re, { children: "Are you sure you want to delete this API key?" })
588
- ] }),
589
- /* @__PURE__ */ e.jsxs(H, { children: [
590
- /* @__PURE__ */ e.jsx(D, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { variant: "outline", children: "Cancel" }) }),
591
- /* @__PURE__ */ e.jsx(D, { asChild: !0, children: /* @__PURE__ */ e.jsx(
592
- w,
593
- {
594
- onClick: () => {
595
- i();
596
- },
597
- children: "Delete"
598
- }
599
- ) })
600
- ] })
601
- ] })
602
- ] }) })
629
+ /* @__PURE__ */ e.jsx("p", { children: "Create, manage, and monitor your API keys" }),
630
+ /* @__PURE__ */ e.jsx(ee.Target, { name: "api-keys-list-page-before-keys" }),
631
+ n.profile?.emailVerified === !1 ? /* @__PURE__ */ e.jsxs(Te, { variant: "outline", children: [
632
+ /* @__PURE__ */ e.jsxs(qe, { children: [
633
+ /* @__PURE__ */ e.jsx(Me, { children: "Verified email required" }),
634
+ /* @__PURE__ */ e.jsx(Fe, { children: "You need to verify your email to access API keys." })
635
+ ] }),
636
+ /* @__PURE__ */ e.jsx($e, { children: /* @__PURE__ */ e.jsx(De, { onClick: () => n.requestEmailVerification(), children: "Verify email" }) })
637
+ ] }) : /* @__PURE__ */ e.jsx(
638
+ Pe,
639
+ {
640
+ fallbackRender: ({ error: r }) => /* @__PURE__ */ e.jsx(We, { error: r }),
641
+ children: /* @__PURE__ */ e.jsx(gt, { service: t })
642
+ }
643
+ )
603
644
  ] });
604
- }, S = "https://api.zuploedge.com/v2/client", ot = async (t) => {
645
+ }, N = "https://api.zuploedge.com/v2/client", vt = async (t) => {
605
646
  try {
606
647
  return await t.json();
607
648
  } catch {
608
649
  return;
609
650
  }
610
- }, T = async (t) => {
611
- const i = t.headers.get("content-type");
612
- if (!t.ok && i?.includes("application/problem+json")) {
613
- const s = await ot(t);
651
+ }, O = async (t) => {
652
+ const a = t.headers.get("content-type");
653
+ if (!t.ok && a?.includes("application/problem+json")) {
654
+ const s = await vt(t);
614
655
  if (s.type && s.title)
615
656
  throw new Error(s.detail ?? s.title);
616
657
  }
617
- }, lt = (t, i) => ({
658
+ }, T = {
659
+ developerHint: "This project is not linked to a Zuplo deployment. Run `zuplo link` to get started with API Keys.",
660
+ title: "Not linked to a Zuplo deployment"
661
+ }, Ct = ({
662
+ deploymentName: t,
663
+ ...a
664
+ }) => ({
618
665
  deleteKey: async (s, n, r) => {
619
- const a = new Request(
620
- S + `/${t}/consumers/${s}/keys/${n}`,
666
+ E(t, "Cannot delete API key.", T);
667
+ const i = new Request(
668
+ N + `/${t}/consumers/${s}/keys/${n}`,
621
669
  {
622
670
  method: "DELETE"
623
671
  }
624
- );
625
- await r.signRequest(a);
626
- const l = await fetch(a);
627
- await T(l), I(l.ok, "Failed to delete API key");
672
+ ), o = await fetch(await r.signRequest(i));
673
+ await O(o), E(o.ok, "Failed to delete API key");
628
674
  },
629
675
  updateConsumer: async (s, n) => {
676
+ E(
677
+ t,
678
+ "Cannot update API key description.",
679
+ T
680
+ );
630
681
  const r = await fetch(
631
682
  await n.signRequest(
632
683
  new Request(
633
- S + `/${t}/consumers/${s.id}`,
684
+ `${N}/${t}/consumers/${s.id}`,
634
685
  {
635
686
  method: "PATCH",
636
687
  headers: {
@@ -643,13 +694,14 @@ const st = ({
643
694
  )
644
695
  )
645
696
  );
646
- await T(r), I(r.ok, "Failed to update API key description");
697
+ await O(r), E(r.ok, "Failed to update API key description");
647
698
  },
648
699
  rollKey: async (s, n) => {
700
+ E(t, "Cannot roll API key.", T);
649
701
  const r = await fetch(
650
702
  await n.signRequest(
651
703
  new Request(
652
- S + `/${t}/consumers/${s}/roll-key`,
704
+ `${N}/${t}/consumers/${s}/roll-key`,
653
705
  {
654
706
  method: "POST",
655
707
  headers: {
@@ -660,42 +712,59 @@ const st = ({
660
712
  )
661
713
  )
662
714
  );
663
- await T(r), I(r.ok, "Failed to delete API key");
715
+ await O(r), E(r.ok, "Failed to roll API key");
664
716
  },
665
717
  getConsumers: async (s) => {
718
+ E(t, "Cannot get API keys.", T);
666
719
  const n = new Request(
667
- `${S}/${t}/consumers`
720
+ `${N}/${t}/consumers`
668
721
  );
669
722
  await s.signRequest(n);
670
723
  const r = await fetch(n);
671
- return await T(r), I(r.ok, "Failed to fetch API keys"), (await r.json()).data.map((l) => ({
672
- id: l.id,
673
- label: l.label || l.subject || "API Key",
674
- apiKeys: l.apiKeys.data,
675
- key: l.apiKeys.data.at(0)
724
+ return await O(r), E(r.ok, "Failed to fetch API keys"), (await r.json()).data.map((o) => ({
725
+ id: o.id,
726
+ createdOn: o.createdOn,
727
+ updatedOn: o.updatedOn,
728
+ expiresOn: o.expiresOn,
729
+ label: o.label || o.subject || "API Key",
730
+ apiKeys: o.apiKeys.data,
731
+ key: o.apiKeys.data.at(0)
676
732
  }));
677
733
  },
678
- ...i
679
- }), Dt = (t) => t, At = (t) => {
680
- const i = "deploymentName" in t ? lt(t.deploymentName, t) : t;
734
+ ...a
735
+ }), Ht = (t) => t, Vt = ({
736
+ deploymentName: t,
737
+ isZuplo: a,
738
+ ...s
739
+ }) => {
740
+ a && !t && console.warn(
741
+ "This project is not linked to a Zuplo deployment. Run `zuplo link` to get started."
742
+ );
743
+ const n = a ? Ct({ deploymentName: t, ...s }) : s;
744
+ if (!n.getConsumers)
745
+ throw new Error("getConsumers is required when using the apiKeyPlugin");
746
+ const r = {
747
+ ...n,
748
+ getConsumers: n.getConsumers
749
+ };
681
750
  return {
682
751
  getProfileMenuItems: () => [
683
752
  {
684
753
  label: "API Keys",
685
754
  path: "/settings/api-keys",
686
755
  category: "middle",
687
- icon: xe
756
+ icon: ve
688
757
  }
689
758
  ],
690
- getIdentities: async (s) => {
759
+ getIdentities: async (i) => {
691
760
  try {
692
- return (await i.getConsumers(s)).map((r) => ({
693
- authorizeRequest: (a) => (a.headers.set(
761
+ return (await r.getConsumers(i)).map((d) => ({
762
+ authorizeRequest: (c) => (c.headers.set(
694
763
  "Authorization",
695
- `Bearer ${r.apiKeys.at(0)?.key}`
696
- ), a),
697
- id: r.id,
698
- label: r.label
764
+ `Bearer ${d.apiKeys.at(0)?.key}`
765
+ ), c),
766
+ id: d.id,
767
+ label: d.label
699
768
  }));
700
769
  } catch {
701
770
  return [];
@@ -703,20 +772,15 @@ const st = ({
703
772
  },
704
773
  getRoutes: () => [
705
774
  {
706
- element: /* @__PURE__ */ e.jsx(_e, {}),
707
- errorElement: /* @__PURE__ */ e.jsx(ye, {}),
708
- children: [
709
- {
710
- path: "/settings/api-keys",
711
- element: /* @__PURE__ */ e.jsx(it, { service: i })
712
- }
713
- ]
775
+ path: "/settings/api-keys",
776
+ element: /* @__PURE__ */ e.jsx(jt, { service: r })
714
777
  }
715
- ]
778
+ ],
779
+ getProtectedRoutes: () => ["/settings/api-keys"]
716
780
  };
717
781
  };
718
782
  export {
719
- At as apiKeyPlugin,
720
- Dt as createApiKeyService
783
+ Vt as apiKeyPlugin,
784
+ Ht as createApiKeyService
721
785
  };
722
786
  //# sourceMappingURL=zudoku.plugin-api-keys.js.map