@tempoxyz/id 0.0.0-pr-349.sha-e0d3dfc → 0.0.0-pr-357.sha-e757593

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 (341) hide show
  1. package/README.md +0 -3
  2. package/dist/app/server/assets/Grant-D_tun0mF.js.map +1 -1
  3. package/dist/app/server/index.js +4 -4
  4. package/dist/app/server/index.js.map +1 -1
  5. package/dist/cli/Cli.d.ts +1 -8
  6. package/dist/cli/Cli.d.ts.map +1 -1
  7. package/dist/cli/Cli.js +6 -9
  8. package/dist/cli/Cli.js.map +1 -1
  9. package/dist/cli/Session.d.ts +1 -1
  10. package/dist/cli/Session.d.ts.map +1 -1
  11. package/dist/cli/Session.js +1 -1
  12. package/dist/cli/Session.js.map +1 -1
  13. package/dist/cli/bin.js +4 -23
  14. package/dist/cli/bin.js.map +1 -1
  15. package/dist/client/Actions.d.ts +1 -2
  16. package/dist/client/Actions.d.ts.map +1 -1
  17. package/dist/client/Actions.js +0 -1
  18. package/dist/client/Actions.js.map +1 -1
  19. package/dist/client/Auth.d.ts +1 -1
  20. package/dist/client/Auth.d.ts.map +1 -1
  21. package/dist/client/Auth.js.map +1 -1
  22. package/dist/client/Authorization.d.ts +8 -4
  23. package/dist/client/Authorization.d.ts.map +1 -1
  24. package/dist/client/Authorization.js +1 -1
  25. package/dist/client/Authorization.js.map +1 -1
  26. package/dist/client/actions/email.d.ts +1 -1
  27. package/dist/client/actions/email.d.ts.map +1 -1
  28. package/dist/client/actions/passkey.d.ts +1 -1
  29. package/dist/client/actions/passkey.d.ts.map +1 -1
  30. package/dist/client/actions/redirect.d.ts +1 -1
  31. package/dist/client/actions/redirect.d.ts.map +1 -1
  32. package/dist/client/internal/api.d.ts +1 -1
  33. package/dist/client/internal/api.d.ts.map +1 -1
  34. package/dist/client/internal/api.js +1 -1
  35. package/dist/client/internal/api.js.map +1 -1
  36. package/dist/client/viem/Actions.d.ts +3 -3
  37. package/dist/client/viem/Actions.d.ts.map +1 -1
  38. package/dist/client/viem/Actions.js +4 -4
  39. package/dist/client/viem/Actions.js.map +1 -1
  40. package/dist/client/viem/Decorator.d.ts +2 -2
  41. package/dist/client/viem/internal/client.d.ts +3 -3
  42. package/dist/client/viem/internal/client.d.ts.map +1 -1
  43. package/dist/client/viem/internal/client.js +2 -2
  44. package/dist/client/viem/internal/client.js.map +1 -1
  45. package/dist/client.d.ts +0 -1
  46. package/dist/client.d.ts.map +1 -1
  47. package/dist/client.js +0 -1
  48. package/dist/client.js.map +1 -1
  49. package/dist/internal/Apps.d.ts +1 -2
  50. package/dist/internal/Apps.d.ts.map +1 -1
  51. package/dist/internal/Apps.js +5 -10
  52. package/dist/internal/Apps.js.map +1 -1
  53. package/dist/internal/ErrorResponse.d.ts +0 -20
  54. package/dist/internal/ErrorResponse.d.ts.map +1 -1
  55. package/dist/internal/ErrorResponse.js +0 -35
  56. package/dist/internal/ErrorResponse.js.map +1 -1
  57. package/dist/internal/RequestId.d.ts +1 -7
  58. package/dist/internal/RequestId.d.ts.map +1 -1
  59. package/dist/internal/RequestId.js.map +1 -1
  60. package/dist/internal/Timing.d.ts +1 -4
  61. package/dist/internal/Timing.d.ts.map +1 -1
  62. package/dist/internal/Timing.js.map +1 -1
  63. package/package.json +1 -7
  64. package/src/cli/Cli.ts +5 -13
  65. package/src/cli/Session.ts +2 -2
  66. package/src/cli/bin.ts +4 -26
  67. package/src/client/Actions.ts +1 -2
  68. package/src/client/Auth.ts +0 -4
  69. package/src/client/Authorization.ts +8 -4
  70. package/src/client/actions/email.ts +1 -1
  71. package/src/client/actions/passkey.ts +1 -1
  72. package/src/client/actions/redirect.ts +1 -1
  73. package/src/client/internal/api.ts +2 -2
  74. package/src/client/viem/Actions.ts +5 -5
  75. package/src/client/viem/Decorator.ts +2 -2
  76. package/src/client/viem/internal/client.ts +5 -5
  77. package/src/client.ts +0 -1
  78. package/src/internal/Apps.ts +4 -17
  79. package/src/internal/ErrorResponse.ts +0 -41
  80. package/src/internal/OpenApi.ts +7 -57
  81. package/src/internal/RequestId.ts +2 -8
  82. package/src/internal/Timing.ts +1 -4
  83. package/src/types/app.d.ts +0 -14
  84. package/dist/Admin.d.ts +0 -79
  85. package/dist/Admin.d.ts.map +0 -1
  86. package/dist/Admin.js +0 -93
  87. package/dist/Admin.js.map +0 -1
  88. package/dist/admin/Env.d.ts +0 -68
  89. package/dist/admin/Env.d.ts.map +0 -1
  90. package/dist/admin/Env.js +0 -2
  91. package/dist/admin/Env.js.map +0 -1
  92. package/dist/admin/app/client/.assetsignore +0 -2
  93. package/dist/admin/app/client/assets/Client-BrjXsLWn.js +0 -2
  94. package/dist/admin/app/client/assets/Client-DdghQm8N.css +0 -1
  95. package/dist/admin/app/client/assets/GeistMono-Variable-BRXCGrxA.woff2 +0 -0
  96. package/dist/admin/app/client/assets/Inter-cyrillic-e3OmmzmJ.woff2 +0 -0
  97. package/dist/admin/app/client/assets/Inter-cyrillic-ext-DOWZeO4Q.woff2 +0 -0
  98. package/dist/admin/app/client/assets/Inter-greek-BD3ujQlX.woff2 +0 -0
  99. package/dist/admin/app/client/assets/Inter-greek-ext-CXEwbus4.woff2 +0 -0
  100. package/dist/admin/app/client/assets/Inter-latin-BDFm4vTb.woff2 +0 -0
  101. package/dist/admin/app/client/assets/Inter-latin-ext-E7a9JEPe.woff2 +0 -0
  102. package/dist/admin/app/client/assets/Inter-symbols-DEch7Rxr.woff2 +0 -0
  103. package/dist/admin/app/client/assets/Inter-vietnamese-Bg9723vR.woff2 +0 -0
  104. package/dist/admin/app/client/assets/___dev-EY7r7Loc.css +0 -1
  105. package/dist/admin/app/client/assets/___dev.sign-in-ClQvgAau.js +0 -1
  106. package/dist/admin/app/client/assets/index-Cbo1RPkb.css +0 -1
  107. package/dist/admin/app/client/assets/index-DAKRgvN1.js +0 -13
  108. package/dist/admin/app/client/assets/reset-co-CHrff.css +0 -1
  109. package/dist/admin/app/client/assets/rolldown-runtime-WkwZ5CU-.js +0 -1
  110. package/dist/admin/app/client/assets/routes-BEUY7mCO.css +0 -1
  111. package/dist/admin/app/client/assets/routes-DM0o3oBQ.js +0 -1
  112. package/dist/admin/app/client/assets/shadowDom-DMRd3g4s.js +0 -1
  113. package/dist/admin/app/server/.vite/manifest.json +0 -359
  114. package/dist/admin/app/server/assets/Client-D4wNQeJd.js +0 -3
  115. package/dist/admin/app/server/assets/Client-D4wNQeJd.js.map +0 -1
  116. package/dist/admin/app/server/assets/GeistMono-Variable-BRXCGrxA.woff2 +0 -0
  117. package/dist/admin/app/server/assets/Inter-cyrillic-e3OmmzmJ.woff2 +0 -0
  118. package/dist/admin/app/server/assets/Inter-cyrillic-ext-DOWZeO4Q.woff2 +0 -0
  119. package/dist/admin/app/server/assets/Inter-greek-BD3ujQlX.woff2 +0 -0
  120. package/dist/admin/app/server/assets/Inter-greek-ext-CXEwbus4.woff2 +0 -0
  121. package/dist/admin/app/server/assets/Inter-latin-BDFm4vTb.woff2 +0 -0
  122. package/dist/admin/app/server/assets/Inter-latin-ext-E7a9JEPe.woff2 +0 -0
  123. package/dist/admin/app/server/assets/Inter-symbols-DEch7Rxr.woff2 +0 -0
  124. package/dist/admin/app/server/assets/Inter-vietnamese-Bg9723vR.woff2 +0 -0
  125. package/dist/admin/app/server/assets/___dev-EY7r7Loc.css +0 -1
  126. package/dist/admin/app/server/assets/___dev.sign-in-DUf_NQPU.js +0 -2
  127. package/dist/admin/app/server/assets/___dev.sign-in-DUf_NQPU.js.map +0 -1
  128. package/dist/admin/app/server/assets/_tanstack-start-manifest_v-C8ysuxtN.js +0 -1
  129. package/dist/admin/app/server/assets/arktype-aI7TBD0R-D1R3Byo5.js +0 -2
  130. package/dist/admin/app/server/assets/arktype-aI7TBD0R-D1R3Byo5.js.map +0 -1
  131. package/dist/admin/app/server/assets/async-local-storage-DUe1175v.js +0 -2
  132. package/dist/admin/app/server/assets/async-local-storage-DUe1175v.js.map +0 -1
  133. package/dist/admin/app/server/assets/convert-BIC8n32x.js +0 -2
  134. package/dist/admin/app/server/assets/convert-BIC8n32x.js.map +0 -1
  135. package/dist/admin/app/server/assets/cookie-BOmgOR30.js +0 -2
  136. package/dist/admin/app/server/assets/cookie-BOmgOR30.js.map +0 -1
  137. package/dist/admin/app/server/assets/cookie-DdghQm8N.css +0 -1
  138. package/dist/admin/app/server/assets/default-u_dwuiYb-D6RfpcBr.js +0 -2
  139. package/dist/admin/app/server/assets/default-u_dwuiYb-D6RfpcBr.js.map +0 -1
  140. package/dist/admin/app/server/assets/effect-QlVUlMFu-Bs0PyUhN.js +0 -2
  141. package/dist/admin/app/server/assets/effect-QlVUlMFu-Bs0PyUhN.js.map +0 -1
  142. package/dist/admin/app/server/assets/empty-plugin-adapters-BaGcmrjC.js +0 -2
  143. package/dist/admin/app/server/assets/empty-plugin-adapters-BaGcmrjC.js.map +0 -1
  144. package/dist/admin/app/server/assets/esm-C6SW--yt.js +0 -4
  145. package/dist/admin/app/server/assets/esm-C6SW--yt.js.map +0 -1
  146. package/dist/admin/app/server/assets/index-CLddUTqr-ComTZ4bq.js +0 -2
  147. package/dist/admin/app/server/assets/index-CLddUTqr-ComTZ4bq.js.map +0 -1
  148. package/dist/admin/app/server/assets/index-DZEfthgZ-BxnrPO8Q.js +0 -2
  149. package/dist/admin/app/server/assets/index-DZEfthgZ-BxnrPO8Q.js.map +0 -1
  150. package/dist/admin/app/server/assets/reset-co-CHrff.css +0 -1
  151. package/dist/admin/app/server/assets/rolldown-runtime-BWaJ3C7D.js +0 -1
  152. package/dist/admin/app/server/assets/router-Cbo1RPkb.css +0 -1
  153. package/dist/admin/app/server/assets/router-Dqhrc0PX.js +0 -2
  154. package/dist/admin/app/server/assets/router-Dqhrc0PX.js.map +0 -1
  155. package/dist/admin/app/server/assets/routes-BEUY7mCO.css +0 -1
  156. package/dist/admin/app/server/assets/routes-CxbX5JNu.js +0 -2
  157. package/dist/admin/app/server/assets/routes-CxbX5JNu.js.map +0 -1
  158. package/dist/admin/app/server/assets/server-tS2GlQUk.js +0 -77
  159. package/dist/admin/app/server/assets/server-tS2GlQUk.js.map +0 -1
  160. package/dist/admin/app/server/assets/shadowDom-CvS1DzWo.js +0 -2
  161. package/dist/admin/app/server/assets/shadowDom-CvS1DzWo.js.map +0 -1
  162. package/dist/admin/app/server/assets/standard-json-DY77efq0.js +0 -2
  163. package/dist/admin/app/server/assets/standard-json-DY77efq0.js.map +0 -1
  164. package/dist/admin/app/server/assets/standard-json-ig2t0wRt.js +0 -2
  165. package/dist/admin/app/server/assets/standard-json-ig2t0wRt.js.map +0 -1
  166. package/dist/admin/app/server/assets/standard-json-t-LNckA6.js +0 -2
  167. package/dist/admin/app/server/assets/standard-json-t-LNckA6.js.map +0 -1
  168. package/dist/admin/app/server/assets/standard-openapi-CONmVRl8.js +0 -2
  169. package/dist/admin/app/server/assets/standard-openapi-CONmVRl8.js.map +0 -1
  170. package/dist/admin/app/server/assets/start-C63VetBp.js +0 -2
  171. package/dist/admin/app/server/assets/start-C63VetBp.js.map +0 -1
  172. package/dist/admin/app/server/assets/sury-CWZTCd75-DP9TvBrs.js +0 -2
  173. package/dist/admin/app/server/assets/sury-CWZTCd75-DP9TvBrs.js.map +0 -1
  174. package/dist/admin/app/server/assets/typebox-Dei93FPO-D_lCVdAz.js +0 -2
  175. package/dist/admin/app/server/assets/typebox-Dei93FPO-D_lCVdAz.js.map +0 -1
  176. package/dist/admin/app/server/assets/valibot--1zFm7rT-BKGsXNQL.js +0 -2
  177. package/dist/admin/app/server/assets/valibot--1zFm7rT-BKGsXNQL.js.map +0 -1
  178. package/dist/admin/app/server/assets/valibot-D_HTw1Gn-BNmO9Liy.js +0 -2
  179. package/dist/admin/app/server/assets/valibot-D_HTw1Gn-BNmO9Liy.js.map +0 -1
  180. package/dist/admin/app/server/assets/worker-entry-DcGlpZzO.js +0 -93
  181. package/dist/admin/app/server/assets/worker-entry-DcGlpZzO.js.map +0 -1
  182. package/dist/admin/app/server/assets/zod-Bwrt9trS-DuX8BREF.js +0 -2
  183. package/dist/admin/app/server/assets/zod-Bwrt9trS-DuX8BREF.js.map +0 -1
  184. package/dist/admin/app/server/assets/zod-DSgpEGAE-BF9ADewr.js +0 -2
  185. package/dist/admin/app/server/assets/zod-DSgpEGAE-BF9ADewr.js.map +0 -1
  186. package/dist/admin/app/server/index.js +0 -1
  187. package/dist/admin/app/server/wrangler.json +0 -1
  188. package/dist/admin/dev/Session.d.ts +0 -135
  189. package/dist/admin/dev/Session.d.ts.map +0 -1
  190. package/dist/admin/dev/Session.js +0 -160
  191. package/dist/admin/dev/Session.js.map +0 -1
  192. package/dist/admin/index.d.ts +0 -15
  193. package/dist/admin/index.d.ts.map +0 -1
  194. package/dist/admin/index.js +0 -15
  195. package/dist/admin/index.js.map +0 -1
  196. package/dist/cli/AdminApi.d.ts +0 -46
  197. package/dist/cli/AdminApi.d.ts.map +0 -1
  198. package/dist/cli/AdminApi.js +0 -82
  199. package/dist/cli/AdminApi.js.map +0 -1
  200. package/dist/client/Admin.d.ts +0 -71
  201. package/dist/client/Admin.d.ts.map +0 -1
  202. package/dist/client/Admin.js +0 -29
  203. package/dist/client/Admin.js.map +0 -1
  204. package/dist/client/actions/admin/apps.d.ts +0 -142
  205. package/dist/client/actions/admin/apps.d.ts.map +0 -1
  206. package/dist/client/actions/admin/apps.js +0 -133
  207. package/dist/client/actions/admin/apps.js.map +0 -1
  208. package/dist/client/actions/admin.d.ts +0 -6
  209. package/dist/client/actions/admin.d.ts.map +0 -1
  210. package/dist/client/actions/admin.js +0 -6
  211. package/dist/client/actions/admin.js.map +0 -1
  212. package/src/Admin.ts +0 -184
  213. package/src/admin/Api.ts +0 -253
  214. package/src/admin/Env.ts +0 -73
  215. package/src/admin/app/.void/env.d.ts +0 -17
  216. package/src/admin/app/.void/preview-deploy-config.json +0 -1
  217. package/src/admin/app/.void/tanstack-start-trigger-wrapper.ts +0 -12
  218. package/src/admin/app/.void/tsconfig.json +0 -5
  219. package/src/admin/app/.void-wrangler.jsonc +0 -1
  220. package/src/admin/app/components/CodeInput.tsx +0 -153
  221. package/src/admin/app/dist/client/.assetsignore +0 -2
  222. package/src/admin/app/dist/client/assets/Client-BrjXsLWn.js +0 -2
  223. package/src/admin/app/dist/client/assets/Client-DdghQm8N.css +0 -1
  224. package/src/admin/app/dist/client/assets/GeistMono-Variable-BRXCGrxA.woff2 +0 -0
  225. package/src/admin/app/dist/client/assets/Inter-cyrillic-e3OmmzmJ.woff2 +0 -0
  226. package/src/admin/app/dist/client/assets/Inter-cyrillic-ext-DOWZeO4Q.woff2 +0 -0
  227. package/src/admin/app/dist/client/assets/Inter-greek-BD3ujQlX.woff2 +0 -0
  228. package/src/admin/app/dist/client/assets/Inter-greek-ext-CXEwbus4.woff2 +0 -0
  229. package/src/admin/app/dist/client/assets/Inter-latin-BDFm4vTb.woff2 +0 -0
  230. package/src/admin/app/dist/client/assets/Inter-latin-ext-E7a9JEPe.woff2 +0 -0
  231. package/src/admin/app/dist/client/assets/Inter-symbols-DEch7Rxr.woff2 +0 -0
  232. package/src/admin/app/dist/client/assets/Inter-vietnamese-Bg9723vR.woff2 +0 -0
  233. package/src/admin/app/dist/client/assets/___dev-EY7r7Loc.css +0 -1
  234. package/src/admin/app/dist/client/assets/___dev.sign-in-ClQvgAau.js +0 -1
  235. package/src/admin/app/dist/client/assets/index-Cbo1RPkb.css +0 -1
  236. package/src/admin/app/dist/client/assets/index-DAKRgvN1.js +0 -13
  237. package/src/admin/app/dist/client/assets/reset-co-CHrff.css +0 -1
  238. package/src/admin/app/dist/client/assets/rolldown-runtime-WkwZ5CU-.js +0 -1
  239. package/src/admin/app/dist/client/assets/routes-BEUY7mCO.css +0 -1
  240. package/src/admin/app/dist/client/assets/routes-DM0o3oBQ.js +0 -1
  241. package/src/admin/app/dist/client/assets/shadowDom-DMRd3g4s.js +0 -1
  242. package/src/admin/app/dist/server/.vite/manifest.json +0 -359
  243. package/src/admin/app/dist/server/assets/Client-D4wNQeJd.js +0 -3
  244. package/src/admin/app/dist/server/assets/Client-D4wNQeJd.js.map +0 -1
  245. package/src/admin/app/dist/server/assets/GeistMono-Variable-BRXCGrxA.woff2 +0 -0
  246. package/src/admin/app/dist/server/assets/Inter-cyrillic-e3OmmzmJ.woff2 +0 -0
  247. package/src/admin/app/dist/server/assets/Inter-cyrillic-ext-DOWZeO4Q.woff2 +0 -0
  248. package/src/admin/app/dist/server/assets/Inter-greek-BD3ujQlX.woff2 +0 -0
  249. package/src/admin/app/dist/server/assets/Inter-greek-ext-CXEwbus4.woff2 +0 -0
  250. package/src/admin/app/dist/server/assets/Inter-latin-BDFm4vTb.woff2 +0 -0
  251. package/src/admin/app/dist/server/assets/Inter-latin-ext-E7a9JEPe.woff2 +0 -0
  252. package/src/admin/app/dist/server/assets/Inter-symbols-DEch7Rxr.woff2 +0 -0
  253. package/src/admin/app/dist/server/assets/Inter-vietnamese-Bg9723vR.woff2 +0 -0
  254. package/src/admin/app/dist/server/assets/___dev-EY7r7Loc.css +0 -1
  255. package/src/admin/app/dist/server/assets/___dev.sign-in-DUf_NQPU.js +0 -2
  256. package/src/admin/app/dist/server/assets/___dev.sign-in-DUf_NQPU.js.map +0 -1
  257. package/src/admin/app/dist/server/assets/_tanstack-start-manifest_v-C8ysuxtN.js +0 -1
  258. package/src/admin/app/dist/server/assets/arktype-aI7TBD0R-D1R3Byo5.js +0 -2
  259. package/src/admin/app/dist/server/assets/arktype-aI7TBD0R-D1R3Byo5.js.map +0 -1
  260. package/src/admin/app/dist/server/assets/async-local-storage-DUe1175v.js +0 -2
  261. package/src/admin/app/dist/server/assets/async-local-storage-DUe1175v.js.map +0 -1
  262. package/src/admin/app/dist/server/assets/convert-BIC8n32x.js +0 -2
  263. package/src/admin/app/dist/server/assets/convert-BIC8n32x.js.map +0 -1
  264. package/src/admin/app/dist/server/assets/cookie-BOmgOR30.js +0 -2
  265. package/src/admin/app/dist/server/assets/cookie-BOmgOR30.js.map +0 -1
  266. package/src/admin/app/dist/server/assets/cookie-DdghQm8N.css +0 -1
  267. package/src/admin/app/dist/server/assets/default-u_dwuiYb-D6RfpcBr.js +0 -2
  268. package/src/admin/app/dist/server/assets/default-u_dwuiYb-D6RfpcBr.js.map +0 -1
  269. package/src/admin/app/dist/server/assets/effect-QlVUlMFu-Bs0PyUhN.js +0 -2
  270. package/src/admin/app/dist/server/assets/effect-QlVUlMFu-Bs0PyUhN.js.map +0 -1
  271. package/src/admin/app/dist/server/assets/empty-plugin-adapters-BaGcmrjC.js +0 -2
  272. package/src/admin/app/dist/server/assets/empty-plugin-adapters-BaGcmrjC.js.map +0 -1
  273. package/src/admin/app/dist/server/assets/esm-C6SW--yt.js +0 -4
  274. package/src/admin/app/dist/server/assets/esm-C6SW--yt.js.map +0 -1
  275. package/src/admin/app/dist/server/assets/index-CLddUTqr-ComTZ4bq.js +0 -2
  276. package/src/admin/app/dist/server/assets/index-CLddUTqr-ComTZ4bq.js.map +0 -1
  277. package/src/admin/app/dist/server/assets/index-DZEfthgZ-BxnrPO8Q.js +0 -2
  278. package/src/admin/app/dist/server/assets/index-DZEfthgZ-BxnrPO8Q.js.map +0 -1
  279. package/src/admin/app/dist/server/assets/reset-co-CHrff.css +0 -1
  280. package/src/admin/app/dist/server/assets/rolldown-runtime-BWaJ3C7D.js +0 -1
  281. package/src/admin/app/dist/server/assets/router-Cbo1RPkb.css +0 -1
  282. package/src/admin/app/dist/server/assets/router-Dqhrc0PX.js +0 -2
  283. package/src/admin/app/dist/server/assets/router-Dqhrc0PX.js.map +0 -1
  284. package/src/admin/app/dist/server/assets/routes-BEUY7mCO.css +0 -1
  285. package/src/admin/app/dist/server/assets/routes-CxbX5JNu.js +0 -2
  286. package/src/admin/app/dist/server/assets/routes-CxbX5JNu.js.map +0 -1
  287. package/src/admin/app/dist/server/assets/server-tS2GlQUk.js +0 -77
  288. package/src/admin/app/dist/server/assets/server-tS2GlQUk.js.map +0 -1
  289. package/src/admin/app/dist/server/assets/shadowDom-CvS1DzWo.js +0 -2
  290. package/src/admin/app/dist/server/assets/shadowDom-CvS1DzWo.js.map +0 -1
  291. package/src/admin/app/dist/server/assets/standard-json-DY77efq0.js +0 -2
  292. package/src/admin/app/dist/server/assets/standard-json-DY77efq0.js.map +0 -1
  293. package/src/admin/app/dist/server/assets/standard-json-ig2t0wRt.js +0 -2
  294. package/src/admin/app/dist/server/assets/standard-json-ig2t0wRt.js.map +0 -1
  295. package/src/admin/app/dist/server/assets/standard-json-t-LNckA6.js +0 -2
  296. package/src/admin/app/dist/server/assets/standard-json-t-LNckA6.js.map +0 -1
  297. package/src/admin/app/dist/server/assets/standard-openapi-CONmVRl8.js +0 -2
  298. package/src/admin/app/dist/server/assets/standard-openapi-CONmVRl8.js.map +0 -1
  299. package/src/admin/app/dist/server/assets/start-C63VetBp.js +0 -2
  300. package/src/admin/app/dist/server/assets/start-C63VetBp.js.map +0 -1
  301. package/src/admin/app/dist/server/assets/sury-CWZTCd75-DP9TvBrs.js +0 -2
  302. package/src/admin/app/dist/server/assets/sury-CWZTCd75-DP9TvBrs.js.map +0 -1
  303. package/src/admin/app/dist/server/assets/typebox-Dei93FPO-D_lCVdAz.js +0 -2
  304. package/src/admin/app/dist/server/assets/typebox-Dei93FPO-D_lCVdAz.js.map +0 -1
  305. package/src/admin/app/dist/server/assets/valibot--1zFm7rT-BKGsXNQL.js +0 -2
  306. package/src/admin/app/dist/server/assets/valibot--1zFm7rT-BKGsXNQL.js.map +0 -1
  307. package/src/admin/app/dist/server/assets/valibot-D_HTw1Gn-BNmO9Liy.js +0 -2
  308. package/src/admin/app/dist/server/assets/valibot-D_HTw1Gn-BNmO9Liy.js.map +0 -1
  309. package/src/admin/app/dist/server/assets/worker-entry-DcGlpZzO.js +0 -93
  310. package/src/admin/app/dist/server/assets/worker-entry-DcGlpZzO.js.map +0 -1
  311. package/src/admin/app/dist/server/assets/zod-Bwrt9trS-DuX8BREF.js +0 -2
  312. package/src/admin/app/dist/server/assets/zod-Bwrt9trS-DuX8BREF.js.map +0 -1
  313. package/src/admin/app/dist/server/assets/zod-DSgpEGAE-BF9ADewr.js +0 -2
  314. package/src/admin/app/dist/server/assets/zod-DSgpEGAE-BF9ADewr.js.map +0 -1
  315. package/src/admin/app/dist/server/index.js +0 -1
  316. package/src/admin/app/dist/server/wrangler.json +0 -1
  317. package/src/admin/app/env.ts +0 -11
  318. package/src/admin/app/lib/Client.ts +0 -38
  319. package/src/admin/app/package.json +0 -8
  320. package/src/admin/app/routeTree.gen.ts +0 -86
  321. package/src/admin/app/router.tsx +0 -19
  322. package/src/admin/app/routes/[_]dev.sign-in.tsx +0 -93
  323. package/src/admin/app/routes/__root.tsx +0 -97
  324. package/src/admin/app/routes/index.tsx +0 -20
  325. package/src/admin/app/screens/Dashboard.tsx +0 -84
  326. package/src/admin/app/screens/dev/SignIn.tsx +0 -213
  327. package/src/admin/app/server.ts +0 -129
  328. package/src/admin/app/tsconfig.json +0 -7
  329. package/src/admin/app/vite.config.ts +0 -52
  330. package/src/admin/app/void.config.ts +0 -17
  331. package/src/admin/app/zyzz.config.ts +0 -25
  332. package/src/admin/apps.ts +0 -472
  333. package/src/admin/dev/Session.ts +0 -332
  334. package/src/admin/dev/signIn.ts +0 -381
  335. package/src/admin/index.ts +0 -14
  336. package/src/admin/session.ts +0 -60
  337. package/src/cli/AdminApi.ts +0 -134
  338. package/src/client/Admin.ts +0 -76
  339. package/src/client/actions/admin/apps.ts +0 -257
  340. package/src/client/actions/admin.ts +0 -5
  341. package/src/internal/AdminApps.ts +0 -64
@@ -20,11 +20,6 @@ export const reasons = {
20
20
  error: 'invalid_request',
21
21
  status: 409,
22
22
  },
23
- app_exists: {
24
- description: 'Another OAuth app already has the client ID.',
25
- error: 'invalid_request',
26
- status: 409,
27
- },
28
23
  authorization_expired: {
29
24
  description:
30
25
  "The app's authorization request that sign-in or the approval page continues is forged or expired.",
@@ -102,12 +97,6 @@ export const reasons = {
102
97
  error: 'access_denied',
103
98
  status: 403,
104
99
  },
105
- invalid_app: {
106
- description:
107
- "A value of an OAuth app, such as its name or a redirect URI, is not valid, or does not fit the app's type.",
108
- error: 'invalid_request',
109
- status: 400,
110
- },
111
100
  invalid_chain: {
112
101
  description: 'The key chain ID is 0.',
113
102
  error: 'invalid_authorization_details',
@@ -236,12 +225,6 @@ export const reasons = {
236
225
  error: 'invalid_request',
237
226
  status: 400,
238
227
  },
239
- public_app: {
240
- description:
241
- 'The OAuth app redeems codes with PKCE alone, so it has no client secret to rotate.',
242
- error: 'invalid_request',
243
- status: 400,
244
- },
245
228
  rate_limited: {
246
229
  description:
247
230
  'Tempo ID, or a service it depends on, is rate limiting the request.',
@@ -286,11 +269,6 @@ export const reasons = {
286
269
  error: 'server_error',
287
270
  status: 500,
288
271
  },
289
- unknown_app: {
290
- description: 'No registered OAuth app has the client ID.',
291
- error: 'invalid_request',
292
- status: 404,
293
- },
294
272
  unknown_code: {
295
273
  description: 'The user code is wrong or expired.',
296
274
  error: 'invalid_request',
@@ -535,11 +513,6 @@ export namespace schema {
535
513
  error_description: 'Code already approved or denied.',
536
514
  field: 'code',
537
515
  },
538
- app_exists: {
539
- error_description:
540
- 'App client_01JZ8Q6W3N1R5B4V7C2X9K0M3T already exists. Update it, or choose another client ID.',
541
- field: 'clientId',
542
- },
543
516
  authorization_expired: {
544
517
  error_description:
545
518
  'Expired authorization request: the request from the app is no longer valid. Return to the app, and start again.',
@@ -608,10 +581,6 @@ export namespace schema {
608
581
  "Access denied to Tempo Account 0x8C3b5d0e2A4f6B1c9D7e3F5a0B2c4D6e8F1a3B5c. Name one of the user's accounts in the app's realms.",
609
582
  field: 'account',
610
583
  },
611
- invalid_app: {
612
- error_description:
613
- 'Invalid redirect URI: http://app.example/callback uses http. Use an https URI.',
614
- },
615
584
  invalid_chain: {
616
585
  error_description:
617
586
  'Invalid `chainId`: 0. Use a Tempo chain ID, such as 4217.',
@@ -720,11 +689,6 @@ export namespace schema {
720
689
  'Invalid post_logout_redirect_uri: https://app.example/elsewhere is not registered for the app. Use one of its post-logout redirect URIs, or leave it out.',
721
690
  field: 'post_logout_redirect_uri',
722
691
  },
723
- public_app: {
724
- error_description:
725
- 'App client_01JZ8Q6W3N1R5B4V7C2X9K0M3T has no client secret. Rotate the secret of an app with a backend.',
726
- field: 'clientId',
727
- },
728
692
  rate_limited: {
729
693
  error_description: 'Too many requests. Try again in 30 seconds.',
730
694
  },
@@ -753,11 +717,6 @@ export namespace schema {
753
717
  field: 'email',
754
718
  },
755
719
  unexpected: { error_description: 'Unexpected error. Try again.' },
756
- unknown_app: {
757
- error_description:
758
- 'Unknown app client_01JZ8Q6W3N1R5B4V7C2X9K0M3T. Name a registered OAuth app.',
759
- field: 'clientId',
760
- },
761
720
  unknown_code: {
762
721
  error_description:
763
722
  'Invalid or expired code. Check the code in the terminal.',
@@ -108,57 +108,19 @@ const tags = [
108
108
  */
109
109
  export function document(
110
110
  app: Hono<any, any, any>,
111
- options: document.Options = {},
112
111
  ): ReturnType<typeof generateSpecs> {
113
112
  const cached = documents.get(app)
114
113
  if (cached) return cached
115
114
 
116
- const generated = generate(app, options)
115
+ const generated = generate(app)
117
116
  documents.set(app, generated)
118
117
  // A failed generation is not cached, so the next request tries again.
119
118
  generated.catch(() => documents.delete(app))
120
119
  return generated
121
120
  }
122
121
 
123
- export declare namespace document {
124
- type Options = {
125
- /** The document's title and description. Defaults to the public API's. */
126
- info?:
127
- | {
128
- /** What the API does. */
129
- description: string
130
- /** The API's name. */
131
- title: string
132
- }
133
- | undefined
134
- /**
135
- * The schemes that every operation requires, such as `[{ deployment: [] }]`. Defaults to none,
136
- * and each route names its own.
137
- */
138
- security?: readonly Record<string, readonly string[]>[] | undefined
139
- /** The schemes that authenticate requests, by name. Defaults to the public API's. */
140
- securitySchemes?:
141
- | NonNullable<
142
- NonNullable<
143
- NonNullable<Parameters<typeof generateSpecs>[1]>['documentation']
144
- >['components']
145
- >['securitySchemes']
146
- | undefined
147
- /** The route groups, in the order the reference lists them. Defaults to the public API's. */
148
- tags?:
149
- | readonly {
150
- /** The requests of the group's flow, in order. */
151
- description: string
152
- /** The group's name, which each route names in `tags`. */
153
- name: string
154
- }[]
155
- | undefined
156
- }
157
- }
158
-
159
122
  /**
160
- * The API reference page, which renders the `openapi.json` beside it with Scalar. The relative URL
161
- * holds under a base path, such as a preview's `/_dev/docs`. Scalar mounts from the
123
+ * The API reference page, which renders `/openapi.json` with Scalar. Scalar mounts from the
162
124
  * `api-reference` element, so the page has no inline script.
163
125
  */
164
126
  export const reference = `<!doctype html>
@@ -169,7 +131,7 @@ export const reference = `<!doctype html>
169
131
  <title>Tempo ID API</title>
170
132
  </head>
171
133
  <body>
172
- <script id="api-reference" type="application/json" data-url="openapi.json"></script>
134
+ <script id="api-reference" type="application/json" data-url="/openapi.json"></script>
173
135
  <script src="${scalar.src}" integrity="${scalar.integrity}" crossorigin="anonymous"></script>
174
136
  </body>
175
137
  </html>
@@ -321,7 +283,7 @@ const documents = new WeakMap<
321
283
  >()
322
284
 
323
285
  /** Generates the OpenAPI document for `app`. */
324
- async function generate(app: Hono<any, any, any>, options_: document.Options) {
286
+ async function generate(app: Hono<any, any, any>) {
325
287
  // Each refusal's schema has an `id`, so converting it yields a reference plus the component.
326
288
  const converted = await Promise.all(
327
289
  (Object.keys(ErrorResponse.reasons) as ErrorResponse.Reason[]).map(
@@ -342,7 +304,7 @@ async function generate(app: Hono<any, any, any>, options_: document.Options) {
342
304
  documentation: {
343
305
  components: {
344
306
  schemas,
345
- securitySchemes: options_.securitySchemes ?? {
307
+ securitySchemes: {
346
308
  accessToken: {
347
309
  bearerFormat: 'JWT',
348
310
  description:
@@ -365,21 +327,9 @@ async function generate(app: Hono<any, any, any>, options_: document.Options) {
365
327
  },
366
328
  },
367
329
  },
368
- info: options_.info ? { ...options_.info, version: info.version } : info,
330
+ info,
369
331
  openapi: '3.1.0',
370
- ...(options_.security
371
- ? {
372
- security: options_.security.map((requirement) =>
373
- Object.fromEntries(
374
- Object.entries(requirement).map(([name, scopes]) => [
375
- name,
376
- [...scopes],
377
- ]),
378
- ),
379
- ),
380
- }
381
- : {}),
382
- tags: options_.tags ? [...options_.tags] : tags,
332
+ tags,
383
333
  },
384
334
  })
385
335
  }
@@ -11,12 +11,6 @@ import { requestId } from 'hono/request-id'
11
11
  import type { Env } from './Env.js'
12
12
  import * as Timing from './Timing.js'
13
13
 
14
- /** The environment of the variables that the middleware sets and reads. */
15
- type Environment = {
16
- /** The request's variables. */
17
- Variables: Pick<Env['Variables'], 'refusal' | 'requestId' | 'timing'>
18
- }
19
-
20
14
  /** The codes of a refusal's OAuth error body, which `Timing` logs with the request. */
21
15
  export type Refusal = {
22
16
  /** The OAuth `error` code. */
@@ -37,7 +31,7 @@ export function middleware() {
37
31
  // chose. It also stops `requestId` from setting the header, which happens below instead.
38
32
  const assign = requestId({ generator, headerName: '' })
39
33
 
40
- return createMiddleware<Environment>(async (c, next) => {
34
+ return createMiddleware<Env>(async (c, next) => {
41
35
  await assign(c, next)
42
36
 
43
37
  const id = c.var.requestId
@@ -54,7 +48,7 @@ export function middleware() {
54
48
  * Replaces the response with its OAuth error `body` plus `request_id`, and returns the body's
55
49
  * `error` and `reason` codes.
56
50
  */
57
- function annotate(c: Context<Environment>, options: annotate.Options): Refusal {
51
+ function annotate(c: Context<Env>, options: annotate.Options): Refusal {
58
52
  const response = c.res
59
53
  c.res = new Response(
60
54
  JSON.stringify({ ...options.body, request_id: options.id }),
@@ -93,10 +93,7 @@ export declare namespace measure {
93
93
  * Vite dev server, it also logs the same timings. A streamed page's `total` ends when its headers
94
94
  * are ready.
95
95
  */
96
- export const middleware = createMiddleware<{
97
- /** The variables that the middleware sets and reads. */
98
- Variables: Pick<Env['Variables'], 'refusal' | 'requestId' | 'timing'>
99
- }>(async (c, next) => {
96
+ export const middleware = createMiddleware<Env>(async (c, next) => {
100
97
  const cold = !served
101
98
  served = true
102
99
  const timing: Timing = { events: 0, spans: [], start: performance.now() }
@@ -1,17 +1,3 @@
1
- /** The admin app build, which `#admin-app` names and `pnpm build` writes to `dist/admin/app/`. */
2
- declare module '#admin-app' {
3
- /** The built Worker's handlers. */
4
- const handlers: {
5
- /** Serves a request with the Worker's bindings. */
6
- fetch(
7
- request: Request,
8
- env: Record<string, unknown>,
9
- ctx: unknown,
10
- ): Promise<Response>
11
- }
12
- export default handlers
13
- }
14
-
15
1
  /** The app build, which `#app` names and `pnpm build` writes to `dist/app/`. */
16
2
  declare module '#app' {
17
3
  /** The built Worker's handlers. */
package/dist/Admin.d.ts DELETED
@@ -1,79 +0,0 @@
1
- import type * as Env from './admin/Env.js';
2
- /** An option of `Admin.create` is absent or invalid. */
3
- export declare class InvalidOptionError extends Error {
4
- readonly name = "Admin.InvalidOptionError";
5
- }
6
- /** The employee or service that a request acts as. */
7
- export type Actor = Env.Actor;
8
- /**
9
- * Returns the admin Worker's handler, which serves the admin app's pages, such as the dashboard,
10
- * and the Admin API: OAuth app registration and
11
- * operation. `authorize` runs before every request, so a deployment without it never starts. Serve
12
- * it on a host that the public cannot reach, never on Tempo ID's own.
13
- *
14
- * ```ts
15
- * import { env } from 'cloudflare:workers'
16
- * import { Admin } from '@tempoxyz/id/admin'
17
- *
18
- * export default Admin.create({
19
- * authorize: async (request) =>
20
- * (await verify(request)) ?? new Response(null, { status: 401 }),
21
- * db: env.HYPERDRIVE,
22
- * })
23
- * ```
24
- *
25
- * @throws {InvalidOptionError} When an option is absent or invalid, so the Worker fails to start.
26
- */
27
- export declare function create(options: create.Options): create.ReturnType;
28
- export declare namespace create {
29
- type Options = {
30
- /**
31
- * Decides whether a request may reach the Admin API, before every route. Returns the actor,
32
- * whose `sub` the audit logs record, or a `Response` that refuses the request, such as a 401.
33
- * It verifies the request itself, such as a Cloudflare Access assertion, and fails closed.
34
- * Required unless `login` is set.
35
- */
36
- authorize?: Env.Authorize | undefined;
37
- /**
38
- * A Hyperdrive binding, such as `env.HYPERDRIVE`, or `{ connectionString }`, to the database of
39
- * the Tempo ID deployment that the API operates.
40
- */
41
- db: {
42
- /** The Postgres connection string. */
43
- connectionString: string;
44
- };
45
- /**
46
- * An email-code sign-in in place of `authorize`, as on a preview: addresses at `emailDomain`
47
- * sign in at `/_dev/sign-in` with an emailed code, through the `/_dev` routes, and every other
48
- * request needs its session cookie. Use it only where the database holds test data.
49
- */
50
- login?: {
51
- /** The email service that sends the codes. */
52
- email: {
53
- /** The `send_email` binding, such as `env.SEND_EMAIL`. */
54
- binding: {
55
- /** Sends a message. */
56
- send: (message: never) => Promise<unknown>;
57
- };
58
- /** The sender of every email, such as `Tempo ID Admin <noreply@id.example.com>`. */
59
- from: string;
60
- };
61
- /** The domain whose addresses sign in, such as `tempo.xyz`. */
62
- emailDomain: string;
63
- /** The key that signs the session cookie, such as the deployment's `SECRET`. */
64
- secret: string;
65
- } | undefined;
66
- /**
67
- * The credential that `authorize` reads, which the OpenAPI document names, so the reference and
68
- * generated clients send it. Defaults to the `cf-access-token` header, which Cloudflare Access checks.
69
- * `login` names its session cookie instead.
70
- */
71
- securityScheme?: Env.SecurityScheme | undefined;
72
- };
73
- type ReturnType = {
74
- /** Serves a request to the Worker. */
75
- fetch: (request: Request, env: Record<string, unknown>, ctx: unknown) => Promise<Response>;
76
- };
77
- type ErrorType = InvalidOptionError;
78
- }
79
- //# sourceMappingURL=Admin.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Admin.d.ts","sourceRoot":"","sources":["../src/Admin.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,GAAG,MAAM,gBAAgB,CAAA;AAG1C,wDAAwD;AACxD,qBAAa,kBAAmB,SAAQ,KAAK;IAC3C,SAAkB,IAAI,8BAA6B;CACpD;AAED,sDAAsD;AACtD,MAAM,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAA;AAE7B;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,UAAU,CAqCjE;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,KAAK,OAAO,GAAG;QACb;;;;;WAKG;QACH,SAAS,CAAC,EAAE,GAAG,CAAC,SAAS,GAAG,SAAS,CAAA;QACrC;;;WAGG;QACH,EAAE,EAAE;YACF,sCAAsC;YACtC,gBAAgB,EAAE,MAAM,CAAA;SACzB,CAAA;QACD;;;;WAIG;QACH,KAAK,CAAC,EACF;YACE,8CAA8C;YAC9C,KAAK,EAAE;gBACL,0DAA0D;gBAC1D,OAAO,EAAE;oBACP,uBAAuB;oBACvB,IAAI,EAAE,CAAC,OAAO,EAAE,KAAK,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;iBAC3C,CAAA;gBACD,oFAAoF;gBACpF,IAAI,EAAE,MAAM,CAAA;aACb,CAAA;YACD,+DAA+D;YAC/D,WAAW,EAAE,MAAM,CAAA;YACnB,gFAAgF;YAChF,MAAM,EAAE,MAAM,CAAA;SACf,GACD,SAAS,CAAA;QACb;;;;WAIG;QACH,cAAc,CAAC,EAAE,GAAG,CAAC,cAAc,GAAG,SAAS,CAAA;KAChD,CAAA;IAED,KAAK,UAAU,GAAG;QAChB,sCAAsC;QACtC,KAAK,EAAE,CACL,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5B,GAAG,EAAE,OAAO,KACT,OAAO,CAAC,QAAQ,CAAC,CAAA;KACvB,CAAA;IAED,KAAK,SAAS,GAAG,kBAAkB,CAAA;CACpC"}
package/dist/Admin.js DELETED
@@ -1,93 +0,0 @@
1
- /**
2
- * Tempo ID's Admin API as a Cloudflare Worker, on a host of its own, from the deployment's options.
3
- * @module
4
- */
5
- import handlers from '#admin-app';
6
- import * as Session from './admin/dev/Session.js';
7
- /** An option of `Admin.create` is absent or invalid. */
8
- export class InvalidOptionError extends Error {
9
- name = 'Admin.InvalidOptionError';
10
- }
11
- /**
12
- * Returns the admin Worker's handler, which serves the admin app's pages, such as the dashboard,
13
- * and the Admin API: OAuth app registration and
14
- * operation. `authorize` runs before every request, so a deployment without it never starts. Serve
15
- * it on a host that the public cannot reach, never on Tempo ID's own.
16
- *
17
- * ```ts
18
- * import { env } from 'cloudflare:workers'
19
- * import { Admin } from '@tempoxyz/id/admin'
20
- *
21
- * export default Admin.create({
22
- * authorize: async (request) =>
23
- * (await verify(request)) ?? new Response(null, { status: 401 }),
24
- * db: env.HYPERDRIVE,
25
- * })
26
- * ```
27
- *
28
- * @throws {InvalidOptionError} When an option is absent or invalid, so the Worker fails to start.
29
- */
30
- export function create(options) {
31
- validate(options);
32
- const { db, login } = options;
33
- const authorize = login
34
- ? Session.authorize({ secret: login.secret })
35
- : options.authorize;
36
- // The built admin app reads its settings from the bindings under these names. A Hyperdrive
37
- // binding's connection string is read for each request. Each name takes its option's value, or
38
- // none, so no variable of the Worker with the same name reaches the app.
39
- const bindings = (env) => ({
40
- ...env,
41
- ADMIN_AUTHORIZE: authorize,
42
- ADMIN_DATABASE_URL: db.connectionString,
43
- ADMIN_LOGIN: login
44
- ? {
45
- emailDomain: login.emailDomain,
46
- from: login.email.from,
47
- secret: login.secret,
48
- }
49
- : undefined,
50
- // With `login`, the session cookie is the credential, whatever `securityScheme` names.
51
- ADMIN_SECURITY_SCHEME: login
52
- ? {
53
- description: 'The session cookie, which the email-code sign-in at `/_dev/sign-in` sets.',
54
- in: 'cookie',
55
- name: Session.cookie,
56
- }
57
- : options.securityScheme,
58
- SEND_EMAIL: login?.email.binding,
59
- });
60
- return {
61
- fetch: (request, env, ctx) => handlers.fetch(request, bindings(env), ctx),
62
- };
63
- }
64
- /** Throws when an option is absent or invalid, since bindings and functions escape type checks. */
65
- function validate(options) {
66
- const { authorize, db, login } = options;
67
- if (login && authorize)
68
- throw new InvalidOptionError('Invalid options: pass `authorize` or `login`, not both. `login` signs each request in itself.');
69
- if (!login && typeof authorize !== 'function')
70
- throw new InvalidOptionError('Missing `authorize`. Pass a function that verifies each request, such as a Cloudflare Access assertion, and returns its actor or a refusal.');
71
- if (login) {
72
- if (typeof login.email?.binding?.send !== 'function')
73
- throw new InvalidOptionError('Missing `login.email.binding`. Declare a `send_email` binding in the Wrangler config, and pass it, such as `env.SEND_EMAIL`.');
74
- if (typeof login.email.from !== 'string' || !login.email.from.includes('@'))
75
- throw new InvalidOptionError('Invalid `login.email.from`. Pass a sender with an address, such as `Tempo ID Admin <noreply@id.example.com>`.');
76
- if (typeof login.emailDomain !== 'string' ||
77
- !/^[a-z0-9-]+(\.[a-z0-9-]+)+$/.test(login.emailDomain))
78
- throw new InvalidOptionError(`Invalid \`login.emailDomain\`: ${JSON.stringify(login.emailDomain)}. Pass a lowercase domain, such as \`tempo.xyz\`.`);
79
- if (typeof login.secret !== 'string' || !login.secret)
80
- throw new InvalidOptionError("Missing `login.secret`. Pass the deployment's secret, such as `env.SECRET`.");
81
- }
82
- const scheme = options.securityScheme;
83
- if (scheme !== undefined &&
84
- (typeof scheme?.description !== 'string' ||
85
- !['cookie', 'header', 'query'].includes(scheme.in) ||
86
- typeof scheme.name !== 'string' ||
87
- !scheme.name))
88
- throw new InvalidOptionError('Invalid `securityScheme`. Pass the credential that `authorize` reads, such as `{ description, in: "header", name: "Authorization" }`.');
89
- // `db` can be a Hyperdrive binding, whose connection string is read only within a request.
90
- if (typeof db !== 'object' || db === null)
91
- throw new InvalidOptionError('Missing `db`. Pass a Hyperdrive binding, such as `env.HYPERDRIVE`, or `{ connectionString }`.');
92
- }
93
- //# sourceMappingURL=Admin.js.map
package/dist/Admin.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"Admin.js","sourceRoot":"","sources":["../src/Admin.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,QAAQ,MAAM,YAAY,CAAA;AAEjC,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAA;AAEjD,wDAAwD;AACxD,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IACzB,IAAI,GAAG,0BAA0B,CAAA;CACpD;AAKD;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,MAAM,CAAC,OAAuB;IAC5C,QAAQ,CAAC,OAAO,CAAC,CAAA;IAEjB,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,CAAA;IAC7B,MAAM,SAAS,GAAG,KAAK;QACrB,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;QAC7C,CAAC,CAAC,OAAO,CAAC,SAAS,CAAA;IAErB,2FAA2F;IAC3F,+FAA+F;IAC/F,yEAAyE;IACzE,MAAM,QAAQ,GAAG,CAAC,GAA4B,EAAE,EAAE,CAAC,CAAC;QAClD,GAAG,GAAG;QACN,eAAe,EAAE,SAAS;QAC1B,kBAAkB,EAAE,EAAE,CAAC,gBAAgB;QACvC,WAAW,EAAE,KAAK;YAChB,CAAC,CAAC;gBACE,WAAW,EAAE,KAAK,CAAC,WAAW;gBAC9B,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI;gBACtB,MAAM,EAAE,KAAK,CAAC,MAAM;aACrB;YACH,CAAC,CAAC,SAAS;QACb,uFAAuF;QACvF,qBAAqB,EAAE,KAAK;YAC1B,CAAC,CAAC;gBACE,WAAW,EACT,2EAA2E;gBAC7E,EAAE,EAAE,QAAiB;gBACrB,IAAI,EAAE,OAAO,CAAC,MAAM;aACrB;YACH,CAAC,CAAC,OAAO,CAAC,cAAc;QAC1B,UAAU,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO;KACjC,CAAC,CAAA;IAEF,OAAO;QACL,KAAK,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC;KAC1E,CAAA;AACH,CAAC;AA8DD,mGAAmG;AACnG,SAAS,QAAQ,CAAC,OAAuB;IACvC,MAAM,EAAE,SAAS,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,CAAA;IAExC,IAAI,KAAK,IAAI,SAAS;QACpB,MAAM,IAAI,kBAAkB,CAC1B,+FAA+F,CAChG,CAAA;IACH,IAAI,CAAC,KAAK,IAAI,OAAO,SAAS,KAAK,UAAU;QAC3C,MAAM,IAAI,kBAAkB,CAC1B,6IAA6I,CAC9I,CAAA;IACH,IAAI,KAAK,EAAE,CAAC;QACV,IAAI,OAAO,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,KAAK,UAAU;YAClD,MAAM,IAAI,kBAAkB,CAC1B,8HAA8H,CAC/H,CAAA;QACH,IAAI,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;YACzE,MAAM,IAAI,kBAAkB,CAC1B,+GAA+G,CAChH,CAAA;QACH,IACE,OAAO,KAAK,CAAC,WAAW,KAAK,QAAQ;YACrC,CAAC,6BAA6B,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC;YAEtD,MAAM,IAAI,kBAAkB,CAC1B,kCAAkC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,WAAW,CAAC,mDAAmD,CACvH,CAAA;QACH,IAAI,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,MAAM;YACnD,MAAM,IAAI,kBAAkB,CAC1B,6EAA6E,CAC9E,CAAA;IACL,CAAC;IACD,MAAM,MAAM,GAAG,OAAO,CAAC,cAAc,CAAA;IACrC,IACE,MAAM,KAAK,SAAS;QACpB,CAAC,OAAO,MAAM,EAAE,WAAW,KAAK,QAAQ;YACtC,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YAClD,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ;YAC/B,CAAC,MAAM,CAAC,IAAI,CAAC;QAEf,MAAM,IAAI,kBAAkB,CAC1B,uIAAuI,CACxI,CAAA;IACH,2FAA2F;IAC3F,IAAI,OAAO,EAAE,KAAK,QAAQ,IAAI,EAAE,KAAK,IAAI;QACvC,MAAM,IAAI,kBAAkB,CAC1B,+FAA+F,CAChG,CAAA;AACL,CAAC"}
@@ -1,68 +0,0 @@
1
- /**
2
- * The Hono environment of the Admin API, which `Admin.create` serves on a host of its own.
3
- * @module
4
- */
5
- import type { Context } from 'hono';
6
- import type * as Env_ from '../internal/Env.js';
7
- import type * as Realm from '../internal/Realm.js';
8
- /** The employee or service that a request acts as, from the deployment's `authorize`. */
9
- export type Actor = {
10
- /**
11
- * The actor's email address, which the dashboard shows to the actor alone. Logs never record it.
12
- * Absent, the dashboard shows `sub`.
13
- */
14
- email?: string | undefined;
15
- /** A stable, opaque ID of the actor, which audit logs record. Never an email address. */
16
- sub: string;
17
- };
18
- /** The credential that a deployment's `authorize` reads, as an OpenAPI `apiKey` scheme describes it. */
19
- export type SecurityScheme = {
20
- /** What the credential is, such as `A Cloudflare Access assertion.` */
21
- description: string;
22
- /** Where the request carries the credential. */
23
- in: 'cookie' | 'header' | 'query';
24
- /** The cookie, header, or query parameter that holds the credential. */
25
- name: string;
26
- };
27
- /** Decides whether a request may reach the Admin API. */
28
- export type Authorize = (request: Request) => Promise<Actor | Response>;
29
- /** The bindings and variables of an admin request. */
30
- export type Env = {
31
- /** The values that `Admin.create` adds to the Worker's bindings. */
32
- Bindings: {
33
- /** The deployment's authorization, from `Admin.create`. */
34
- ADMIN_AUTHORIZE: Authorize;
35
- /** The Postgres connection string, read for each request, from `Admin.create`. */
36
- ADMIN_DATABASE_URL: string;
37
- /**
38
- * The email-code sign-in under `/_dev`, from `Admin.create`'s `login`, as on a preview. Absent,
39
- * `/_dev` serves no route.
40
- */
41
- ADMIN_LOGIN?: {
42
- /** The domain whose addresses sign in, such as `tempo.xyz`. */
43
- emailDomain: string;
44
- /** The sender of the codes, such as `Tempo ID Admin <noreply@id.example.com>`. */
45
- from: string;
46
- /** The key that signs the session cookie. */
47
- secret: string;
48
- } | undefined;
49
- /**
50
- * The credential that `authorize` reads, as the OpenAPI document describes it, from
51
- * `Admin.create`. Absent, the document names the `cf-access-token` header, which Cloudflare Access checks.
52
- */
53
- ADMIN_SECURITY_SCHEME?: SecurityScheme | undefined;
54
- /**
55
- * Renders the admin app's page of `c`'s request through TanStack Start. Absent, as in the
56
- * Admin API without its app's build, a page path responds with `unknown_endpoint`.
57
- */
58
- ADMIN_PAGES?: ((c: Context<Env>) => Promise<Response>) | undefined;
59
- };
60
- /** The values that middleware sets on `c.var`. */
61
- Variables: Pick<Env_.Variables, 'refusal' | 'requestId' | 'timing'> & {
62
- /** The actor that `authorize` returned. */
63
- actor: Actor;
64
- /** The request's database client, which the admin app connects for the app routes. */
65
- db: Realm.Database;
66
- };
67
- };
68
- //# sourceMappingURL=Env.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Env.d.ts","sourceRoot":"","sources":["../../src/admin/Env.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AACnC,OAAO,KAAK,KAAK,IAAI,MAAM,oBAAoB,CAAA;AAC/C,OAAO,KAAK,KAAK,KAAK,MAAM,sBAAsB,CAAA;AAElD,yFAAyF;AACzF,MAAM,MAAM,KAAK,GAAG;IAClB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,yFAAyF;IACzF,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AAED,wGAAwG;AACxG,MAAM,MAAM,cAAc,GAAG;IAC3B,uEAAuE;IACvE,WAAW,EAAE,MAAM,CAAA;IACnB,gDAAgD;IAChD,EAAE,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAA;IACjC,wEAAwE;IACxE,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,yDAAyD;AACzD,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,KAAK,GAAG,QAAQ,CAAC,CAAA;AAEvE,sDAAsD;AACtD,MAAM,MAAM,GAAG,GAAG;IAChB,oEAAoE;IACpE,QAAQ,EAAE;QACR,2DAA2D;QAC3D,eAAe,EAAE,SAAS,CAAA;QAC1B,kFAAkF;QAClF,kBAAkB,EAAE,MAAM,CAAA;QAC1B;;;WAGG;QACH,WAAW,CAAC,EACR;YACE,+DAA+D;YAC/D,WAAW,EAAE,MAAM,CAAA;YACnB,kFAAkF;YAClF,IAAI,EAAE,MAAM,CAAA;YACZ,6CAA6C;YAC7C,MAAM,EAAE,MAAM,CAAA;SACf,GACD,SAAS,CAAA;QACb;;;WAGG;QACH,qBAAqB,CAAC,EAAE,cAAc,GAAG,SAAS,CAAA;QAClD;;;WAGG;QACH,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC,GAAG,SAAS,CAAA;KACnE,CAAA;IACD,kDAAkD;IAClD,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC,GAAG;QACpE,2CAA2C;QAC3C,KAAK,EAAE,KAAK,CAAA;QACZ,sFAAsF;QACtF,EAAE,EAAE,KAAK,CAAC,QAAQ,CAAA;KACnB,CAAA;CACF,CAAA"}
package/dist/admin/Env.js DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=Env.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Env.js","sourceRoot":"","sources":["../../src/admin/Env.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- wrangler.json
2
- .dev.vars
@@ -1,2 +0,0 @@
1
- import{n as e,t}from"./rolldown-runtime-WkwZ5CU-.js";var n=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function ee(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=ee(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function F(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var I=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function L(e){var t=w.T,n={};n.types=t===null?null:t.types,w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,I)}catch(e){I(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}}function R(e){var t=w.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else L(R.bind(null,e))}var z={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=z,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.addTransitionType=R,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:F}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=L,e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.3.0`})),r=t(((e,t)=>{t.exports=n()})),i=e(r(),1),a=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),o=t(((e,t)=>{t.exports=a()})),s=i.createContext(null);function c(e){return i.useContext(s)}function l(e){let t=c();return i.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}var u=Object.freeze({dark:`z_scheme-dark`,light:`z_scheme-light`,"light dark":`z_scheme-light-dark`});Object.keys(u).map(e=>`.${u[e]}{color-scheme:${e};}`).join(`
2
- `);function d({className:e}){return(t=>{if(!t)return{className:e};let{className:n,style:r,vars:i}=t,a=i?{...i,...r}:r,o=f(e,n);return a?{className:o,style:a}:{className:o}})}function f(e,t){return e&&t?`${e} ${t}`:t||e}function p(e){let t={class:e.className};if(e.style!==void 0){let n=[];for(let[t,r]of Object.entries(e.style)){if(r==null)continue;let e=t.startsWith(`--`)?t:t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`).replace(/^ms-/,`-ms-`);n.push(`${e}:${r}`)}t.style=n.join(`;`)}for(let[n,r]of Object.entries(e))n.startsWith(`data-`)&&(t[n]=r);return t}var m=Symbol.for(`zyzz.composition.input.v1`);function ee(e){return Object.defineProperty(p(e),m,{value:e})}function h(e,t=!1,n=`set`,r){let i=Object.fromEntries(e);return(e={})=>{let a=e&&typeof e==`object`?e[n]??r:void 0;if(!e||typeof e!=`object`||Array.isArray(e)||!Object.hasOwn(e,n)&&r===void 0||typeof a!=`string`||!Object.hasOwn(i,a)||Object.keys(e).some(e=>e!==n&&e!==`colorScheme`)||e.colorScheme!==void 0&&![`light`,`dark`,`light dark`].includes(e.colorScheme))throw TypeError(`Invalid variable selection.`);let o=e.colorScheme,s={className:o?`${i[a]} ${u[o]}`:i[a],...o?{style:{colorScheme:o}}:{}};return t?ee(s):s}}var g={...i},_={};function v(e,t){let n=i.useRef(_);return n.current===_&&(n.current=e(t)),n}var y=g.useInsertionEffect,b=y&&y!==g.useLayoutEffect?y:e=>e();function x(e){let t=v(S).current;return t.next=e,b(t.effect),t.trampoline}function S(){let e={next:void 0,callback:C,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function C(){}function w(){}var T=Object.freeze([]),E=Object.freeze({}),D=typeof document<`u`?i.useLayoutEffect:()=>{};function O(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var k=O(`https://base-ui.com/production-error`,`Base UI`);function A(e,t,n,r){let i=v(M).current;return N(i,e,t,n,r)&&F(i,[e,t,n,r]),i.callback}function j(e){let t=v(M).current;return P(t,e)&&F(t,e),t.callback}function M(){return{callback:null,cleanup:null,refs:[]}}function N(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function P(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function F(e,t){e.refs=t,e.callback=t.every(e=>e==null)?null:n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}var I=19;function L(e){return I>=e}function R(e){if(!i.isValidElement(e))return null;let t=e,n=t.props;return(L(19)?n?.ref:t.ref)??null}function z(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function te(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e)}else i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function ne(e,t){return typeof e==`function`?e(t):e}function re(e,t){return typeof e==`function`?e(t):e}var ie={};function B(e,t,n,r,i){if(!n&&!r&&!i&&!e)return V(t);let a=V(e);return t&&(a=H(a,t)),n&&(a=H(a,n)),r&&(a=H(a,r)),i&&(a=H(a,i)),a}function ae(e){if(e.length===0)return ie;if(e.length===1)return V(e[0]);let t=V(e[0]);for(let n=1;n<e.length;n+=1)t=H(t,e[n]);return t}function V(e){return le(e)?{...e(ie)}:oe(e)}function H(e,t){return le(t)?t(e):se(e,t)}function oe(e){let t={...e};for(let e in t){let n=t[e];ce(e,n)&&(t[e]=de(n))}return t}function se(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=z(e.style,r);break;case`className`:e[n]=fe(e.className,r);break;default:e[n]=ce(n,r)?ue(e[n],r):r}}return e}function ce(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function le(e){return typeof e==`function`}function ue(e,t){return t?e?(...n)=>{let r=n[0];if(pe(r)){let i=r;U(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:de(t):e}function de(e){return e&&((...t)=>{let n=t[0];return pe(n)&&U(n),e(...t)})}function U(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function fe(e,t){return t?e?t+` `+e:t:e}function pe(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function me(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=ve(r));let i=he(t,n,r);if(n.enabled===!1)return null;let a=n.state??E;return ye(e,r,i,a)}function he(e,t,n){let{className:r,style:i}=e,{state:a=E,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?ne(r,a):void 0,d=l?re(i,a):void 0,f=l?te(a,c):E,p=l&&s?ge(s):void 0,m=l?z(f,p)??{}:E;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?j([m.ref,R(n),...o]):A(m.ref,R(n),o):A(null,null)),l?(u!==void 0&&(m.className=fe(m.className,u)),d!==void 0&&(m.style=z(m.style,d)),m):E}function ge(e){return Array.isArray(e)?ae(e):B(void 0,e)}var _e=Symbol.for(`react.lazy`);function ve(e){if(e?.$$typeof!==_e)return e;let t=i.Children.toArray(e)[0];return i.isValidElement(t)?t:e}function ye(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=B(n,t.props);return e.ref=n.ref,i.cloneElement(t,e)}return be(e,n)}function be(e,t){return e===`button`?(0,i.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,i.createElement)(`img`,{alt:``,...t,key:t.key}):i.createElement(e,t)}function W(){return typeof window<`u`}function G(e){return q(e)?(e.nodeName||``).toLowerCase():`#document`}function K(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function xe(e){return((q(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function q(e){return W()?e instanceof Node||e instanceof K(e).Node:!1}function Se(e){return W()?e instanceof Element||e instanceof K(e).Element:!1}function J(e){return W()?e instanceof HTMLElement||e instanceof K(e).HTMLElement:!1}function Y(e){return!W()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof K(e).ShadowRoot}function Ce(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Te(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function we(e){return/^(html|body|#document)$/.test(G(e))}function Te(e){return K(e).getComputedStyle(e)}function Ee(e){if(G(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Y(e)&&e.host||xe(e);return Y(t)?t.host:t}var De=i.createContext(void 0);function Oe(e=!1){let t=i.useContext(De);if(t===void 0&&!e)throw Error(k(16));return t}function ke(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:a=0,isNativeButton:o}=e,s=r&&t!==!1,c=r&&t===!1;return{props:i.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=a,!o&&n&&(e.tabIndex=t?a:-1)),(o&&(t||s)||!o&&n)&&(e[`aria-disabled`]=n),o&&(!t||c)&&(e.disabled=n),e},[r,n,t,s,c,o,a])}}function X(e,t,{detail:n=0,pointerType:r=``}={}){e.dispatchEvent(new(K(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,pointerType:r,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function Ae(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:a=!0,composite:o}=e,s=i.useRef(null),c=Oe(!0),l=o??c!==void 0,{props:u}=ke({focusableWhenDisabled:n,disabled:t,composite:l,tabIndex:r,isNativeButton:a}),d=i.useCallback(()=>{let e=s.current;Z(e)&&l&&t&&u.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,u.disabled,l]);return D(d,[d]),{getButtonProps:i.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:i,onKeyDown:o,onPointerDown:s,...c}=e;return B({onClick(e){t?e.preventDefault():n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(U(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,i=Z(r),s=!a&&je(r),c=n&&(a?i:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&l&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!a||i)&&(e.preventBaseUIHandler(),X(r,e))}else!c||a||!d&&!u?n&&s&&d&&e.preventDefault():e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),X(r,e)))},onKeyUp(e){t||(U(e),i?.(e),e.target===e.currentTarget&&a&&l&&Z(e.currentTarget)&&e.key===` `?e.preventDefault():e.baseUIHandlerPrevented||e.target===e.currentTarget&&!a&&!l&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),X(e.currentTarget,e)))},onPointerDown(e){t?e.preventDefault():s?.(e)}},a?{type:`button`}:{role:`button`},u,c)},[t,u,l,a]),buttonRef:x(e=>{s.current=e,d()})}}function Z(e){return J(e)&&e.tagName===`BUTTON`}function je(e){return J(e)&&e.tagName===`A`&&!!e.href}var Me={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},Ne={...Me,position:`fixed`,margin:0,top:0,left:0},Pe={...Me,position:`absolute`};function Fe(e){return me(e.defaultTagName??`div`,e,e)}function Ie(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}var{style:Le,variants:Re,vars:ze}={vars:h([[`default`,`z-theme-tempo_2d_id_2d_admin-default`]],!1,`set`,`default`)},Be=new Set([101,204,205,304]);async function Ve(e){let t=await e;if((t.body||t._bodyInit)&&!Be.has(t.status)&&(t._data=await t[We(t)]()),!t.ok)throw new He(`${t.status} ${t.statusText}`,{statusCode:t?.status,detail:{data:t?._data,statusText:t?.statusText}});return t._data}var He=class extends Error{detail;code;log;statusCode;constructor(e,t={}){super(e),this.name=`DetailedError`,this.log=t.log,this.detail=t.detail,this.code=t.code,this.statusCode=t.statusCode}},Ue=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(?:;.+)?$/i;function We(e){let t=e.headers.get(`content-type`);if(!t)return`text`;let n=t.split(`;`).shift();return Ue.test(n)?`json`:`text`}var Ge=(e,t)=>(e=e.replace(/\/+$/,``),e+=`/`,t=t.replace(/^\/+/,``),e+t),Q=(e,t)=>{for(let[n,r]of Object.entries(t)){let t=RegExp(`/:`+n+`(?:{[^/]+})?\\??(?=/|$)`);e=e.replace(t,()=>r?`/${r}`:``)}return e},Ke=e=>{let t=new URLSearchParams;for(let[n,r]of Object.entries(e))if(r!==void 0){if(Array.isArray(r))for(let e of r)e!==void 0&&t.append(n,e);else t.set(n,r)}return t},qe=(e,t)=>{switch(t){case`ws`:return e.replace(/^http/,`ws`);case`http`:return e.replace(/^ws/,`http`)}},Je=e=>/^https?:\/\/[^\/]+?\/index(?=\?|$)/.test(e)?e.replace(/\/index(?=\?|$)/,`/`):e.replace(/\/index(?=\?|$)/,``);function $(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ye(e,t){if(!$(e)&&!$(t))return t;let n={...e};for(let e in t){let r=t[e];n[e]=$(n[e])&&$(r)?Ye(n[e],r):r}return n}async function Xe(e){return Ve(e)}var Ze=/^[\w!#$%&'*.^`|~+-]+$/,Qe=(e,t,n={})=>{if(!Ze.test(e))throw Error(`Invalid cookie name`);let r=`${e}=${t}`;if(e.startsWith(`__Secure-`)&&!n.secure)throw Error(`__Secure- Cookie must have Secure attributes`);if(e.startsWith(`__Host-`)){if(!n.secure)throw Error(`__Host- Cookie must have Secure attributes`);if(n.path!==`/`)throw Error(`__Host- Cookie must have Path attributes with "/"`);if(n.domain)throw Error(`__Host- Cookie must not have Domain attributes`)}for(let e of[`domain`,`path`,`sameSite`,`priority`])if(n[e]&&/[;\r\n]/.test(n[e]))throw Error(`${e} must not contain ";", "\\r", or "\\n"`);if(n&&typeof n.maxAge==`number`&&n.maxAge>=0){if(n.maxAge>3456e4)throw Error(`Cookies Max-Age SHOULD NOT be greater than 400 days (34560000 seconds) in duration.`);r+=`; Max-Age=${n.maxAge|0}`}if(n.domain&&n.prefix!==`host`&&(r+=`; Domain=${n.domain}`),n.path&&(r+=`; Path=${n.path}`),n.expires){if(n.expires.getTime()-Date.now()>3456e7)throw Error(`Cookies Expires SHOULD NOT be greater than 400 days (34560000 seconds) in the future.`);r+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(r+=`; HttpOnly`),n.secure&&(r+=`; Secure`),n.sameSite&&(r+=`; SameSite=${n.sameSite.charAt(0).toUpperCase()+n.sameSite.slice(1)}`),n.priority&&(r+=`; Priority=${n.priority.charAt(0).toUpperCase()+n.priority.slice(1)}`),n.partitioned){if(!n.secure)throw Error(`Partitioned Cookie must have Secure attributes`);r+=`; Partitioned`}return r},$e=(e,t,n)=>(t=encodeURIComponent(t),Qe(e,t,n)),et=(e,t)=>new Proxy(()=>{},{get(n,r){if(typeof r==`string`&&r!==`then`)return et(e,[...t,r])},apply(n,r,i){return e({path:t,args:i})}}),tt=(e,t)=>{let n=t.toString();return n?`${e}?${n}`:e},nt=class{url;method;buildSearchParams;queryParams=void 0;pathParams={};rBody;cType=void 0;constructor(e,t,n){this.url=e,this.method=t,this.buildSearchParams=n.buildSearchParams}fetch=async(e,t)=>{if(e){if(e.query&&(this.queryParams=this.buildSearchParams(e.query)),e.form){let t=new FormData;for(let[n,r]of Object.entries(e.form))if(r!==void 0){if(Array.isArray(r))for(let e of r)e!==void 0&&t.append(n,e);else t.append(n,r)}this.rBody=t}e.json!==void 0&&(this.rBody=JSON.stringify(e.json),this.cType=`application/json`),e.param&&(this.pathParams=e.param)}let n=this.method.toUpperCase(),r={...e?.header,...typeof t?.headers==`function`?await t.headers():t?.headers};if(e?.cookie){let t=[];for(let[n,r]of Object.entries(e.cookie))r!==void 0&&t.push($e(n,r));t.length>0&&(r.Cookie=t.join(`; `))}this.cType&&(r[`Content-Type`]=this.cType);let i=new Headers;for(let[e,t]of Object.entries(r))t!==void 0&&i.set(e,t);let a=this.url;a=Je(a),a=Q(a,this.pathParams),this.queryParams&&(a=tt(a,this.queryParams)),n=this.method.toUpperCase();let o=n!==`GET`&&n!==`HEAD`;return(t?.fetch||fetch)(a,{body:o?this.rBody:void 0,method:n,headers:i,...t?.init})}},rt=(e,t)=>et(function n(r){let i=t?.buildSearchParams??Ke,a=[...r.path],o=a.slice(-3).reverse();if(o[0]===`toString`)return o[1]===`name`?o[2]||``:n.toString();if(o[0]===`valueOf`)return o[1]===`name`?o[2]||``:n;let s=``;if(/^\$/.test(o[0])){let e=a.pop();e&&(s=e.replace(/^\$/,``))}let c=Ge(e,a.join(`/`));if(s===`url`||s===`path`){let t=Je(c);return r.args[0]&&(r.args[0].param&&(t=Q(t,r.args[0].param)),r.args[0].query&&(t=tt(t,i(r.args[0].query)))),s===`url`?new URL(t):t.slice(e.replace(/\/+$/,``).length).replace(/^\/?/,`/`)}if(s===`ws`){let e=Je(c),n=qe(r.args[0]?.param?Q(e,r.args[0].param):e,`ws`),a=new URL(n),o=r.args[0]?.query;return o&&i(o).forEach((e,t)=>{a.searchParams.append(t,e)}),((...e)=>t?.webSocket!==void 0&&typeof t.webSocket==`function`?t.webSocket(...e):new WebSocket(...e))(a.toString())}let l=new nt(c,s,{buildSearchParams:i});if(s){t??={};let e={...r.args[1]},n=t.headers,i=e.headers;n&&i&&(e.headers=async()=>({...typeof n==`function`?await n():n,...typeof i==`function`?await i():i}));let a=Ye(t,e);return l.fetch(r.args[0],a)}return l},[]),it=()=>fetch,at=()=>window.location.origin;function ot(){return rt(at(),{fetch:it()})}function st(e){if(e instanceof He){let t=e.detail?.data;return typeof t==`object`&&t&&`error_description`in t&&typeof t.error_description==`string`?t.error_description:`Something went wrong. Try again.`}return`The Admin API cannot be reached. Check the connection, and try again.`}export{x as A,L as C,T as D,D as E,l as F,c as I,s as L,g as M,h as N,E as O,d as P,o as R,re as S,k as T,q as _,Ie as a,me as b,Pe as c,G as d,Ee as f,we as g,J as h,ze as i,v as j,w as k,Ae as l,Se as m,st as n,Fe as o,K as p,Xe as r,Ne as s,ot as t,Te as u,Ce as v,A as w,B as x,Y as y,r as z};