@xtandard/audit 0.0.0-stage → 0.1.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 (423) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +384 -2
  3. package/bin/xtandard-audit.mjs +3 -0
  4. package/dist/basic-DU_nPrWV.mjs +176 -0
  5. package/dist/basic-DU_nPrWV.mjs.map +1 -0
  6. package/dist/basic-hcXnMF9X.cjs +199 -0
  7. package/dist/basic-hcXnMF9X.cjs.map +1 -0
  8. package/dist/canonical-BOgkrX9_.d.cts +17 -0
  9. package/dist/canonical-CL7gfwhb.d.mts +17 -0
  10. package/dist/chunk-D7D4PA-g.mjs +13 -0
  11. package/dist/cli.cjs +773 -0
  12. package/dist/cli.cjs.map +1 -0
  13. package/dist/cli.d.cts +46 -0
  14. package/dist/cli.d.mts +46 -0
  15. package/dist/cli.mjs +762 -0
  16. package/dist/cli.mjs.map +1 -0
  17. package/dist/context-BtR9k9Mt.d.mts +52 -0
  18. package/dist/context-CJM87uG8.d.cts +52 -0
  19. package/dist/context-shared-AgBWIRUQ.d.mts +29 -0
  20. package/dist/context-shared-CUq3cSpV.d.cts +29 -0
  21. package/dist/context-shared-CupikwQo.mjs +39 -0
  22. package/dist/context-shared-CupikwQo.mjs.map +1 -0
  23. package/dist/context-shared-X2ulHHSB.cjs +44 -0
  24. package/dist/context-shared-X2ulHHSB.cjs.map +1 -0
  25. package/dist/context.cjs +82 -0
  26. package/dist/context.cjs.map +1 -0
  27. package/dist/context.d.cts +2 -0
  28. package/dist/context.d.mts +2 -0
  29. package/dist/context.mjs +78 -0
  30. package/dist/context.mjs.map +1 -0
  31. package/dist/contract-BljSE-Hx.mjs +33 -0
  32. package/dist/contract-BljSE-Hx.mjs.map +1 -0
  33. package/dist/contract-BmwHIiMR.d.mts +150 -0
  34. package/dist/contract-CWJSYoJl.d.cts +150 -0
  35. package/dist/contract-Cht05WYQ.d.mts +159 -0
  36. package/dist/contract-CqYQzB6e.d.cts +49 -0
  37. package/dist/contract-DYvBNdnR.cjs +74 -0
  38. package/dist/contract-DYvBNdnR.cjs.map +1 -0
  39. package/dist/contract-DlTo4u2t.d.cts +30 -0
  40. package/dist/contract-DlTo4u2t.d.mts +30 -0
  41. package/dist/contract-DsVL5-gy.cjs +50 -0
  42. package/dist/contract-DsVL5-gy.cjs.map +1 -0
  43. package/dist/contract-isM9SjjQ.mjs +39 -0
  44. package/dist/contract-isM9SjjQ.mjs.map +1 -0
  45. package/dist/contract-pU3wGFmo.d.cts +159 -0
  46. package/dist/contract-yPNuFnVy.d.mts +49 -0
  47. package/dist/core-C0ceVOTk.d.cts +513 -0
  48. package/dist/core-CTr7dw0v.cjs +1725 -0
  49. package/dist/core-CTr7dw0v.cjs.map +1 -0
  50. package/dist/core-IdGEbYdM.mjs +1541 -0
  51. package/dist/core-IdGEbYdM.mjs.map +1 -0
  52. package/dist/core-KtEHRScZ.d.mts +513 -0
  53. package/dist/core.cjs +9 -0
  54. package/dist/core.d.cts +2 -0
  55. package/dist/core.d.mts +2 -0
  56. package/dist/core.mjs +2 -0
  57. package/dist/create-fetch-handler-1pXSEhGi.d.cts +311 -0
  58. package/dist/create-fetch-handler-BwQQ_IWf.mjs +2156 -0
  59. package/dist/create-fetch-handler-BwQQ_IWf.mjs.map +1 -0
  60. package/dist/create-fetch-handler-D8cTMVX9.cjs +2232 -0
  61. package/dist/create-fetch-handler-D8cTMVX9.cjs.map +1 -0
  62. package/dist/create-fetch-handler-zioPVS18.d.mts +311 -0
  63. package/dist/elysia-shared-C7geKqPP.mjs +55 -0
  64. package/dist/elysia-shared-C7geKqPP.mjs.map +1 -0
  65. package/dist/elysia-shared-DT4bfekR.d.cts +20 -0
  66. package/dist/elysia-shared-DXyAyGz_.cjs +66 -0
  67. package/dist/elysia-shared-DXyAyGz_.cjs.map +1 -0
  68. package/dist/elysia-shared-DoL5ab52.d.mts +20 -0
  69. package/dist/entry-auth-basic.cjs +5 -0
  70. package/dist/entry-auth-basic.d.cts +83 -0
  71. package/dist/entry-auth-basic.d.mts +83 -0
  72. package/dist/entry-auth-basic.mjs +2 -0
  73. package/dist/entry-auth-delegated.cjs +28 -0
  74. package/dist/entry-auth-delegated.cjs.map +1 -0
  75. package/dist/entry-auth-delegated.d.cts +36 -0
  76. package/dist/entry-auth-delegated.d.mts +36 -0
  77. package/dist/entry-auth-delegated.mjs +27 -0
  78. package/dist/entry-auth-delegated.mjs.map +1 -0
  79. package/dist/entry-auth-none.cjs +4 -0
  80. package/dist/entry-auth-none.d.cts +25 -0
  81. package/dist/entry-auth-none.d.mts +25 -0
  82. package/dist/entry-auth-none.mjs +2 -0
  83. package/dist/entry-authorization-delegated.cjs +28 -0
  84. package/dist/entry-authorization-delegated.cjs.map +1 -0
  85. package/dist/entry-authorization-delegated.d.cts +32 -0
  86. package/dist/entry-authorization-delegated.d.mts +32 -0
  87. package/dist/entry-authorization-delegated.mjs +27 -0
  88. package/dist/entry-authorization-delegated.mjs.map +1 -0
  89. package/dist/entry-authorization-none.cjs +3 -0
  90. package/dist/entry-authorization-none.d.cts +18 -0
  91. package/dist/entry-authorization-none.d.mts +18 -0
  92. package/dist/entry-authorization-none.mjs +2 -0
  93. package/dist/entry-authorization-roles.cjs +8 -0
  94. package/dist/entry-authorization-roles.d.cts +64 -0
  95. package/dist/entry-authorization-roles.d.mts +64 -0
  96. package/dist/entry-authorization-roles.mjs +3 -0
  97. package/dist/entry-bun.cjs +55 -0
  98. package/dist/entry-bun.cjs.map +1 -0
  99. package/dist/entry-bun.d.cts +29 -0
  100. package/dist/entry-bun.d.mts +29 -0
  101. package/dist/entry-bun.mjs +52 -0
  102. package/dist/entry-bun.mjs.map +1 -0
  103. package/dist/entry-drizzle-audit.cjs +191 -0
  104. package/dist/entry-drizzle-audit.cjs.map +1 -0
  105. package/dist/entry-drizzle-audit.d.cts +118 -0
  106. package/dist/entry-drizzle-audit.d.mts +118 -0
  107. package/dist/entry-drizzle-audit.mjs +186 -0
  108. package/dist/entry-drizzle-audit.mjs.map +1 -0
  109. package/dist/entry-drizzle-mysql.cjs +75 -0
  110. package/dist/entry-drizzle-mysql.cjs.map +1 -0
  111. package/dist/entry-drizzle-mysql.d.cts +42 -0
  112. package/dist/entry-drizzle-mysql.d.mts +42 -0
  113. package/dist/entry-drizzle-mysql.mjs +71 -0
  114. package/dist/entry-drizzle-mysql.mjs.map +1 -0
  115. package/dist/entry-drizzle-pg.cjs +82 -0
  116. package/dist/entry-drizzle-pg.cjs.map +1 -0
  117. package/dist/entry-drizzle-pg.d.cts +48 -0
  118. package/dist/entry-drizzle-pg.d.mts +48 -0
  119. package/dist/entry-drizzle-pg.mjs +78 -0
  120. package/dist/entry-drizzle-pg.mjs.map +1 -0
  121. package/dist/entry-drizzle-sqlite.cjs +71 -0
  122. package/dist/entry-drizzle-sqlite.cjs.map +1 -0
  123. package/dist/entry-drizzle-sqlite.d.cts +37 -0
  124. package/dist/entry-drizzle-sqlite.d.mts +37 -0
  125. package/dist/entry-drizzle-sqlite.mjs +67 -0
  126. package/dist/entry-drizzle-sqlite.mjs.map +1 -0
  127. package/dist/entry-elysia.cjs +112 -0
  128. package/dist/entry-elysia.cjs.map +1 -0
  129. package/dist/entry-elysia.d.cts +710 -0
  130. package/dist/entry-elysia.d.mts +710 -0
  131. package/dist/entry-elysia.mjs +109 -0
  132. package/dist/entry-elysia.mjs.map +1 -0
  133. package/dist/entry-elysia2.cjs +101 -0
  134. package/dist/entry-elysia2.cjs.map +1 -0
  135. package/dist/entry-elysia2.d.cts +905 -0
  136. package/dist/entry-elysia2.d.mts +905 -0
  137. package/dist/entry-elysia2.mjs +98 -0
  138. package/dist/entry-elysia2.mjs.map +1 -0
  139. package/dist/entry-express.cjs +90 -0
  140. package/dist/entry-express.cjs.map +1 -0
  141. package/dist/entry-express.d.cts +24 -0
  142. package/dist/entry-express.d.mts +24 -0
  143. package/dist/entry-express.mjs +88 -0
  144. package/dist/entry-express.mjs.map +1 -0
  145. package/dist/entry-hono.cjs +36 -0
  146. package/dist/entry-hono.cjs.map +1 -0
  147. package/dist/entry-hono.d.cts +24 -0
  148. package/dist/entry-hono.d.mts +24 -0
  149. package/dist/entry-hono.mjs +34 -0
  150. package/dist/entry-hono.mjs.map +1 -0
  151. package/dist/entry-hooks-log.cjs +22 -0
  152. package/dist/entry-hooks-log.cjs.map +1 -0
  153. package/dist/entry-hooks-log.d.cts +23 -0
  154. package/dist/entry-hooks-log.d.mts +23 -0
  155. package/dist/entry-hooks-log.mjs +21 -0
  156. package/dist/entry-hooks-log.mjs.map +1 -0
  157. package/dist/entry-sinks-console.cjs +43 -0
  158. package/dist/entry-sinks-console.cjs.map +1 -0
  159. package/dist/entry-sinks-console.d.cts +26 -0
  160. package/dist/entry-sinks-console.d.mts +26 -0
  161. package/dist/entry-sinks-console.mjs +41 -0
  162. package/dist/entry-sinks-console.mjs.map +1 -0
  163. package/dist/entry-sinks-datadog.cjs +97 -0
  164. package/dist/entry-sinks-datadog.cjs.map +1 -0
  165. package/dist/entry-sinks-datadog.d.cts +66 -0
  166. package/dist/entry-sinks-datadog.d.mts +66 -0
  167. package/dist/entry-sinks-datadog.mjs +91 -0
  168. package/dist/entry-sinks-datadog.mjs.map +1 -0
  169. package/dist/entry-sinks-file.cjs +100 -0
  170. package/dist/entry-sinks-file.cjs.map +1 -0
  171. package/dist/entry-sinks-file.d.cts +70 -0
  172. package/dist/entry-sinks-file.d.mts +70 -0
  173. package/dist/entry-sinks-file.mjs +97 -0
  174. package/dist/entry-sinks-file.mjs.map +1 -0
  175. package/dist/entry-sinks-http.cjs +63 -0
  176. package/dist/entry-sinks-http.cjs.map +1 -0
  177. package/dist/entry-sinks-http.d.cts +55 -0
  178. package/dist/entry-sinks-http.d.mts +55 -0
  179. package/dist/entry-sinks-http.mjs +60 -0
  180. package/dist/entry-sinks-http.mjs.map +1 -0
  181. package/dist/entry-sinks-s3.cjs +115 -0
  182. package/dist/entry-sinks-s3.cjs.map +1 -0
  183. package/dist/entry-sinks-s3.d.cts +79 -0
  184. package/dist/entry-sinks-s3.d.mts +79 -0
  185. package/dist/entry-sinks-s3.mjs +112 -0
  186. package/dist/entry-sinks-s3.mjs.map +1 -0
  187. package/dist/entry-sinks-splunk.cjs +80 -0
  188. package/dist/entry-sinks-splunk.cjs.map +1 -0
  189. package/dist/entry-sinks-splunk.d.cts +58 -0
  190. package/dist/entry-sinks-splunk.d.mts +58 -0
  191. package/dist/entry-sinks-splunk.mjs +77 -0
  192. package/dist/entry-sinks-splunk.mjs.map +1 -0
  193. package/dist/entry-sinks-webhook.cjs +130 -0
  194. package/dist/entry-sinks-webhook.cjs.map +1 -0
  195. package/dist/entry-sinks-webhook.d.cts +69 -0
  196. package/dist/entry-sinks-webhook.d.mts +69 -0
  197. package/dist/entry-sinks-webhook.mjs +125 -0
  198. package/dist/entry-sinks-webhook.mjs.map +1 -0
  199. package/dist/entry-sinks-xtandard-webhooks.cjs +64 -0
  200. package/dist/entry-sinks-xtandard-webhooks.cjs.map +1 -0
  201. package/dist/entry-sinks-xtandard-webhooks.d.cts +64 -0
  202. package/dist/entry-sinks-xtandard-webhooks.d.mts +64 -0
  203. package/dist/entry-sinks-xtandard-webhooks.mjs +63 -0
  204. package/dist/entry-sinks-xtandard-webhooks.mjs.map +1 -0
  205. package/dist/entry-storage-cloudflare-kv.cjs +47 -0
  206. package/dist/entry-storage-cloudflare-kv.cjs.map +1 -0
  207. package/dist/entry-storage-cloudflare-kv.d.cts +42 -0
  208. package/dist/entry-storage-cloudflare-kv.d.mts +42 -0
  209. package/dist/entry-storage-cloudflare-kv.mjs +46 -0
  210. package/dist/entry-storage-cloudflare-kv.mjs.map +1 -0
  211. package/dist/entry-storage-drizzle.cjs +228 -0
  212. package/dist/entry-storage-drizzle.cjs.map +1 -0
  213. package/dist/entry-storage-drizzle.d.cts +43 -0
  214. package/dist/entry-storage-drizzle.d.mts +43 -0
  215. package/dist/entry-storage-drizzle.mjs +227 -0
  216. package/dist/entry-storage-drizzle.mjs.map +1 -0
  217. package/dist/entry-storage-file.cjs +175 -0
  218. package/dist/entry-storage-file.cjs.map +1 -0
  219. package/dist/entry-storage-file.d.cts +41 -0
  220. package/dist/entry-storage-file.d.mts +41 -0
  221. package/dist/entry-storage-file.mjs +171 -0
  222. package/dist/entry-storage-file.mjs.map +1 -0
  223. package/dist/entry-storage-libsql.cjs +133 -0
  224. package/dist/entry-storage-libsql.cjs.map +1 -0
  225. package/dist/entry-storage-libsql.d.cts +60 -0
  226. package/dist/entry-storage-libsql.d.mts +60 -0
  227. package/dist/entry-storage-libsql.mjs +132 -0
  228. package/dist/entry-storage-libsql.mjs.map +1 -0
  229. package/dist/entry-storage-memory.cjs +3 -0
  230. package/dist/entry-storage-memory.d.cts +2 -0
  231. package/dist/entry-storage-memory.d.mts +2 -0
  232. package/dist/entry-storage-memory.mjs +2 -0
  233. package/dist/entry-storage-mongodb.cjs +306 -0
  234. package/dist/entry-storage-mongodb.cjs.map +1 -0
  235. package/dist/entry-storage-mongodb.d.cts +65 -0
  236. package/dist/entry-storage-mongodb.d.mts +65 -0
  237. package/dist/entry-storage-mongodb.mjs +304 -0
  238. package/dist/entry-storage-mongodb.mjs.map +1 -0
  239. package/dist/entry-storage-postgres.cjs +261 -0
  240. package/dist/entry-storage-postgres.cjs.map +1 -0
  241. package/dist/entry-storage-postgres.d.cts +66 -0
  242. package/dist/entry-storage-postgres.d.mts +66 -0
  243. package/dist/entry-storage-postgres.mjs +260 -0
  244. package/dist/entry-storage-postgres.mjs.map +1 -0
  245. package/dist/entry-storage-redis.cjs +223 -0
  246. package/dist/entry-storage-redis.cjs.map +1 -0
  247. package/dist/entry-storage-redis.d.cts +77 -0
  248. package/dist/entry-storage-redis.d.mts +77 -0
  249. package/dist/entry-storage-redis.mjs +221 -0
  250. package/dist/entry-storage-redis.mjs.map +1 -0
  251. package/dist/entry-storage-sqlite.cjs +85 -0
  252. package/dist/entry-storage-sqlite.cjs.map +1 -0
  253. package/dist/entry-storage-sqlite.d.cts +40 -0
  254. package/dist/entry-storage-sqlite.d.mts +40 -0
  255. package/dist/entry-storage-sqlite.mjs +84 -0
  256. package/dist/entry-storage-sqlite.mjs.map +1 -0
  257. package/dist/entry-storage-unstorage.cjs +57 -0
  258. package/dist/entry-storage-unstorage.cjs.map +1 -0
  259. package/dist/entry-storage-unstorage.d.cts +29 -0
  260. package/dist/entry-storage-unstorage.d.mts +29 -0
  261. package/dist/entry-storage-unstorage.mjs +56 -0
  262. package/dist/entry-storage-unstorage.mjs.map +1 -0
  263. package/dist/export-B9S-JeYl.mjs +239 -0
  264. package/dist/export-B9S-JeYl.mjs.map +1 -0
  265. package/dist/export-BZq0KCCn.d.mts +70 -0
  266. package/dist/export-DYfMd-ep.cjs +280 -0
  267. package/dist/export-DYfMd-ep.cjs.map +1 -0
  268. package/dist/export-Dh8T8I1p.d.cts +70 -0
  269. package/dist/index.cjs +279 -0
  270. package/dist/index.cjs.map +1 -0
  271. package/dist/index.d.cts +286 -0
  272. package/dist/index.d.mts +284 -0
  273. package/dist/index.mjs +177 -0
  274. package/dist/index.mjs.map +1 -0
  275. package/dist/integrity-BHhjTBNk.cjs +614 -0
  276. package/dist/integrity-BHhjTBNk.cjs.map +1 -0
  277. package/dist/integrity-kfY2DNAi.mjs +483 -0
  278. package/dist/integrity-kfY2DNAi.mjs.map +1 -0
  279. package/dist/memory-CfykUo9W.cjs +155 -0
  280. package/dist/memory-CfykUo9W.cjs.map +1 -0
  281. package/dist/memory-DrR-Tlbf.d.mts +28 -0
  282. package/dist/memory-GG2Nba1D.mjs +150 -0
  283. package/dist/memory-GG2Nba1D.mjs.map +1 -0
  284. package/dist/memory-HpFdlMR_.d.cts +28 -0
  285. package/dist/none-Be7r6kHH.cjs +33 -0
  286. package/dist/none-Be7r6kHH.cjs.map +1 -0
  287. package/dist/none-CGmIIbI8.cjs +49 -0
  288. package/dist/none-CGmIIbI8.cjs.map +1 -0
  289. package/dist/none-CkV5mZsB.mjs +33 -0
  290. package/dist/none-CkV5mZsB.mjs.map +1 -0
  291. package/dist/none-DBeBeU0Z.mjs +23 -0
  292. package/dist/none-DBeBeU0Z.mjs.map +1 -0
  293. package/dist/query-ChGGtlA7.cjs +243 -0
  294. package/dist/query-ChGGtlA7.cjs.map +1 -0
  295. package/dist/query-LvZbyi37.mjs +172 -0
  296. package/dist/query-LvZbyi37.mjs.map +1 -0
  297. package/dist/react.css +1 -0
  298. package/dist/react.js +31935 -0
  299. package/dist/recorder-B3dG3jbd.d.mts +64 -0
  300. package/dist/recorder-CGY7HK29.d.cts +64 -0
  301. package/dist/roles-BARtYLSX.cjs +112 -0
  302. package/dist/roles-BARtYLSX.cjs.map +1 -0
  303. package/dist/roles-D7Pg89IJ.mjs +83 -0
  304. package/dist/roles-D7Pg89IJ.mjs.map +1 -0
  305. package/dist/schema-DmU7Wp0F.d.cts +251 -0
  306. package/dist/schema-DmU7Wp0F.d.mts +251 -0
  307. package/dist/schema.cjs +20 -0
  308. package/dist/schema.cjs.map +1 -0
  309. package/dist/schema.d.cts +2 -0
  310. package/dist/schema.d.mts +2 -0
  311. package/dist/schema.mjs +17 -0
  312. package/dist/schema.mjs.map +1 -0
  313. package/dist/shared-CJOyJKqT.d.mts +20 -0
  314. package/dist/shared-DSDY-V0n.mjs +100 -0
  315. package/dist/shared-DSDY-V0n.mjs.map +1 -0
  316. package/dist/shared-EANCdRqn.d.cts +20 -0
  317. package/dist/shared-OOAq-U4S.cjs +141 -0
  318. package/dist/shared-OOAq-U4S.cjs.map +1 -0
  319. package/dist/sql-B7b6HzGy.cjs +280 -0
  320. package/dist/sql-B7b6HzGy.cjs.map +1 -0
  321. package/dist/sql-COjPyn3F.mjs +209 -0
  322. package/dist/sql-COjPyn3F.mjs.map +1 -0
  323. package/dist/sqlite-event-log-BnoG8eos.cjs +184 -0
  324. package/dist/sqlite-event-log-BnoG8eos.cjs.map +1 -0
  325. package/dist/sqlite-event-log-nXmS2DS_.mjs +179 -0
  326. package/dist/sqlite-event-log-nXmS2DS_.mjs.map +1 -0
  327. package/dist/streams-CRuxOYcb.d.cts +124 -0
  328. package/dist/streams-DU0_gvI8.d.mts +124 -0
  329. package/dist/table-BcarDd10.d.cts +48 -0
  330. package/dist/table-BcarDd10.d.mts +48 -0
  331. package/dist/testing.cjs +189 -0
  332. package/dist/testing.cjs.map +1 -0
  333. package/dist/testing.d.cts +103 -0
  334. package/dist/testing.d.mts +103 -0
  335. package/dist/testing.mjs +185 -0
  336. package/dist/testing.mjs.map +1 -0
  337. package/dist/types-elysia2/adapters/bun.d.ts +47 -0
  338. package/dist/types-elysia2/adapters/context-shared.d.ts +40 -0
  339. package/dist/types-elysia2/adapters/elysia-shared.d.ts +36 -0
  340. package/dist/types-elysia2/adapters/elysia2.d.ts +588 -0
  341. package/dist/types-elysia2/auth/contract.d.ts +26 -0
  342. package/dist/types-elysia2/authorization/contract.d.ts +54 -0
  343. package/dist/types-elysia2/canonical.d.ts +25 -0
  344. package/dist/types-elysia2/context.d.ts +61 -0
  345. package/dist/types-elysia2/core.d.ts +232 -0
  346. package/dist/types-elysia2/duration.d.ts +26 -0
  347. package/dist/types-elysia2/entry-elysia2.d.ts +10 -0
  348. package/dist/types-elysia2/event-log.d.ts +33 -0
  349. package/dist/types-elysia2/export.d.ts +77 -0
  350. package/dist/types-elysia2/hooks/contract.d.ts +177 -0
  351. package/dist/types-elysia2/id.d.ts +27 -0
  352. package/dist/types-elysia2/integrity.d.ts +193 -0
  353. package/dist/types-elysia2/keys.d.ts +91 -0
  354. package/dist/types-elysia2/portal.d.ts +137 -0
  355. package/dist/types-elysia2/query.d.ts +88 -0
  356. package/dist/types-elysia2/schema.d.ts +247 -0
  357. package/dist/types-elysia2/server/base-path.d.ts +15 -0
  358. package/dist/types-elysia2/server/cors.d.ts +36 -0
  359. package/dist/types-elysia2/server/create-fetch-handler.d.ts +140 -0
  360. package/dist/types-elysia2/server/openapi.d.ts +25 -0
  361. package/dist/types-elysia2/server/render-index-html.d.ts +18 -0
  362. package/dist/types-elysia2/server/routes.d.ts +83 -0
  363. package/dist/types-elysia2/server/static-assets.d.ts +13 -0
  364. package/dist/types-elysia2/standard-schema.d.ts +100 -0
  365. package/dist/types-elysia2/storage/contract.d.ts +106 -0
  366. package/dist/types-elysia2/streams.d.ts +134 -0
  367. package/dist/types-elysia2/transforms.d.ts +56 -0
  368. package/dist/types-elysia2/validation.d.ts +48 -0
  369. package/dist/types-react/canonical.d.ts +25 -0
  370. package/dist/types-react/context.d.ts +61 -0
  371. package/dist/types-react/core.d.ts +232 -0
  372. package/dist/types-react/duration.d.ts +26 -0
  373. package/dist/types-react/event-log.d.ts +33 -0
  374. package/dist/types-react/hooks/contract.d.ts +177 -0
  375. package/dist/types-react/id.d.ts +27 -0
  376. package/dist/types-react/integrity.d.ts +193 -0
  377. package/dist/types-react/keys.d.ts +91 -0
  378. package/dist/types-react/query.d.ts +88 -0
  379. package/dist/types-react/react.d.ts +114 -0
  380. package/dist/types-react/schema.d.ts +247 -0
  381. package/dist/types-react/standard-schema.d.ts +100 -0
  382. package/dist/types-react/storage/contract.d.ts +106 -0
  383. package/dist/types-react/streams.d.ts +134 -0
  384. package/dist/types-react/transforms.d.ts +56 -0
  385. package/dist/types-react/ui/App.d.ts +36 -0
  386. package/dist/types-react/ui/api.d.ts +61 -0
  387. package/dist/types-react/ui/components/ActionFilter.d.ts +17 -0
  388. package/dist/types-react/ui/components/ExportMenu.d.ts +13 -0
  389. package/dist/types-react/ui/components/JsonCodeEditor.d.ts +12 -0
  390. package/dist/types-react/ui/components/ThemeToggle.d.ts +2 -0
  391. package/dist/types-react/ui/components/Toast.d.ts +16 -0
  392. package/dist/types-react/ui/components/audit-bits.d.ts +91 -0
  393. package/dist/types-react/ui/components/integrity-bits.d.ts +19 -0
  394. package/dist/types-react/ui/components/primitives.d.ts +50 -0
  395. package/dist/types-react/ui/components/ui-bits.d.ts +22 -0
  396. package/dist/types-react/ui/lib/filters.d.ts +70 -0
  397. package/dist/types-react/ui/lib/format.d.ts +82 -0
  398. package/dist/types-react/ui/lib/nav-guard.d.ts +20 -0
  399. package/dist/types-react/ui/lib/portal-container.d.ts +24 -0
  400. package/dist/types-react/ui/lib/utils.d.ts +3 -0
  401. package/dist/types-react/ui/theme.d.ts +40 -0
  402. package/dist/types-react/ui/types.d.ts +67 -0
  403. package/dist/types-react/ui/views/ActionsView.d.ts +10 -0
  404. package/dist/types-react/ui/views/EventDrawer.d.ts +15 -0
  405. package/dist/types-react/ui/views/EventsView.d.ts +10 -0
  406. package/dist/types-react/ui/views/IntegrityView.d.ts +10 -0
  407. package/dist/types-react/ui/views/OverviewView.d.ts +9 -0
  408. package/dist/types-react/ui/views/StreamsView.d.ts +10 -0
  409. package/dist/types-react/ui/views/TenantsView.d.ts +6 -0
  410. package/dist/types-react/validation.d.ts +48 -0
  411. package/dist/ui/assets/favicon-BSj8MPnj.svg +11 -0
  412. package/dist/ui/assets/index-Cd-mcIwC.css +1 -0
  413. package/dist/ui/assets/index-DUAgpiot.js +244 -0
  414. package/dist/ui/index.html +15 -0
  415. package/dist/validation-DFrLESZD.mjs +150 -0
  416. package/dist/validation-DFrLESZD.mjs.map +1 -0
  417. package/dist/validation-lb0YXrxx.cjs +235 -0
  418. package/dist/validation-lb0YXrxx.cjs.map +1 -0
  419. package/dist/verify.cjs +14 -0
  420. package/dist/verify.d.cts +5 -0
  421. package/dist/verify.d.mts +5 -0
  422. package/dist/verify.mjs +3 -0
  423. package/package.json +610 -4
@@ -0,0 +1,61 @@
1
+ import type { ActionDefinition, AuditCheckpoint, AuditConfig, AuditEvent, AuditPage, AuditSection, AuditTenant, ExportFormat, Overview, StreamStatus, VerifyReport } from "./types.ts";
2
+ /** The subset of `fetch` the client uses (the global `fetch` satisfies it). */
3
+ export type FetchLike = (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
4
+ /** Options for {@link setApiBase}. */
5
+ export interface ApiClientOptions {
6
+ /** `credentials` mode for requests. Use `"include"` for cross-origin cookie auth. */
7
+ credentials?: RequestCredentials;
8
+ /** Custom fetch implementation (bearer tokens, extra headers, instrumentation). */
9
+ fetch?: FetchLike;
10
+ }
11
+ /** Point the API client at a base URL (used by the `@xtandard/audit/react` export). */
12
+ export declare function setApiBase(base: string, opts?: ApiClientOptions): void;
13
+ /** Attach a portal token (`audpt_…`) as a Bearer credential on every request. */
14
+ export declare function setApiToken(token: string | null): void;
15
+ /** The URL for an API path under the current base (links: JWKS, OpenAPI). */
16
+ export declare function apiUrl(path: string): string;
17
+ /** `?a=1&b=2` from defined, non-empty params (`""` when none). */
18
+ export declare const toSearch: (params: {
19
+ [key: string]: string | number | undefined;
20
+ }) => string;
21
+ export declare function getConfig(): Promise<AuditConfig>;
22
+ export declare function getOverview(): Promise<Overview>;
23
+ export declare function listTenants(): Promise<AuditTenant[]>;
24
+ export declare function getTenant(tenant: string): Promise<AuditTenant>;
25
+ /** API query parameters for listing/exporting (see `toApiQuery` in lib/filters.ts). */
26
+ export type EventQueryParams = Record<string, string>;
27
+ /**
28
+ * One page of events. With a `tenant` the tenant-scoped route is used;
29
+ * without, the cross-tenant listing (admin only).
30
+ */
31
+ export declare function listEvents(tenant: string | undefined, params: EventQueryParams, page?: {
32
+ cursor?: string;
33
+ limit?: number;
34
+ }): Promise<AuditPage<AuditEvent>>;
35
+ export declare function getEvent(tenant: string, id: string): Promise<AuditEvent>;
36
+ export declare function eraseEvent(tenant: string, id: string, input: {
37
+ sections?: AuditSection[];
38
+ reason?: string;
39
+ }): Promise<AuditEvent>;
40
+ /**
41
+ * Fetch an export as a Blob. A plain `<a href>` cannot carry the portal
42
+ * token's `Authorization` header, so the UI downloads through the API client
43
+ * and hands the browser an object URL.
44
+ */
45
+ export declare function exportEvents(tenant: string, format: ExportFormat, params: EventQueryParams): Promise<{
46
+ blob: Blob;
47
+ contentDisposition: string | null;
48
+ }>;
49
+ export declare function verifyTenant(tenant: string, range?: {
50
+ fromSeq?: number;
51
+ toSeq?: number;
52
+ }): Promise<VerifyReport>;
53
+ export declare function listCheckpoints(tenant: string): Promise<AuditCheckpoint[]>;
54
+ export declare function createCheckpoint(tenant: string): Promise<AuditCheckpoint>;
55
+ /** Public JWKS URL (checkpoint verification keys). */
56
+ export declare const jwksUrl: () => string;
57
+ export declare function listActions(): Promise<ActionDefinition[]>;
58
+ export declare function updateAction(name: string, input: Omit<ActionDefinition, "name" | "source" | "createdAt" | "updatedAt">): Promise<ActionDefinition>;
59
+ export declare function deleteAction(name: string): Promise<void>;
60
+ export declare function listStreams(): Promise<StreamStatus[]>;
61
+ export declare function retryStream(name: string, tenant?: string): Promise<void>;
@@ -0,0 +1,17 @@
1
+ import * as React from "react";
2
+ /**
3
+ * Multi-value action filter: chips plus a type-ahead over the catalog's names
4
+ * and their families (`invoice.*`). Enter adds the highlighted suggestion (or
5
+ * the typed text verbatim — unknown actions and hand-written families are
6
+ * valid filters), Backspace on an empty input removes the last chip.
7
+ *
8
+ * The suggestion list renders inline (absolutely positioned, not portaled) so
9
+ * it stays inside the embed's scoped stylesheet.
10
+ */
11
+ export declare function ActionFilter({ value, onChange, names, className, }: {
12
+ value: string[];
13
+ onChange: (next: string[]) => void;
14
+ /** Known action names (catalog + recently seen). */
15
+ names: string[];
16
+ className?: string;
17
+ }): React.JSX.Element;
@@ -0,0 +1,13 @@
1
+ import * as React from "react";
2
+ import { type EventQueryParams } from "../api.ts";
3
+ /**
4
+ * The Events view's export menu. Exports honor the current filters (the same
5
+ * API query the list runs, minus paging) and are per tenant: with "All tenants"
6
+ * selected the menu is disabled.
7
+ */
8
+ export declare function ExportMenu({ tenant, query, disabledReason, }: {
9
+ tenant: string;
10
+ query: EventQueryParams;
11
+ /** When set, the trigger is disabled with this tooltip. */
12
+ disabledReason?: string;
13
+ }): React.JSX.Element;
@@ -0,0 +1,12 @@
1
+ import React from "react";
2
+ /**
3
+ * A small controlled CodeMirror 6 editor for JSON. Syntax highlighting + line
4
+ * numbers + history; no autocomplete/lint (kept light). Reports raw text via
5
+ * `onChange`; the parent owns parsing/validation.
6
+ */
7
+ export declare function JsonCodeEditor({ value, onChange, readOnly, placeholderText, }: {
8
+ value: string;
9
+ onChange: (text: string) => void;
10
+ readOnly?: boolean;
11
+ placeholderText?: string;
12
+ }): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from "react";
2
+ export declare function ThemeToggle(): React.JSX.Element;
@@ -0,0 +1,16 @@
1
+ import React from "react";
2
+ export type ToastKind = "success" | "error" | "info" | "warning";
3
+ export interface Toast {
4
+ id: string;
5
+ kind: ToastKind;
6
+ message: string;
7
+ detail?: string;
8
+ }
9
+ interface ToastContextValue {
10
+ add: (kind: ToastKind, message: string, detail?: string) => void;
11
+ }
12
+ export declare function useToast(): ToastContextValue;
13
+ export declare function ToastProvider({ children }: {
14
+ children: React.ReactNode;
15
+ }): React.JSX.Element;
16
+ export {};
@@ -0,0 +1,91 @@
1
+ import * as React from "react";
2
+ import type { AuditEvent } from "../types.ts";
3
+ import { type StreamHealth } from "../lib/format.ts";
4
+ export declare function Spinner({ className }: {
5
+ className?: string;
6
+ }): React.JSX.Element;
7
+ export declare function LoadingRow({ label }: {
8
+ label: string;
9
+ }): React.JSX.Element;
10
+ export declare function OutcomeBadge({ outcome }: {
11
+ outcome: AuditEvent["outcome"];
12
+ }): React.JSX.Element;
13
+ export declare function StreamHealthBadge({ health }: {
14
+ health: StreamHealth;
15
+ }): React.JSX.Element;
16
+ export declare function ToneBadge({ tone, children, }: {
17
+ tone: "success" | "warning" | "destructive" | "accent" | "muted";
18
+ children: React.ReactNode;
19
+ }): React.JSX.Element;
20
+ /** Keys/ids/hashes render in JetBrains Mono per the design system. */
21
+ export declare function Mono({ className, children }: {
22
+ className?: string;
23
+ children: React.ReactNode;
24
+ }): React.JSX.Element;
25
+ /** Icon button that copies `value` to the clipboard (brief check-mark feedback). */
26
+ export declare function CopyButton({ value, label, className, }: {
27
+ value: string;
28
+ /** Accessible name, e.g. "Copy event id". */
29
+ label?: string;
30
+ className?: string;
31
+ }): React.JSX.Element;
32
+ export declare function PageHeader({ title, description, actions, }: {
33
+ title: string;
34
+ description?: React.ReactNode;
35
+ actions?: React.ReactNode;
36
+ }): React.JSX.Element;
37
+ export declare function SectionCard({ title, description, actions, children, className, }: {
38
+ title: string;
39
+ description?: React.ReactNode;
40
+ actions?: React.ReactNode;
41
+ children: React.ReactNode;
42
+ className?: string;
43
+ }): React.JSX.Element;
44
+ export declare function StatCard({ label, value, hint, tone, }: {
45
+ label: string;
46
+ value: string;
47
+ hint?: React.ReactNode;
48
+ tone?: string;
49
+ }): React.JSX.Element;
50
+ /** A two-column definition list row (label / value). */
51
+ export declare function KeyValue({ label, children, copy, }: {
52
+ label: string;
53
+ children: React.ReactNode;
54
+ /** When set, a copy button for this raw value is shown. */
55
+ copy?: string;
56
+ }): React.JSX.Element;
57
+ export declare function ModalDialog({ open, onClose, title, children, footer, wide, }: {
58
+ open: boolean;
59
+ onClose: () => void;
60
+ title: React.ReactNode;
61
+ children: React.ReactNode;
62
+ footer?: React.ReactNode;
63
+ wide?: boolean;
64
+ }): React.JSX.Element;
65
+ export declare function ConfirmDialog({ open, onClose, onConfirm, title, confirmLabel, danger, loading, children, confirmDisabled, }: {
66
+ open: boolean;
67
+ onClose: () => void;
68
+ onConfirm: () => void;
69
+ title: React.ReactNode;
70
+ confirmLabel: string;
71
+ danger?: boolean;
72
+ loading?: boolean;
73
+ children: React.ReactNode;
74
+ confirmDisabled?: boolean;
75
+ }): React.JSX.Element;
76
+ /** A right-hand side sheet (the event detail). Closes on Escape / backdrop click. */
77
+ export declare function Drawer({ open, onClose, title, subtitle, actions, children, }: {
78
+ open: boolean;
79
+ onClose: () => void;
80
+ title: React.ReactNode;
81
+ subtitle?: React.ReactNode;
82
+ actions?: React.ReactNode;
83
+ children: React.ReactNode;
84
+ }): React.JSX.Element;
85
+ export declare function EmptyCard({ children }: {
86
+ children: React.ReactNode;
87
+ }): React.JSX.Element;
88
+ /** Page wrapper with the shared max width and gutters. */
89
+ export declare function Page({ children }: {
90
+ children: React.ReactNode;
91
+ }): React.JSX.Element;
@@ -0,0 +1,19 @@
1
+ import * as React from "react";
2
+ import type { AuditCheckpoint, VerifyReport } from "../types.ts";
3
+ /** The one-line verdict ("Verified through #N, signed by key K") with its icon. */
4
+ export declare function VerifySummaryLine({ report, checkpoints, }: {
5
+ report: VerifyReport;
6
+ checkpoints?: AuditCheckpoint[];
7
+ }): React.JSX.Element;
8
+ /** A full {@link VerifyReport}: verdict, coverage, issues, erasures. */
9
+ export declare function VerifyReportView({ report, checkpoints, }: {
10
+ report: VerifyReport;
11
+ checkpoints?: AuditCheckpoint[];
12
+ }): React.JSX.Element;
13
+ /**
14
+ * The portal's "Verify log integrity" panel: one button that runs the server
15
+ * verifier over the tenant's chain and condenses the report to a badge line.
16
+ */
17
+ export declare function VerifyPanel({ tenant }: {
18
+ tenant: string;
19
+ }): React.JSX.Element;
@@ -0,0 +1,50 @@
1
+ import * as React from "react";
2
+ export declare function ToggleSwitch({ checked, onCheckedChange, disabled, "aria-label": ariaLabel, }: {
3
+ checked: boolean;
4
+ onCheckedChange: (checked: boolean) => void;
5
+ disabled?: boolean;
6
+ "aria-label"?: string;
7
+ }): React.JSX.Element;
8
+ export interface SegmentOption<T extends string> {
9
+ value: T;
10
+ label: React.ReactNode;
11
+ "aria-label"?: string;
12
+ }
13
+ export declare function Segmented<T extends string>({ value, onValueChange, options, size, }: {
14
+ value: T;
15
+ onValueChange: (value: T) => void;
16
+ options: SegmentOption<T>[];
17
+ size?: "sm" | "md";
18
+ }): React.JSX.Element;
19
+ export interface DropdownOption {
20
+ value: string;
21
+ label: string;
22
+ description?: string;
23
+ }
24
+ export declare function Dropdown({ value, onValueChange, options, placeholder, disabled, className, "aria-label": ariaLabel, }: {
25
+ value: string;
26
+ onValueChange: (value: string) => void;
27
+ options: DropdownOption[];
28
+ placeholder?: string;
29
+ disabled?: boolean;
30
+ className?: string;
31
+ "aria-label"?: string;
32
+ }): React.JSX.Element;
33
+ /**
34
+ * A single-select combobox that lets you pick an existing option **or type a new
35
+ * one** — when the typed text matches nothing, a "Create …" item appears and
36
+ * selecting it calls {@link onCreate}. Used for the project/environment switchers.
37
+ */
38
+ export declare function CreatableCombobox({ value, options, onSelect, onCreate, placeholder, createLabel, disabled, className, "aria-label": ariaLabel, }: {
39
+ value: string;
40
+ options: string[];
41
+ onSelect: (value: string) => void;
42
+ onCreate: (value: string) => void;
43
+ placeholder?: string;
44
+ createLabel?: (query: string) => string;
45
+ disabled?: boolean;
46
+ className?: string;
47
+ "aria-label"?: string;
48
+ }): React.JSX.Element;
49
+ export declare const TextInput: React.ForwardRefExoticComponent<React.InputHTMLAttributes<HTMLInputElement> & React.RefAttributes<HTMLInputElement>>;
50
+ export declare const TextArea: React.ForwardRefExoticComponent<React.TextareaHTMLAttributes<HTMLTextAreaElement> & React.RefAttributes<HTMLTextAreaElement>>;
@@ -0,0 +1,22 @@
1
+ import * as React from "react";
2
+ type ButtonVariant = "primary" | "secondary" | "ghost" | "danger";
3
+ type ButtonSize = "sm" | "md" | "icon";
4
+ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
5
+ variant?: ButtonVariant;
6
+ size?: ButtonSize;
7
+ loading?: boolean;
8
+ icon?: React.ReactNode;
9
+ }
10
+ export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
11
+ export declare function Badge({ className, children }: {
12
+ className?: string;
13
+ children: React.ReactNode;
14
+ }): React.JSX.Element;
15
+ export declare function Avatar({ initials, className }: {
16
+ initials: string;
17
+ className?: string;
18
+ }): React.JSX.Element;
19
+ export declare function Kbd({ children }: {
20
+ children: React.ReactNode;
21
+ }): React.JSX.Element;
22
+ export {};
@@ -0,0 +1,70 @@
1
+ /**
2
+ * The Events explorer's filter model and its URL encoding — pure, no React,
3
+ * no DOM. Filters live in the URL query string so a filtered view is a
4
+ * shareable, reload-safe link; {@link toApiQuery} turns them into the HTTP
5
+ * API's query parameters (docs/HTTP_API.md). Unit-tested in
6
+ * `test/ui-lib.test.ts`.
7
+ *
8
+ * @module
9
+ */
10
+ import type { AuditOutcome } from "../types.ts";
11
+ /** Time-range presets offered by the filter bar. `custom` uses `from`/`to`. */
12
+ export type TimeRange = "all" | "15m" | "1h" | "24h" | "7d" | "30d" | "custom";
13
+ export declare const TIME_RANGES: {
14
+ value: TimeRange;
15
+ label: string;
16
+ }[];
17
+ /** The explorer's filter state (tenant is separate: it is shell-level context). */
18
+ export interface EventFilters {
19
+ /** Exact names or families (`invoice.*`). */
20
+ actions: string[];
21
+ actorId: string;
22
+ actorType: string;
23
+ targetType: string;
24
+ targetId: string;
25
+ outcome: "" | AuditOutcome;
26
+ range: TimeRange;
27
+ /** ISO-8601, `custom` range only (inclusive). */
28
+ from: string;
29
+ /** ISO-8601, `custom` range only (exclusive). */
30
+ to: string;
31
+ search: string;
32
+ }
33
+ export declare const EMPTY_FILTERS: EventFilters;
34
+ /** Every URL parameter the filter model owns (other params — `tenant`, `event` — pass through). */
35
+ export declare const FILTER_PARAMS: readonly string[];
36
+ /** Split a list parameter (repeated and/or comma-separated), trimmed, de-duplicated. */
37
+ export declare function parseList(values: string[]): string[];
38
+ /** Read the filters from a URL query string. Unknown/invalid values fall back to empty. */
39
+ export declare function filtersFromSearch(search: URLSearchParams): EventFilters;
40
+ /**
41
+ * Write `filters` into a copy of `base` (other params are preserved; filter
42
+ * params at their default are removed so URLs stay short).
43
+ */
44
+ export declare function filtersToSearch(filters: EventFilters, base?: URLSearchParams): URLSearchParams;
45
+ /** Number of active filters (the "Clear filters" badge). */
46
+ export declare function activeFilterCount(filters: EventFilters): number;
47
+ /**
48
+ * The HTTP API query for `filters` (docs/HTTP_API.md "Query parameters").
49
+ * Relative presets resolve against `now`, so callers compute this once per
50
+ * filter change and keep it stable across pages (keyset cursors assume the
51
+ * same query).
52
+ */
53
+ export declare function toApiQuery(filters: EventFilters, now?: number): Record<string, string>;
54
+ /** ISO-8601 → the local-time `YYYY-MM-DDTHH:mm` an `<input type="datetime-local">` takes. */
55
+ export declare function isoToLocalInput(iso: string): string;
56
+ /** A `datetime-local` value (local time) → ISO-8601 UTC; `""` for empty/invalid. */
57
+ export declare function localInputToIso(value: string): string;
58
+ /** `invoice.*`-style family pattern. */
59
+ export declare function isFamily(pattern: string): boolean;
60
+ /**
61
+ * Every family (`a.*`, `a.b.*`) implied by a set of dot-delimited action names.
62
+ * `invoice.paid` → `invoice.*`; `billing.invoice.paid` → `billing.*`, `billing.invoice.*`.
63
+ */
64
+ export declare function actionFamilies(names: string[]): string[];
65
+ /**
66
+ * Autocomplete for the action filter: catalog names plus their families,
67
+ * matching `input` case-insensitively (prefix matches first), minus what is
68
+ * already selected. Empty input lists families first, then names.
69
+ */
70
+ export declare function actionSuggestions(names: string[], input: string, selected?: string[], limit?: number): string[];
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Pure UI helpers — no React, no DOM. Unit-tested in `test/ui-lib.test.ts`
3
+ * (visual behavior is covered by the Playwright e2e suite instead).
4
+ *
5
+ * @module
6
+ */
7
+ import type { ActionDefinition, AuditActor, AuditCheckpoint, AuditConfig, AuditEvent, AuditSection, AuditTarget, ExportFormat, PanelAction, StreamStatus, VerifyReport } from "../types.ts";
8
+ /** Absolute date-time, locale-aware. Returns `"—"` for missing/invalid input. */
9
+ export declare function formatDateTime(iso: string | undefined | null): string;
10
+ /**
11
+ * Compact relative time: `"just now"`, `"5m ago"`, `"in 2h"`, `"3d ago"`.
12
+ * `now` is injectable for tests; defaults to the current time.
13
+ */
14
+ export declare function relativeTime(iso: string | undefined | null, now?: number): string;
15
+ /** Thousands-separated integer; `"—"` for missing input. */
16
+ export declare function formatCount(n: number | undefined | null): string;
17
+ /** Truncate with an ellipsis; never longer than `max` (including the ellipsis). */
18
+ export declare function truncate(text: string, max: number): string;
19
+ /**
20
+ * Shorten a `sha256:<hex>` digest for tables: keeps the algorithm prefix and
21
+ * the first `chars` hex digits. Non-prefixed strings are truncated as-is.
22
+ */
23
+ export declare function shortHash(hash: string | null | undefined, chars?: number): string;
24
+ /**
25
+ * Whether the principal may perform `action`, per `/config.allowed`. A config
26
+ * without `allowed` (older server, bare bootstrap) allows everything — the
27
+ * server stays the enforcement point; the UI only hides what it knows is denied.
28
+ */
29
+ export declare function can(config: Pick<AuditConfig, "allowed"> | undefined, action: PanelAction): boolean;
30
+ /** Primary display label for an actor: name, then email, then id. */
31
+ export declare function actorLabel(actor: AuditActor | undefined | null): string;
32
+ /** One target as `type name-or-id`. */
33
+ export declare function targetLabel(target: AuditTarget): string;
34
+ /** Targets summary for a table cell: the first target plus `+N` more. */
35
+ export declare function targetsSummary(targets: AuditTarget[] | undefined | null): string;
36
+ /** True for the `{ $erased: true }` marker that replaces an erased section. */
37
+ export declare function isErasedValue(value: unknown): boolean;
38
+ /** Sections erased after the fact (from the integrity block). */
39
+ export declare function erasedSections(event: Pick<AuditEvent, "integrity">): AuditSection[];
40
+ /** Tailwind classes for an outcome badge (flags/webhooks badge tone conventions). */
41
+ export declare function outcomeTone(outcome: AuditEvent["outcome"]): string;
42
+ /**
43
+ * Group the action catalog by `group`, ungrouped last. Groups sorted by name;
44
+ * entries sorted by name within a group.
45
+ */
46
+ export declare function groupActions(catalog: ActionDefinition[]): {
47
+ group: string;
48
+ actions: ActionDefinition[];
49
+ }[];
50
+ /** Whether the panel may edit a catalog entry: only UI-sourced ones (code is the source of truth). */
51
+ export declare function isEditableAction(action: ActionDefinition): boolean;
52
+ export type StreamHealth = "healthy" | "lagging" | "failing";
53
+ /** Health of one stream/tenant cursor: failing beats lagging beats healthy. */
54
+ export declare function streamHealth(row: {
55
+ lag: number;
56
+ failures: number;
57
+ }): StreamHealth;
58
+ /** Worst health across every tenant of every stream (overview tile). */
59
+ export declare function overallStreamHealth(streams: StreamStatus[]): StreamHealth;
60
+ /** Tailwind classes for a stream-health badge. */
61
+ export declare function streamHealthTone(health: StreamHealth): string;
62
+ /** Human label for a verify report's anchor. */
63
+ export declare function anchorLabel(anchor: VerifyReport["anchor"]): string;
64
+ export interface VerificationSummary {
65
+ tone: "ok" | "warn" | "fail";
66
+ /** One line: "Verified through #42", "3 issues found", … */
67
+ title: string;
68
+ /** Secondary line (signing key, unsigned tail, …). */
69
+ detail: string;
70
+ /** Key id of the checkpoint that signs `signedThrough`, when known. */
71
+ keyId?: string;
72
+ }
73
+ /**
74
+ * Condense a {@link VerifyReport} (plus the tenant's checkpoints, to name the
75
+ * signing key) into the portal badge copy: "Verified through #N, signed by key K".
76
+ */
77
+ export declare function verificationSummary(report: VerifyReport, checkpoints?: AuditCheckpoint[]): VerificationSummary;
78
+ /**
79
+ * Download filename for an export: the server's `content-disposition`
80
+ * filename when present, else `audit-<tenant>.<ext>`.
81
+ */
82
+ export declare function exportFileName(tenant: string, format: ExportFormat, contentDisposition?: string | null): string;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * A tiny process-wide navigation guard. A view with unsaved edits registers a
3
+ * blocker; the app's in-app navigation (tabs, project/env switch, opening another
4
+ * flag) calls {@link canLeave} first and aborts if the blocker says no.
5
+ *
6
+ * wouter has no built-in navigation blocker, so this bridges the dirty view to the
7
+ * navigation entry points without prop-drilling. Single active blocker (only one
8
+ * editor is open at a time).
9
+ *
10
+ * @module
11
+ */
12
+ /** Returns `true` if navigation is allowed, `false` to block it (e.g. user cancelled). */
13
+ type Blocker = () => boolean;
14
+ /** Register the current blocker (replaces any previous one). */
15
+ export declare function setNavBlocker(blocker: Blocker): void;
16
+ /** Clear `blocker` if it is still the active one (safe from stale cleanups). */
17
+ export declare function clearNavBlocker(blocker: Blocker): void;
18
+ /** Consult the active blocker. `true` when navigation may proceed. */
19
+ export declare function canLeave(): boolean;
20
+ export {};
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Where Base UI portals (Select/Combobox popups, Dialogs) render.
3
+ *
4
+ * In the **standalone SPA** the stylesheet is global, so portals default to
5
+ * `document.body` and look right. In the **React embed** the stylesheet is
6
+ * scoped under `.xtandard-audit` (see `scripts/scope-embed-css.ts`), so
7
+ * anything portaled to `document.body` would fall outside the scope and render
8
+ * unstyled. The embed therefore points portals at its own wrapper element via
9
+ * {@link setPortalContainerRef}, keeping popups inside the scoped subtree.
10
+ *
11
+ * Module-level singleton (same trade-off as `setApiBase`/`setApiToken`): one
12
+ * embed per page. Unset → portals default to `document.body`.
13
+ *
14
+ * @module
15
+ */
16
+ import type { RefObject } from "react";
17
+ /** Point portals at `ref` (the embed wrapper). Pass `undefined` to reset to the body default. */
18
+ export declare function setPortalContainerRef(ref: RefObject<HTMLElement | null> | undefined): void;
19
+ /**
20
+ * The current portal container ref, or `undefined` when none is set (Base UI
21
+ * then defaults to `document.body`). Pass the result to a Base UI
22
+ * `*.Portal container={…}` prop.
23
+ */
24
+ export declare function portalContainerRef(): RefObject<HTMLElement | null> | undefined;
@@ -0,0 +1,3 @@
1
+ import { type ClassValue } from "clsx";
2
+ /** Merge class names with Tailwind-aware de-duplication. */
3
+ export declare function cn(...inputs: ClassValue[]): string;
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Theme preference: `system` (follows the OS), `light`, or `dark`. The
3
+ * preference is persisted in localStorage; `system` live-updates when the OS
4
+ * scheme changes.
5
+ *
6
+ * The standalone SPA writes the resolved theme to `<html data-theme>` (see
7
+ * {@link initTheme}). The React embed never touches the host document: it puts
8
+ * `data-theme` on its own wrapper, either from this preference (`theme="auto"`)
9
+ * or from the host page's theme ({@link detectHostTheme}, `theme="inherit"`).
10
+ */
11
+ export type ThemePref = "system" | "light" | "dark";
12
+ /** A concrete, resolved theme. */
13
+ export type ResolvedTheme = "light" | "dark";
14
+ export declare function getThemePref(): ThemePref;
15
+ /** The concrete theme a preference resolves to right now. */
16
+ export declare function resolveTheme(pref: ThemePref): ResolvedTheme;
17
+ /** Persist a preference and notify subscribers (the SPA root, embedded dashboards). */
18
+ export declare function setThemePref(pref: ThemePref): void;
19
+ /** Subscribe to preference changes made via {@link setThemePref}. Returns an unsubscribe. */
20
+ export declare function subscribeThemePref(listener: (pref: ThemePref) => void): () => void;
21
+ /** Subscribe to OS color-scheme changes. Returns an unsubscribe. */
22
+ export declare function subscribeSystemTheme(listener: () => void): () => void;
23
+ /**
24
+ * Standalone SPA: apply the stored preference to `<html data-theme>`, follow
25
+ * later changes, and keep `system` in sync with the OS. Call once at boot.
26
+ */
27
+ export declare function initTheme(): void;
28
+ /**
29
+ * The host page's theme, for `theme="inherit"`: a `dark`/`light` class or
30
+ * `data-theme` attribute on `<html>` (then `<body>`) — the conventions used by
31
+ * class- and attribute-based theme switchers — falling back to the OS
32
+ * `prefers-color-scheme` when the host sets neither.
33
+ */
34
+ export declare function detectHostTheme(): ResolvedTheme;
35
+ /**
36
+ * Call `listener` whenever the host page's theme may have changed: `class` /
37
+ * `data-theme` / `style` mutations on `<html>` or `<body>`, or an OS scheme
38
+ * change. Returns an unsubscribe.
39
+ */
40
+ export declare function watchHostTheme(listener: () => void): () => void;
@@ -0,0 +1,67 @@
1
+ /**
2
+ * UI-facing types. Entity shapes are re-exported from the package schema and
3
+ * spine modules (types only — safe to bundle); the UI adds the bootstrap
4
+ * config, overview, API-error, and filter types the JSON admin API serves
5
+ * (see docs/HTTP_API.md).
6
+ */
7
+ export type { ActionDefinition, AuditActor, AuditCheckpoint, AuditContext, AuditEvent, AuditOutcome, AuditPage, AuditSection, AuditTarget, AuditTenant, ChainHead, JsonObject, JsonValue, } from "../schema.ts";
8
+ export type { VerifyIssue, VerifyIssueKind, VerifyReport } from "../integrity.ts";
9
+ export type { StreamStatus } from "../streams.ts";
10
+ import type { AuditEvent } from "../schema.ts";
11
+ import type { StreamStatus } from "../streams.ts";
12
+ /**
13
+ * An authorization action the panel checks (`event:read`, `event:erase`, …).
14
+ * The UI hides what `/config.allowed` does not list. Kept as an open string
15
+ * union so a newer server's actions don't break an older bundle.
16
+ */
17
+ export type PanelAction = "tenant:read" | "event:read" | "event:record" | "event:erase" | "event:export" | "integrity:read" | "integrity:checkpoint" | "retention:prune" | "action:read" | "action:update" | "action:delete" | "stream:read" | "stream:retry" | (string & {});
18
+ /** Bootstrap config injected as `window.__AUDIT_CONFIG__` and served at `/config`. */
19
+ export interface AuditConfig {
20
+ title: string;
21
+ basePath: string;
22
+ readonly: boolean;
23
+ logoUrl?: string;
24
+ /** True for portal-token principals: the UI renders the portal chrome. */
25
+ portal?: boolean;
26
+ /** The portal principal's tenant. */
27
+ tenant?: string;
28
+ principal?: {
29
+ id: string;
30
+ name?: string;
31
+ email?: string;
32
+ } | null;
33
+ /**
34
+ * Actions this principal may perform (the UI hides what it cannot do).
35
+ * Absent (older server / bare bootstrap) → everything is shown and the server
36
+ * stays the enforcement point.
37
+ */
38
+ allowed?: PanelAction[];
39
+ features?: {
40
+ signer: boolean;
41
+ streams: boolean;
42
+ };
43
+ }
44
+ /** `GET /api/overview`. */
45
+ export interface Overview {
46
+ tenants: number;
47
+ events: number;
48
+ /** Latest events across tenants (newest first). */
49
+ recent: AuditEvent[];
50
+ streams: StreamStatus[];
51
+ }
52
+ /** Export formats served by `GET /api/tenants/:tenant/export`. */
53
+ export type ExportFormat = "csv" | "json" | "jsonl" | "bundle";
54
+ export interface ApiError {
55
+ status: number;
56
+ error: string;
57
+ code?: string;
58
+ errors?: {
59
+ path?: string;
60
+ message: string;
61
+ }[];
62
+ }
63
+ export declare class AuditApiError extends Error {
64
+ readonly status: number;
65
+ readonly body: ApiError;
66
+ constructor(status: number, body: ApiError);
67
+ }
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import type { ShellContext } from "../App.tsx";
3
+ /**
4
+ * The action catalog: documentation for every action the log knows, grouped.
5
+ * Code-defined entries (`defineActions`) are read-only here — code is their
6
+ * source of truth; UI-sourced entries can be edited and deleted.
7
+ */
8
+ export declare function ActionsView({ ctx }: {
9
+ ctx: ShellContext;
10
+ }): React.JSX.Element;
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ import type { AuditEvent } from "../types.ts";
3
+ /**
4
+ * Event detail side sheet: actor/targets/context/metadata, the integrity block
5
+ * (seq, hash, prevHash, per-section digests, erased sections), copy buttons,
6
+ * and — for admins with `event:erase` — the erase action.
7
+ */
8
+ export declare function EventDrawer({ tenant, id, initial, canErase, onClose, }: {
9
+ tenant: string;
10
+ id: string;
11
+ /** The row as listed (shown instantly while the fresh copy loads). */
12
+ initial?: AuditEvent;
13
+ canErase: boolean;
14
+ onClose: () => void;
15
+ }): React.JSX.Element;