@coffre/ui 0.1.17 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (235) hide show
  1. package/README.md +23 -3
  2. package/dist/{server/_coffre/assets/affordances-CKANXDTG.js → chunks/affordances-DAvsVz7u.js} +12 -7
  3. package/dist/chunks/affordances-DAvsVz7u.js.map +1 -0
  4. package/dist/chunks/directory-CSjWWUQ1.js +370 -0
  5. package/dist/chunks/directory-CSjWWUQ1.js.map +1 -0
  6. package/dist/{server/_coffre/assets/grants-DdKT11Ny.js → chunks/grants-saMQagmG.js} +41 -39
  7. package/dist/chunks/grants-saMQagmG.js.map +1 -0
  8. package/dist/chunks/icons-D-PfAfnH.js +203 -0
  9. package/dist/chunks/icons-D-PfAfnH.js.map +1 -0
  10. package/dist/chunks/mounted-jJmqqV_n.js +17 -0
  11. package/dist/chunks/mounted-jJmqqV_n.js.map +1 -0
  12. package/dist/{server/_coffre/assets/offboarding-CRz-K82H.js → chunks/offboarding-C6l30DZR.js} +70 -69
  13. package/dist/chunks/offboarding-C6l30DZR.js.map +1 -0
  14. package/dist/chunks/page-C5HcNqf2.js +190 -0
  15. package/dist/chunks/page-C5HcNqf2.js.map +1 -0
  16. package/dist/chunks/page-route-Drfw7lmn.js +20 -0
  17. package/dist/chunks/page-route-Drfw7lmn.js.map +1 -0
  18. package/dist/{server/_coffre/assets/principal-page-C-EFwJQw.js → chunks/principal-page-D_91OA0l.js} +105 -103
  19. package/dist/chunks/principal-page-D_91OA0l.js.map +1 -0
  20. package/dist/{server/_coffre/assets → chunks}/project-environments-lEzFHUt4.js +2 -0
  21. package/dist/chunks/project-environments-lEzFHUt4.js.map +1 -0
  22. package/dist/chunks/queries-CQ81o4so.js +376 -0
  23. package/dist/chunks/queries-CQ81o4so.js.map +1 -0
  24. package/dist/{server/_coffre/assets/row-state-C2P57xT1.js → chunks/row-state-0PsrEzOL.js} +22 -21
  25. package/dist/chunks/row-state-0PsrEzOL.js.map +1 -0
  26. package/dist/{server/_coffre/assets → chunks}/signin-errors-BEFlVDbQ.js +2 -0
  27. package/dist/chunks/signin-errors-BEFlVDbQ.js.map +1 -0
  28. package/dist/chunks/theme-B2vQolVR.js +86 -0
  29. package/dist/chunks/theme-B2vQolVR.js.map +1 -0
  30. package/dist/chunks/ui-DixXLQvQ.js +405 -0
  31. package/dist/chunks/ui-DixXLQvQ.js.map +1 -0
  32. package/dist/{server/_coffre/assets/use-action-B-xpvVRO.js → chunks/use-action-CWsg_YWU.js} +8 -6
  33. package/dist/chunks/use-action-CWsg_YWU.js.map +1 -0
  34. package/dist/{server/_coffre/assets/use-change-C8BCf3oU.js → chunks/use-change-c6CeLRin.js} +10 -474
  35. package/dist/chunks/use-change-c6CeLRin.js.map +1 -0
  36. package/dist/chunks/use-shell-jxd7Tzd-.js +26 -0
  37. package/dist/chunks/use-shell-jxd7Tzd-.js.map +1 -0
  38. package/dist/{server/_coffre/assets → chunks}/validation-BQtqPe2V.js +2 -0
  39. package/dist/chunks/validation-BQtqPe2V.js.map +1 -0
  40. package/dist/index.d.ts +386 -18
  41. package/dist/index.js +1147 -0
  42. package/dist/index.js.map +1 -0
  43. package/dist/pages/account.d.ts +9 -0
  44. package/dist/pages/account.js +334 -0
  45. package/dist/pages/account.js.map +1 -0
  46. package/dist/pages/audit.d.ts +3 -0
  47. package/dist/{server/_coffre/assets/audit-qB9G2AQJ.js → pages/audit.js} +102 -100
  48. package/dist/pages/audit.js.map +1 -0
  49. package/dist/pages/device-login.d.ts +9 -0
  50. package/dist/pages/device-login.js +211 -0
  51. package/dist/pages/device-login.js.map +1 -0
  52. package/dist/pages/environment.d.ts +3 -0
  53. package/dist/{server/_coffre/assets/projects._project._environment-C6uybzeU.js → pages/environment.js} +323 -469
  54. package/dist/pages/environment.js.map +1 -0
  55. package/dist/pages/login.d.ts +10 -0
  56. package/dist/pages/login.js +104 -0
  57. package/dist/pages/login.js.map +1 -0
  58. package/dist/pages/project.d.ts +2 -0
  59. package/dist/{server/_coffre/assets/projects._project.index-3CXwkyTh.js → pages/project.js} +223 -225
  60. package/dist/pages/project.js.map +1 -0
  61. package/dist/pages/projects.d.ts +3 -0
  62. package/dist/{server/_coffre/assets/projects.index-iSoBpRFz.js → pages/projects.js} +83 -81
  63. package/dist/pages/projects.js.map +1 -0
  64. package/dist/pages/settings.d.ts +3 -0
  65. package/dist/{server/_coffre/assets/settings-BDQTF5XW.js → pages/settings.js} +20 -18
  66. package/dist/pages/settings.js.map +1 -0
  67. package/dist/pages/token.d.ts +3 -0
  68. package/dist/{server/_coffre/assets/tokens._token-CrBMpcbN.js → pages/token.js} +195 -265
  69. package/dist/pages/token.js.map +1 -0
  70. package/dist/pages/tokens.d.ts +3 -0
  71. package/dist/pages/tokens.js +39 -0
  72. package/dist/pages/tokens.js.map +1 -0
  73. package/dist/pages/unregistered.d.ts +8 -0
  74. package/dist/pages/unregistered.js +54 -0
  75. package/dist/pages/unregistered.js.map +1 -0
  76. package/dist/pages/user.d.ts +3 -0
  77. package/dist/pages/user.js +16 -0
  78. package/dist/pages/user.js.map +1 -0
  79. package/dist/pages/users.d.ts +3 -0
  80. package/dist/pages/users.js +39 -0
  81. package/dist/pages/users.js.map +1 -0
  82. package/dist/project-BqIy8gYR.d.ts +5 -0
  83. package/dist/vite.d.ts +16 -0
  84. package/dist/vite.js +52 -0
  85. package/package.json +36 -21
  86. package/src/assets/icon.svg +1 -0
  87. package/src/components/affordances.ts +10 -4
  88. package/src/components/command-palette.tsx +229 -203
  89. package/src/components/directory.tsx +34 -38
  90. package/src/components/principal.tsx +7 -3
  91. package/src/components/shell.tsx +89 -127
  92. package/src/components/theme.tsx +14 -81
  93. package/src/components/ui.tsx +97 -68
  94. package/src/index.ts +29 -0
  95. package/src/layout.tsx +113 -0
  96. package/src/lib/coffre.ts +8 -4
  97. package/src/lib/mounted.ts +13 -0
  98. package/src/lib/page-context.ts +31 -0
  99. package/src/lib/page-route.ts +22 -0
  100. package/src/lib/preferences.tsx +46 -0
  101. package/src/options.ts +240 -0
  102. package/src/{routes → pages}/account.tsx +7 -24
  103. package/src/{routes → pages}/audit.tsx +5 -16
  104. package/src/{routes/auth.device.tsx → pages/device-login.tsx} +8 -21
  105. package/src/{routes/projects.$project.$environment.tsx → pages/environment.tsx} +43 -52
  106. package/src/{routes → pages}/login.tsx +5 -16
  107. package/src/{routes/projects.$project.index.tsx → pages/project.tsx} +38 -50
  108. package/src/{routes/projects.index.tsx → pages/projects.tsx} +2 -7
  109. package/src/{routes → pages}/settings.tsx +3 -10
  110. package/src/{routes/tokens.$token.tsx → pages/token.tsx} +6 -7
  111. package/src/{routes/tokens.index.tsx → pages/tokens.tsx} +3 -8
  112. package/src/{routes → pages}/unregistered.tsx +1 -6
  113. package/src/pages/user.tsx +10 -0
  114. package/src/{routes/users.index.tsx → pages/users.tsx} +3 -8
  115. package/src/register.ts +55 -0
  116. package/src/router.tsx +31 -62
  117. package/src/styles/globals.css +104 -46
  118. package/src/vite.ts +78 -0
  119. package/dist/client/.assetsignore +0 -2
  120. package/dist/client/_coffre/assets/account-BoLGAxbD.js +0 -2
  121. package/dist/client/_coffre/assets/account-CnnuRTDB.js +0 -1
  122. package/dist/client/_coffre/assets/affordances-CEafRJcN.js +0 -1
  123. package/dist/client/_coffre/assets/audit-CHSvKLWX.js +0 -1
  124. package/dist/client/_coffre/assets/audit-Cn4hmS4u.js +0 -2
  125. package/dist/client/_coffre/assets/auth.device-Co5vrpaA.js +0 -2
  126. package/dist/client/_coffre/assets/auth.device-DAlqWacc.js +0 -1
  127. package/dist/client/_coffre/assets/directory-H8Eh3MnS.js +0 -1
  128. package/dist/client/_coffre/assets/dist-Braunv_x.js +0 -1
  129. package/dist/client/_coffre/assets/globals-CpMrgkV6.css +0 -1
  130. package/dist/client/_coffre/assets/grants-DPDxJXU1.js +0 -1
  131. package/dist/client/_coffre/assets/icons-Dc_-t0lp.js +0 -1
  132. package/dist/client/_coffre/assets/index-sUCIXRgJ.js +0 -12
  133. package/dist/client/_coffre/assets/inter-cyrillic-ext-opsz-normal-CfYZpDVp.woff2 +0 -0
  134. package/dist/client/_coffre/assets/inter-cyrillic-opsz-normal-BFQXbQ-f.woff2 +0 -0
  135. package/dist/client/_coffre/assets/inter-greek-ext-opsz-normal-BmPQvyvo.woff2 +0 -0
  136. package/dist/client/_coffre/assets/inter-greek-opsz-normal-BM0NlUE_.woff2 +0 -0
  137. package/dist/client/_coffre/assets/inter-latin-ext-opsz-normal-DpK-iCPk.woff2 +0 -0
  138. package/dist/client/_coffre/assets/inter-latin-opsz-normal-BwkfbSeq.woff2 +0 -0
  139. package/dist/client/_coffre/assets/inter-vietnamese-opsz-normal-Ci9T9ieq.woff2 +0 -0
  140. package/dist/client/_coffre/assets/jetbrains-mono-cyrillic-ext-wght-normal-EocZY2iu.woff2 +0 -0
  141. package/dist/client/_coffre/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
  142. package/dist/client/_coffre/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
  143. package/dist/client/_coffre/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
  144. package/dist/client/_coffre/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
  145. package/dist/client/_coffre/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
  146. package/dist/client/_coffre/assets/link-DBINMwm6.js +0 -1
  147. package/dist/client/_coffre/assets/login-BZFYfL1Y.js +0 -1
  148. package/dist/client/_coffre/assets/login-CYCKWTOD.js +0 -2
  149. package/dist/client/_coffre/assets/offboarding-Bwpftp3g.js +0 -1
  150. package/dist/client/_coffre/assets/page-C_hnzdaR.js +0 -1
  151. package/dist/client/_coffre/assets/preload-helper-CLkO85Nq.js +0 -1
  152. package/dist/client/_coffre/assets/principal-page-DLho8TSJ.js +0 -1
  153. package/dist/client/_coffre/assets/project-environments-CfIH5kFM.js +0 -1
  154. package/dist/client/_coffre/assets/projects._project._environment-DHRRvQw0.js +0 -3
  155. package/dist/client/_coffre/assets/projects._project._environment-TLI-RjBZ.js +0 -2
  156. package/dist/client/_coffre/assets/projects._project.index-BO-8FZIY.js +0 -2
  157. package/dist/client/_coffre/assets/projects._project.index-DGl921dP.js +0 -1
  158. package/dist/client/_coffre/assets/projects.index-BDn7Bhoo.js +0 -1
  159. package/dist/client/_coffre/assets/row-state-DJ-KLamZ.js +0 -1
  160. package/dist/client/_coffre/assets/settings-q9G1QvR_.js +0 -1
  161. package/dist/client/_coffre/assets/signin-errors-CroZWZgm.js +0 -1
  162. package/dist/client/_coffre/assets/suspense-O8sP0mEC.js +0 -1
  163. package/dist/client/_coffre/assets/tokens._token-B_qczpT9.js +0 -2
  164. package/dist/client/_coffre/assets/tokens._token-T-sqwMbz.js +0 -2
  165. package/dist/client/_coffre/assets/tokens.index-CcXSZnAG.js +0 -1
  166. package/dist/client/_coffre/assets/ui-BXP2IqrW.js +0 -46
  167. package/dist/client/_coffre/assets/unregistered-D2JXJ90x.js +0 -1
  168. package/dist/client/_coffre/assets/use-action-BpzKWhgg.js +0 -1
  169. package/dist/client/_coffre/assets/use-change-CKj3Inq9.js +0 -1
  170. package/dist/client/_coffre/assets/use-shell-W0SusPkz.js +0 -1
  171. package/dist/client/_coffre/assets/useQuery-B-lxFSES.js +0 -1
  172. package/dist/client/_coffre/assets/useSuspenseQuery-BZ-nzHST.js +0 -1
  173. package/dist/client/_coffre/assets/users._user-Bb3BGYHl.js +0 -1
  174. package/dist/client/_coffre/assets/users._user-DXmvKrzE.js +0 -2
  175. package/dist/client/_coffre/assets/users.index-BvzP3qwW.js +0 -1
  176. package/dist/client/_coffre/assets/validation-9Cl_XS-l.js +0 -1
  177. package/dist/server/.vite/manifest.json +0 -668
  178. package/dist/server/_coffre/assets/_tanstack-start-manifest_v-GsKnGGRy.js +0 -162
  179. package/dist/server/_coffre/assets/account-CV-a2IU2.js +0 -329
  180. package/dist/server/_coffre/assets/account-hk6wcIXU.js +0 -162
  181. package/dist/server/_coffre/assets/async-local-storage-C10uQtMM.js +0 -3108
  182. package/dist/server/_coffre/assets/audit-C1_Ej6YB.js +0 -31
  183. package/dist/server/_coffre/assets/auth.device-6JRrWbSV.js +0 -210
  184. package/dist/server/_coffre/assets/auth.device-CLoAxC2T.js +0 -29
  185. package/dist/server/_coffre/assets/directory-B-_rqsPx.js +0 -371
  186. package/dist/server/_coffre/assets/dist-CnnV3t2g.js +0 -908
  187. package/dist/server/_coffre/assets/empty-plugin-adapters-Cq4--YW-.js +0 -5
  188. package/dist/server/_coffre/assets/globals-CpMrgkV6.css +0 -1
  189. package/dist/server/_coffre/assets/icons-DOFT-eWB.js +0 -1704
  190. package/dist/server/_coffre/assets/inter-cyrillic-ext-opsz-normal-CfYZpDVp.woff2 +0 -0
  191. package/dist/server/_coffre/assets/inter-cyrillic-opsz-normal-BFQXbQ-f.woff2 +0 -0
  192. package/dist/server/_coffre/assets/inter-greek-ext-opsz-normal-BmPQvyvo.woff2 +0 -0
  193. package/dist/server/_coffre/assets/inter-greek-opsz-normal-BM0NlUE_.woff2 +0 -0
  194. package/dist/server/_coffre/assets/inter-latin-ext-opsz-normal-DpK-iCPk.woff2 +0 -0
  195. package/dist/server/_coffre/assets/inter-latin-opsz-normal-BwkfbSeq.woff2 +0 -0
  196. package/dist/server/_coffre/assets/inter-vietnamese-opsz-normal-Ci9T9ieq.woff2 +0 -0
  197. package/dist/server/_coffre/assets/jetbrains-mono-cyrillic-ext-wght-normal-EocZY2iu.woff2 +0 -0
  198. package/dist/server/_coffre/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
  199. package/dist/server/_coffre/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
  200. package/dist/server/_coffre/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
  201. package/dist/server/_coffre/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
  202. package/dist/server/_coffre/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
  203. package/dist/server/_coffre/assets/lazyRouteComponent-CqBNCGuZ.js +0 -480
  204. package/dist/server/_coffre/assets/link-42ZWdjzZ.js +0 -422
  205. package/dist/server/_coffre/assets/login-DRKUKkaW.js +0 -22
  206. package/dist/server/_coffre/assets/login-DnwxVl4Y.js +0 -102
  207. package/dist/server/_coffre/assets/matchContext-qLfYbC6_.js +0 -56
  208. package/dist/server/_coffre/assets/page-D6n45dcK.js +0 -3561
  209. package/dist/server/_coffre/assets/projects._project._environment-CS8DdSMY.js +0 -48
  210. package/dist/server/_coffre/assets/projects._project.index-BGfcNpj0.js +0 -23
  211. package/dist/server/_coffre/assets/react-dom-bBoJXlK2.js +0 -1718
  212. package/dist/server/_coffre/assets/router-9BTgJhWG.js +0 -2322
  213. package/dist/server/_coffre/assets/start-DR3rN0St.js +0 -4
  214. package/dist/server/_coffre/assets/suspense-C-2QfDd2.js +0 -602
  215. package/dist/server/_coffre/assets/tokens._token-rY86Cjgp.js +0 -10
  216. package/dist/server/_coffre/assets/tokens.index-Bq5qDW9q.js +0 -37
  217. package/dist/server/_coffre/assets/ui-Cc0CGMtr.js +0 -14881
  218. package/dist/server/_coffre/assets/unregistered-D9ZKLOPJ.js +0 -53
  219. package/dist/server/_coffre/assets/use-shell-DwOzEi87.js +0 -462
  220. package/dist/server/_coffre/assets/useQuery-CTe86qFq.js +0 -8
  221. package/dist/server/_coffre/assets/useRouter-CaUSUNsw.js +0 -473
  222. package/dist/server/_coffre/assets/useSuspenseQuery-CSoHzrMb.js +0 -117
  223. package/dist/server/_coffre/assets/users._user-BmLKYeo_.js +0 -10
  224. package/dist/server/_coffre/assets/users._user-BmiHwQx3.js +0 -14
  225. package/dist/server/_coffre/assets/users.index-BiEax90r.js +0 -37
  226. package/dist/server/index.js +0 -13911
  227. package/src/assets/favicon-32.png +0 -0
  228. package/src/components/agentation.tsx +0 -34
  229. package/src/entry.ts +0 -19
  230. package/src/routeTree.gen.ts +0 -367
  231. package/src/routes/__root.tsx +0 -169
  232. package/src/routes/access.tsx +0 -11
  233. package/src/routes/index.tsx +0 -15
  234. package/src/routes/users.$user.tsx +0 -13
  235. package/src/types.ts +0 -21
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-shell-jxd7Tzd-.js","names":[],"sources":["../../src/lib/use-shell.ts"],"sourcesContent":["import { useSuspenseQueries } from '@tanstack/react-query';\nimport { useMemo } from 'react';\n\nimport { useCoffre } from './coffre';\nimport { queries, shellOf, type Shell } from './queries';\n\n/**\n * The shell as a component reads it: from the same queries the root loader\n * fetched, so it follows any change that refetches them.\n */\nexport function useShell(): Shell {\n const client = useCoffre();\n const [auth, me, projects] = useSuspenseQueries({\n queries: [queries.auth(client), queries.me(client), queries.projects(client)],\n });\n return useMemo(() => shellOf(auth.data, me.data, projects.data), [auth.data, me.data, projects.data]);\n}\n"],"mappings":";;;;;;;;;AAUA,SAAgB,WAAkB;CAChC,MAAM,SAAS,UAAU;CACzB,MAAM,CAAC,MAAM,IAAI,YAAY,mBAAmB,EAC9C,SAAS;EAAC,QAAQ,KAAK,MAAM;EAAG,QAAQ,GAAG,MAAM;EAAG,QAAQ,SAAS,MAAM;CAAC,EAC9E,CAAC;CACD,OAAO,cAAc,QAAQ,KAAK,MAAM,GAAG,MAAM,SAAS,IAAI,GAAG;EAAC,KAAK;EAAM,GAAG;EAAM,SAAS;CAAI,CAAC;AACtG"}
@@ -25,3 +25,5 @@ function secretKeyProblem(value) {
25
25
  }
26
26
  //#endregion
27
27
  export { slugProblem as n, secretKeyProblem as t };
28
+
29
+ //# sourceMappingURL=validation-BQtqPe2V.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation-BQtqPe2V.js","names":[],"sources":["../../src/lib/validation.ts"],"sourcesContent":["/**\n * Client-side hints for the two identifier shapes people type.\n *\n * The server validates with the zod schemas in `@coffre/core/schemas` and stays\n * the authority; these only let a form say what is wrong before a round trip.\n * They are plain patterns rather than imports of those schemas so the browser\n * bundle does not carry zod, and `test/validation.test.ts` holds the two in\n * agreement.\n */\n\nconst SLUG = /^[a-z0-9][a-z0-9-]{0,62}$/;\nconst SECRET_KEY = /^[A-Za-z_][A-Za-z0-9_]{0,127}$/;\n\nexport function slugProblem(value: string): string | null {\n if (SLUG.test(value)) return null;\n if (value.length > 63) return 'At most 63 characters.';\n if (/[A-Z]/.test(value)) return 'Lowercase only.';\n if (value.startsWith('-')) return 'Start with a letter or digit.';\n return 'Lowercase letters, digits and dashes only.';\n}\n\nexport function secretKeyProblem(value: string): string | null {\n if (SECRET_KEY.test(value)) return null;\n if (value.length > 128) return 'At most 128 characters.';\n if (/^[0-9]/.test(value)) return 'Cannot start with a digit.';\n return 'Letters, digits and underscores only.';\n}\n"],"mappings":";;;;;;;;;;AAUA,IAAM,OAAO;AACb,IAAM,aAAa;AAEnB,SAAgB,YAAY,OAA8B;CACxD,IAAI,KAAK,KAAK,KAAK,GAAG,OAAO;CAC7B,IAAI,MAAM,SAAS,IAAI,OAAO;CAC9B,IAAI,QAAQ,KAAK,KAAK,GAAG,OAAO;CAChC,IAAI,MAAM,WAAW,GAAG,GAAG,OAAO;CAClC,OAAO;AACT;AAEA,SAAgB,iBAAiB,OAA8B;CAC7D,IAAI,WAAW,KAAK,KAAK,GAAG,OAAO;CACnC,IAAI,MAAM,SAAS,KAAK,OAAO;CAC/B,IAAI,SAAS,KAAK,KAAK,GAAG,OAAO;CACjC,OAAO;AACT"}
package/dist/index.d.ts CHANGED
@@ -1,19 +1,387 @@
1
- import { CoffreClient } from "@coffre/client";
2
- //#region src/types.d.ts
3
- /** What each page request needs from the server around it. */
4
- export type UiContext = {
5
- /** This response's Content-Security-Policy nonce, put on every script the page renders. */
6
- cspNonce: string;
7
- /** The API as the visitor, which every loader reads through; see `@coffre/server`. */
8
- client: CoffreClient;
9
- };
10
- /** coffre's pages: HTML for a GET or HEAD, with no API, database or configuration of its own. */
11
- export type Ui = {
12
- fetch(request: Request, init: {
13
- context: UiContext;
14
- }): Promise<Response>;
15
- };
16
- /** The pages' handler. Its static files are in `dist/client`, served under `/_coffre/`. */
17
- export declare function createUi(): Ui;
1
+ import { n as ProjectTab } from "./project-BqIy8gYR.js";
2
+ import { ReactNode } from "react";
3
+ import { CoffreClient, Member } from "@coffre/client";
4
+ import { AnyRoute, ParsedLocation } from "@tanstack/react-router";
5
+ import "@coffre/core/pages";
6
+ import "@coffre/core/access";
7
+ import { QueryClient } from "@tanstack/react-query";
8
+ //#region src/layout.d.ts
9
+ /**
10
+ * What coffre's pages need around them, for the deployment's document to put
11
+ * in its body: `<body><CoffreProvider>{children}</CoffreProvider><Scripts /></body>`.
12
+ * coffre's element, drawn in the visitor's theme, its sidebar folded or not,
13
+ * as their cookies say, from the first byte: the server and the browser
14
+ * both render it from them, so nothing waits for a script. Tooltips, toasts
15
+ * and the live region, which the deployment's own pages may use too. The
16
+ * query client comes with the router (`createRouter`).
17
+ */
18
+ export declare function CoffreProvider({ children }: {
19
+ children: ReactNode;
20
+ }): import("react").JSX.Element;
21
+ /** coffre's shell: the nav, around the signed-in pages. */
22
+ declare function ShellLayout(): import("react").JSX.Element;
23
+ /** The sign-in pages' frame: coffre's mark and the theme, nothing else. */
24
+ declare function SoloLayout(): import("react").JSX.Element;
18
25
  //#endregion
19
- export type { CoffreClient };
26
+ //#region src/lib/coffre.d.ts
27
+ /**
28
+ * The API as whoever is looking at the page, with their permissions: what
29
+ * coffre's pages call, and a deployment's own may too. In the browser this
30
+ * is plain `fetch` to `/api`, carrying the session cookie; on the server,
31
+ * the API in process. Components call it from event handlers; loaders read
32
+ * the same client as `context.coffre`.
33
+ */
34
+ export declare function useCoffre(): CoffreClient;
35
+ //#endregion
36
+ //#region ../../node_modules/.pnpm/@tanstack+history@1.162.0/node_modules/@tanstack/history/dist/esm/index.d.ts
37
+ interface NavigateOptions {
38
+ ignoreBlocker?: boolean;
39
+ }
40
+ type SubscriberHistoryAction = {
41
+ type: Exclude<HistoryAction, 'GO'>;
42
+ } | {
43
+ type: 'GO';
44
+ index: number;
45
+ };
46
+ type SubscriberArgs = {
47
+ location: HistoryLocation;
48
+ action: SubscriberHistoryAction;
49
+ };
50
+ interface RouterHistory {
51
+ location: HistoryLocation;
52
+ length: number;
53
+ subscribers: Set<(opts: SubscriberArgs) => void>;
54
+ subscribe: (cb: (opts: SubscriberArgs) => void) => () => void;
55
+ push: (path: string, state?: any, navigateOpts?: NavigateOptions) => void;
56
+ replace: (path: string, state?: any, navigateOpts?: NavigateOptions) => void;
57
+ go: (index: number, navigateOpts?: NavigateOptions) => void;
58
+ back: (navigateOpts?: NavigateOptions) => void;
59
+ forward: (navigateOpts?: NavigateOptions) => void;
60
+ canGoBack: () => boolean;
61
+ createHref: (href: string) => string;
62
+ block: (blocker: NavigationBlocker) => () => void;
63
+ flush: () => void;
64
+ destroy: () => void;
65
+ notify: (action: SubscriberHistoryAction) => void;
66
+ _ignoreSubscribers?: boolean;
67
+ }
68
+ interface HistoryLocation extends ParsedPath {
69
+ state: ParsedHistoryState;
70
+ }
71
+ interface ParsedPath {
72
+ href: string;
73
+ pathname: string;
74
+ search: string;
75
+ hash: string;
76
+ }
77
+ interface HistoryState {}
78
+ type ParsedHistoryState = HistoryState & {
79
+ key?: string;
80
+ __TSR_key?: string;
81
+ __TSR_index: number;
82
+ };
83
+ type ShouldAllowNavigation = any;
84
+ type HistoryAction = 'PUSH' | 'REPLACE' | 'FORWARD' | 'BACK' | 'GO';
85
+ type BlockerFnArgs = {
86
+ currentLocation: HistoryLocation;
87
+ nextLocation: HistoryLocation;
88
+ action: HistoryAction;
89
+ };
90
+ type BlockerFn = (args: BlockerFnArgs) => Promise<ShouldAllowNavigation> | ShouldAllowNavigation;
91
+ type NavigationBlocker = {
92
+ blockerFn: BlockerFn;
93
+ enableBeforeUnload?: (() => boolean) | boolean;
94
+ };
95
+ //#endregion
96
+ //#region src/shared/models.d.ts
97
+ type DirectoryPrincipal = Pick<Member, 'principalType' | 'principalId' | 'instanceRole' | 'isRootAdmin'> & Partial<Pick<Member, 'tampered'>>;
98
+ //#endregion
99
+ //#region src/lib/queries.d.ts
100
+ type AuditSearch = {
101
+ decision?: 'deny';
102
+ actorId?: string;
103
+ detail?: '1';
104
+ };
105
+ //#endregion
106
+ //#region src/options.d.ts
107
+ /**
108
+ * What coffre's routes read through the router: the API as the visitor
109
+ * (`coffre`), and the query cache the pages share. The deployment's root is
110
+ * created with it, `createRootRouteWithContext<CoffreContext>()`, and
111
+ * coffre's `createRouter` provides it.
112
+ */
113
+ type CoffreContext = {
114
+ coffre: CoffreClient;
115
+ queryClient: QueryClient;
116
+ };
117
+ type Loader<TParams = object> = {
118
+ context: unknown;
119
+ params: TParams;
120
+ location: ParsedLocation;
121
+ };
122
+ /** coffre's nav, around the signed-in pages: someone not signed in, or not yet registered, is sent to the page for it. */
123
+ export declare const shell: {
124
+ loader: ({ context, location }: Loader) => Promise<void>;
125
+ component: typeof ShellLayout;
126
+ };
127
+ /** The bare frame of the sign-in pages. Each sends on whoever does not belong there. */
128
+ export declare const solo: {
129
+ component: typeof SoloLayout;
130
+ };
131
+ /** `/`, which sends to the projects. */
132
+ export declare const home: {
133
+ beforeLoad: () => never;
134
+ };
135
+ /** `/projects`. */
136
+ export declare const projects: {
137
+ loader: ({ context }: Loader) => Promise<{
138
+ ok: false;
139
+ error: string;
140
+ signedOut: boolean;
141
+ } | ({
142
+ ok: true;
143
+ } & {
144
+ projects: {
145
+ slug: string;
146
+ name: string;
147
+ archivedAt: string | null;
148
+ permissions: ("audit.read" | "environment.manage" | "grant.manage" | "project.manage" | "secret.archive" | "secret.read" | "secret.write")[];
149
+ environments: {
150
+ slug: string;
151
+ name: string;
152
+ accessible: boolean;
153
+ details: null | {
154
+ archivedAt: string | null;
155
+ secretCount: number | null;
156
+ };
157
+ }[];
158
+ secretCount: number | null;
159
+ }[];
160
+ })>;
161
+ };
162
+ /** `/projects/$project`. */
163
+ declare const project$1: {
164
+ validateSearch: (search: Record<string, unknown>) => {
165
+ tab?: Exclude<ProjectTab, "environments">;
166
+ };
167
+ loader: ({ context, params }: Loader<{
168
+ project: string;
169
+ }>) => Promise<void>;
170
+ };
171
+ /** `/projects/$project/$environment`. */
172
+ declare const environment$1: {
173
+ validateSearch: (search: Record<string, unknown>) => {
174
+ filter?: string;
175
+ };
176
+ loader: ({ context, params }: Loader<{
177
+ project: string;
178
+ environment: string;
179
+ }>) => Promise<{
180
+ ok: false;
181
+ error: string;
182
+ signedOut: boolean;
183
+ } | ({
184
+ ok: true;
185
+ } & {
186
+ permissions: ("audit.read" | "environment.manage" | "grant.manage" | "project.manage" | "secret.archive" | "secret.read" | "secret.write")[];
187
+ keys: {
188
+ key: string;
189
+ archived: boolean;
190
+ version: number | null;
191
+ updatedAt: string | null;
192
+ updatedBy: string | null;
193
+ }[];
194
+ })>;
195
+ };
196
+ /** `/audit`. */
197
+ export declare const audit: {
198
+ validateSearch: (search: Record<string, unknown>) => AuditSearch;
199
+ loaderDeps: ({ search }: {
200
+ search: AuditSearch;
201
+ }) => AuditSearch;
202
+ loader: ({ context, deps }: Loader & {
203
+ deps: AuditSearch;
204
+ }) => Promise<{
205
+ ok: false;
206
+ error: string;
207
+ signedOut: boolean;
208
+ } | ({
209
+ ok: true;
210
+ } & {
211
+ entries: {
212
+ seq: number;
213
+ author: "app" | "vault";
214
+ occurredAt: string;
215
+ actorType: "service" | "system" | "user";
216
+ actorId: string;
217
+ action: string;
218
+ decision: "allow" | "deny";
219
+ reason: string | null;
220
+ detail: boolean;
221
+ subject: string | null;
222
+ project: string | null;
223
+ environment: string | null;
224
+ key: string | null;
225
+ version: number | null;
226
+ operationId: string | null;
227
+ relatedSeq: number | null;
228
+ requestId: string | null;
229
+ run: null | {
230
+ exchangeSeq: number;
231
+ claims: {
232
+ [key: string]: string | number;
233
+ };
234
+ };
235
+ metadata: {
236
+ [key: string]: unknown;
237
+ };
238
+ }[];
239
+ hidden?: {
240
+ action: string;
241
+ count: number;
242
+ }[];
243
+ })>;
244
+ };
245
+ /** `/access`: the access page became the users page, and old links land there. */
246
+ export declare const access: {
247
+ beforeLoad: () => never;
248
+ };
249
+ /** `/users`. */
250
+ export declare const users: {
251
+ loader: ({ context }: Loader) => Promise<{
252
+ ok: false;
253
+ error: string;
254
+ signedOut: boolean;
255
+ } | ({
256
+ ok: true;
257
+ } & {
258
+ principals: DirectoryPrincipal[];
259
+ removed: {
260
+ principalType: "service" | "user";
261
+ principalId: string;
262
+ toRotate: number;
263
+ }[];
264
+ })>;
265
+ };
266
+ /** `/users/$user`. */
267
+ export declare const user: {
268
+ loader: ({ context, params }: Loader<{
269
+ user: string;
270
+ }>) => Promise<void>;
271
+ };
272
+ /** `/tokens`. */
273
+ export declare const tokens: {
274
+ loader: ({ context }: Loader) => Promise<{
275
+ ok: false;
276
+ error: string;
277
+ signedOut: boolean;
278
+ } | ({
279
+ ok: true;
280
+ } & {
281
+ principals: DirectoryPrincipal[];
282
+ removed: {
283
+ principalType: "service" | "user";
284
+ principalId: string;
285
+ toRotate: number;
286
+ }[];
287
+ })>;
288
+ };
289
+ /** `/tokens/$token`. */
290
+ export declare const token: {
291
+ loader: ({ context, params }: Loader<{
292
+ token: string;
293
+ }>) => Promise<void>;
294
+ };
295
+ /** `/settings`. */
296
+ export declare const settings: {
297
+ loader: ({ context }: Loader) => Promise<{
298
+ ok: false;
299
+ error: string;
300
+ signedOut: boolean;
301
+ } | ({
302
+ ok: true;
303
+ } & {
304
+ principals: DirectoryPrincipal[];
305
+ removed: {
306
+ principalType: "service" | "user";
307
+ principalId: string;
308
+ toRotate: number;
309
+ }[];
310
+ })>;
311
+ };
312
+ type AccountSearch = {
313
+ linked?: string;
314
+ error?: string;
315
+ };
316
+ /** `/account`. */
317
+ export declare const account: {
318
+ validateSearch: (search: Record<string, unknown>) => AccountSearch;
319
+ loader: ({ context }: Loader) => Promise<void>;
320
+ };
321
+ /** `/login`. */
322
+ export declare const login: {
323
+ validateSearch: (search: Record<string, unknown>) => {
324
+ next?: string;
325
+ error?: string;
326
+ };
327
+ loader: ({ context }: Loader) => Promise<void>;
328
+ };
329
+ /** `/unregistered`. */
330
+ export declare const unregistered: {
331
+ loader: ({ context, location }: Loader) => Promise<void>;
332
+ };
333
+ /** `/auth/device`. */
334
+ export declare const deviceLogin: {
335
+ validateSearch: (search: Record<string, unknown>) => {
336
+ code?: string;
337
+ };
338
+ loaderDeps: ({ search }: {
339
+ search: {
340
+ code?: string;
341
+ };
342
+ }) => {
343
+ code: string | undefined;
344
+ };
345
+ loader: ({ context, deps, location }: Loader & {
346
+ deps: {
347
+ code?: string;
348
+ };
349
+ }) => Promise<{
350
+ ok: false;
351
+ error: string;
352
+ signedOut: boolean;
353
+ } | ({
354
+ ok: true;
355
+ } & {
356
+ request: null | {
357
+ userCode: string;
358
+ clientLabel: string | null;
359
+ clientIp: string | null;
360
+ createdAt: string;
361
+ expiresAt: string;
362
+ };
363
+ sessionDays: number;
364
+ }) | {
365
+ ok: false;
366
+ error: string;
367
+ } | null>;
368
+ };
369
+ //#endregion
370
+ //#region src/router.d.ts
371
+ /**
372
+ * The deployment's router, around its route tree, which holds coffre's
373
+ * routes: `export const getRouter = () => createRouter(routeTree)`. It gives
374
+ * the routes coffre's context (`CoffreContext`). TanStack
375
+ * Start calls it once per request on the server and once on the client, so
376
+ * each gets a query cache of its own: a request's reads are never another
377
+ * visitor's. The server's reads travel with the page, so the browser starts
378
+ * from them rather than asking again.
379
+ *
380
+ * Loaders read through the query cache (`lib/queries.ts`, which says how
381
+ * fresh it keeps a page), so the router keeps no copy of its own: it runs a
382
+ * route's loader on every navigation and every hover, and the cache answers
383
+ * whatever it already holds. A hover is then a read the click reuses.
384
+ */
385
+ export declare function createRouter<TRouteTree extends AnyRoute>(routeTree: TRouteTree): import("@tanstack/router-core").RouterCore<TRouteTree, "never", false, RouterHistory, Record<string, any>>;
386
+ //#endregion
387
+ export { type CoffreContext, environment$1 as environment, project$1 as project };