@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,15 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <link rel="icon" type="image/svg+xml" href="./assets/favicon-BSj8MPnj.svg" />
7
+ <title>@xtandard/audit</title>
8
+ <meta name="description" content="Admin panel and log viewer for @xtandard/audit" />
9
+ <script type="module" crossorigin src="./assets/index-DUAgpiot.js"></script>
10
+ <link rel="stylesheet" crossorigin href="./assets/index-Cd-mcIwC.css">
11
+ </head>
12
+ <body>
13
+ <div id="root"></div>
14
+ </body>
15
+ </html>
@@ -0,0 +1,150 @@
1
+ import * as v from "valibot";
2
+ //#region src/validation.ts
3
+ /**
4
+ * Runtime validation for record inputs and control-plane inputs, built on
5
+ * `valibot` (like the sibling packages). Action-specific `metadata` is validated
6
+ * separately by the host's Standard Schema validators (ADR 0012).
7
+ *
8
+ * @module
9
+ */
10
+ /** Allowed characters for tenant keys. */
11
+ const TENANT_REGEX = /^[a-zA-Z0-9_.:@-]+$/;
12
+ /** Allowed characters for action names (`invoice.paid`, `member:role_changed`). */
13
+ const ACTION_REGEX = /^[a-zA-Z0-9][a-zA-Z0-9._:-]*$/;
14
+ /** Maximum serialized size of one event's free-form sections, in bytes. Default for `maxEventBytes`. */
15
+ const DEFAULT_MAX_EVENT_BYTES = 65536;
16
+ /** Raised by {@link assertValid} when an input fails validation. Maps to HTTP 422. */
17
+ var ValidationError = class extends Error {
18
+ errors;
19
+ constructor(errors) {
20
+ super(`Validation failed:\n${errors.map((e) => ` - ${e.path}: ${e.message}`).join("\n")}`);
21
+ this.name = "ValidationError";
22
+ this.errors = errors;
23
+ }
24
+ };
25
+ /** Throw a {@link ValidationError} when `result` is invalid. */
26
+ function assertValid(result) {
27
+ if (!result.valid) throw new ValidationError(result.errors);
28
+ }
29
+ const jsonValueSchema = v.lazy(() => v.union([
30
+ v.string(),
31
+ v.pipe(v.number(), v.finite()),
32
+ v.boolean(),
33
+ v.null(),
34
+ v.array(jsonValueSchema),
35
+ v.record(v.string(), jsonValueSchema)
36
+ ]));
37
+ const jsonObjectSchema = v.record(v.string(), jsonValueSchema);
38
+ const tenantSchema = v.pipe(v.string(), v.minLength(1), v.maxLength(128), v.regex(TENANT_REGEX, "must match " + String(TENANT_REGEX)), v.check((s) => !/^\.+$/.test(s), "must not be only dots"));
39
+ const actionSchema = v.pipe(v.string(), v.minLength(1), v.maxLength(128), v.regex(ACTION_REGEX, "must match " + String(ACTION_REGEX)));
40
+ const idString = v.pipe(v.string(), v.minLength(1), v.maxLength(256));
41
+ const actorSchema = v.object({
42
+ id: idString,
43
+ type: v.optional(v.pipe(v.string(), v.minLength(1), v.maxLength(64))),
44
+ name: v.optional(v.pipe(v.string(), v.maxLength(256))),
45
+ email: v.optional(v.pipe(v.string(), v.maxLength(320))),
46
+ metadata: v.optional(jsonObjectSchema)
47
+ });
48
+ const targetSchema = v.object({
49
+ type: v.pipe(v.string(), v.minLength(1), v.maxLength(64)),
50
+ id: idString,
51
+ name: v.optional(v.pipe(v.string(), v.maxLength(256))),
52
+ metadata: v.optional(jsonObjectSchema)
53
+ });
54
+ const isoOrDate = v.union([v.date(), v.pipe(v.string(), v.check((s) => !Number.isNaN(Date.parse(s)), "must be an ISO-8601 timestamp"))]);
55
+ const eventInputSchema = v.object({
56
+ id: v.optional(v.pipe(v.string(), v.regex(/^evt_[0-9A-Za-z]{1,64}$/, "must look like evt_…"))),
57
+ tenant: tenantSchema,
58
+ action: actionSchema,
59
+ occurredAt: v.optional(isoOrDate),
60
+ actor: v.optional(actorSchema),
61
+ targets: v.optional(v.pipe(v.array(targetSchema), v.maxLength(64))),
62
+ context: v.optional(jsonObjectSchema),
63
+ metadata: v.optional(jsonObjectSchema),
64
+ outcome: v.optional(v.picklist(["success", "failure"])),
65
+ description: v.optional(v.pipe(v.string(), v.maxLength(2048)))
66
+ });
67
+ const actionDefinitionSchema = v.object({
68
+ name: actionSchema,
69
+ description: v.optional(v.pipe(v.string(), v.maxLength(2048))),
70
+ group: v.optional(v.pipe(v.string(), v.maxLength(128))),
71
+ targets: v.optional(v.array(v.pipe(v.string(), v.minLength(1), v.maxLength(64)))),
72
+ schema: v.optional(jsonValueSchema),
73
+ deprecated: v.optional(v.boolean()),
74
+ source: v.optional(v.picklist(["code", "ui"])),
75
+ createdAt: v.optional(v.string()),
76
+ updatedAt: v.optional(v.string())
77
+ });
78
+ function structuralIssues(issues, basePath) {
79
+ return issues.map((issue) => {
80
+ const sub = (issue.path ?? []).map((p) => String(p.key)).join(".");
81
+ return {
82
+ path: sub ? `${basePath}.${sub}` : basePath,
83
+ message: issue.message
84
+ };
85
+ });
86
+ }
87
+ /** Validate a tenant key. */
88
+ function validateTenant(tenant, basePath = "tenant") {
89
+ const r = v.safeParse(tenantSchema, tenant);
90
+ return r.success ? {
91
+ valid: true,
92
+ errors: []
93
+ } : {
94
+ valid: false,
95
+ errors: structuralIssues(r.issues, basePath)
96
+ };
97
+ }
98
+ /**
99
+ * Validate the structure of a record input (not the action's metadata schema).
100
+ *
101
+ * @example
102
+ * ```ts
103
+ * import { validateEventInput } from "@xtandard/audit";
104
+ *
105
+ * validateEventInput({ tenant: "acme", action: "invoice.paid", actor: { id: "u_1" } }).valid; // true
106
+ * ```
107
+ */
108
+ function validateEventInput(input, options = {}) {
109
+ const basePath = options.basePath ?? "event";
110
+ const r = v.safeParse(eventInputSchema, input);
111
+ if (!r.success) return {
112
+ valid: false,
113
+ errors: structuralIssues(r.issues, basePath)
114
+ };
115
+ const e = input;
116
+ const max = options.maxEventBytes ?? 65536;
117
+ const size = new TextEncoder().encode(JSON.stringify([
118
+ e.actor,
119
+ e.targets,
120
+ e.context,
121
+ e.metadata,
122
+ e.description
123
+ ])).length;
124
+ if (size > max) return {
125
+ valid: false,
126
+ errors: [{
127
+ path: basePath,
128
+ message: `event is ${size} bytes; the limit is ${max}`
129
+ }]
130
+ };
131
+ return {
132
+ valid: true,
133
+ errors: []
134
+ };
135
+ }
136
+ /** Validate an action catalog entry. */
137
+ function validateActionDefinition(input, basePath = "action") {
138
+ const r = v.safeParse(actionDefinitionSchema, input);
139
+ return r.success ? {
140
+ valid: true,
141
+ errors: []
142
+ } : {
143
+ valid: false,
144
+ errors: structuralIssues(r.issues, basePath)
145
+ };
146
+ }
147
+ //#endregion
148
+ export { assertValid as a, validateTenant as c, ValidationError as i, DEFAULT_MAX_EVENT_BYTES as n, validateActionDefinition as o, TENANT_REGEX as r, validateEventInput as s, ACTION_REGEX as t };
149
+
150
+ //# sourceMappingURL=validation-DFrLESZD.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation-DFrLESZD.mjs","names":[],"sources":["../src/validation.ts"],"sourcesContent":["/**\n * Runtime validation for record inputs and control-plane inputs, built on\n * `valibot` (like the sibling packages). Action-specific `metadata` is validated\n * separately by the host's Standard Schema validators (ADR 0012).\n *\n * @module\n */\n\nimport * as v from \"valibot\";\nimport type { AuditEventInput } from \"./schema.ts\";\n\n/** Allowed characters for tenant keys. */\nexport const TENANT_REGEX = /^[a-zA-Z0-9_.:@-]+$/;\n/** Allowed characters for action names (`invoice.paid`, `member:role_changed`). */\nexport const ACTION_REGEX = /^[a-zA-Z0-9][a-zA-Z0-9._:-]*$/;\n/** Maximum serialized size of one event's free-form sections, in bytes. Default for `maxEventBytes`. */\nexport const DEFAULT_MAX_EVENT_BYTES = 65_536;\n\n/** A single validation problem with a dotted path into the offending data. */\nexport interface ValidationIssue {\n path: string;\n message: string;\n}\n\n/** Result of the `validate*` functions. */\nexport interface ValidationResult {\n valid: boolean;\n errors: ValidationIssue[];\n}\n\n/** Raised by {@link assertValid} when an input fails validation. Maps to HTTP 422. */\nexport class ValidationError extends Error {\n readonly errors: ValidationIssue[];\n constructor(errors: ValidationIssue[]) {\n super(`Validation failed:\\n${errors.map((e) => ` - ${e.path}: ${e.message}`).join(\"\\n\")}`);\n this.name = \"ValidationError\";\n this.errors = errors;\n }\n}\n\n/** Throw a {@link ValidationError} when `result` is invalid. */\nexport function assertValid(result: ValidationResult): void {\n if (!result.valid) throw new ValidationError(result.errors);\n}\n\nconst jsonValueSchema: v.GenericSchema<unknown> = v.lazy(() =>\n v.union([\n v.string(),\n v.pipe(v.number(), v.finite()),\n v.boolean(),\n v.null(),\n v.array(jsonValueSchema),\n v.record(v.string(), jsonValueSchema),\n ]),\n);\n\nconst jsonObjectSchema = v.record(v.string(), jsonValueSchema);\n\nconst tenantSchema = v.pipe(\n v.string(),\n v.minLength(1),\n v.maxLength(128),\n v.regex(TENANT_REGEX, \"must match \" + String(TENANT_REGEX)),\n v.check((s) => !/^\\.+$/.test(s), \"must not be only dots\"),\n);\n\nconst actionSchema = v.pipe(\n v.string(),\n v.minLength(1),\n v.maxLength(128),\n v.regex(ACTION_REGEX, \"must match \" + String(ACTION_REGEX)),\n);\n\nconst idString = v.pipe(v.string(), v.minLength(1), v.maxLength(256));\n\nconst actorSchema = v.object({\n id: idString,\n type: v.optional(v.pipe(v.string(), v.minLength(1), v.maxLength(64))),\n name: v.optional(v.pipe(v.string(), v.maxLength(256))),\n email: v.optional(v.pipe(v.string(), v.maxLength(320))),\n metadata: v.optional(jsonObjectSchema),\n});\n\nconst targetSchema = v.object({\n type: v.pipe(v.string(), v.minLength(1), v.maxLength(64)),\n id: idString,\n name: v.optional(v.pipe(v.string(), v.maxLength(256))),\n metadata: v.optional(jsonObjectSchema),\n});\n\nconst isoOrDate = v.union([\n v.date(),\n v.pipe(\n v.string(),\n v.check((s) => !Number.isNaN(Date.parse(s)), \"must be an ISO-8601 timestamp\"),\n ),\n]);\n\nconst eventInputSchema = v.object({\n id: v.optional(v.pipe(v.string(), v.regex(/^evt_[0-9A-Za-z]{1,64}$/, \"must look like evt_…\"))),\n tenant: tenantSchema,\n action: actionSchema,\n occurredAt: v.optional(isoOrDate),\n actor: v.optional(actorSchema),\n targets: v.optional(v.pipe(v.array(targetSchema), v.maxLength(64))),\n context: v.optional(jsonObjectSchema),\n metadata: v.optional(jsonObjectSchema),\n outcome: v.optional(v.picklist([\"success\", \"failure\"])),\n description: v.optional(v.pipe(v.string(), v.maxLength(2048))),\n});\n\nconst actionDefinitionSchema = v.object({\n name: actionSchema,\n description: v.optional(v.pipe(v.string(), v.maxLength(2048))),\n group: v.optional(v.pipe(v.string(), v.maxLength(128))),\n targets: v.optional(v.array(v.pipe(v.string(), v.minLength(1), v.maxLength(64)))),\n schema: v.optional(jsonValueSchema),\n deprecated: v.optional(v.boolean()),\n source: v.optional(v.picklist([\"code\", \"ui\"])),\n createdAt: v.optional(v.string()),\n updatedAt: v.optional(v.string()),\n});\n\nfunction structuralIssues(\n issues: readonly v.BaseIssue<unknown>[],\n basePath: string,\n): ValidationIssue[] {\n return issues.map((issue) => {\n const sub = (issue.path ?? []).map((p) => String(p.key)).join(\".\");\n return { path: sub ? `${basePath}.${sub}` : basePath, message: issue.message };\n });\n}\n\n/** Validate a tenant key. */\nexport function validateTenant(tenant: unknown, basePath = \"tenant\"): ValidationResult {\n const r = v.safeParse(tenantSchema, tenant);\n return r.success\n ? { valid: true, errors: [] }\n : { valid: false, errors: structuralIssues(r.issues, basePath) };\n}\n\n/**\n * Validate the structure of a record input (not the action's metadata schema).\n *\n * @example\n * ```ts\n * import { validateEventInput } from \"@xtandard/audit\";\n *\n * validateEventInput({ tenant: \"acme\", action: \"invoice.paid\", actor: { id: \"u_1\" } }).valid; // true\n * ```\n */\nexport function validateEventInput(\n input: unknown,\n options: { maxEventBytes?: number; basePath?: string } = {},\n): ValidationResult {\n const basePath = options.basePath ?? \"event\";\n const r = v.safeParse(eventInputSchema, input);\n if (!r.success) return { valid: false, errors: structuralIssues(r.issues, basePath) };\n const e = input as AuditEventInput;\n const max = options.maxEventBytes ?? DEFAULT_MAX_EVENT_BYTES;\n const size = new TextEncoder().encode(\n JSON.stringify([e.actor, e.targets, e.context, e.metadata, e.description]),\n ).length;\n if (size > max) {\n return {\n valid: false,\n errors: [{ path: basePath, message: `event is ${size} bytes; the limit is ${max}` }],\n };\n }\n return { valid: true, errors: [] };\n}\n\n/** Validate an action catalog entry. */\nexport function validateActionDefinition(input: unknown, basePath = \"action\"): ValidationResult {\n const r = v.safeParse(actionDefinitionSchema, input);\n return r.success\n ? { valid: true, errors: [] }\n : { valid: false, errors: structuralIssues(r.issues, basePath) };\n}\n"],"mappings":";;;;;;;;;;AAYA,MAAa,eAAe;;AAE5B,MAAa,eAAe;;AAE5B,MAAa,0BAA0B;;AAevC,IAAa,kBAAb,cAAqC,MAAM;CACzC;CACA,YAAY,QAA2B;EACrC,MAAM,uBAAuB,OAAO,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AE;EAAS,EAAE;EAAS,EAAE;EAAU,EAAE;CAAW,CAAC,CAC3E,EAAE;CACF,IAAI,OAAO,KACT,OAAO;EACL,OAAO;EACP,QAAQ,CAAC;GAAE,MAAM;GAAU,SAAS,YAAY,KAAK,uBAAuB;EAAM,CAAC;CACrF;CAEF,OAAO;EAAE,OAAO;EAAM,QAAQ,CAAC;CAAE;AACnC;;AAGA,SAAgB,yBAAyB,OAAgB,WAAW,UAA4B;CAC9F,MAAM,IAAI,EAAE,UAAU,wBAAwB,KAAK;CACnD,OAAO,EAAE,UACL;EAAE,OAAO;EAAM,QAAQ,CAAC;CAAE,IAC1B;EAAE,OAAO;EAAO,QAAQ,iBAAiB,EAAE,QAAQ,QAAQ;CAAE;AACnE"}
@@ -0,0 +1,235 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __exportAll = (all, no_symbols) => {
9
+ let target = {};
10
+ for (var name in all) __defProp(target, name, {
11
+ get: all[name],
12
+ enumerable: true
13
+ });
14
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
15
+ return target;
16
+ };
17
+ var __copyProps = (to, from, except, desc) => {
18
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
19
+ key = keys[i];
20
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
21
+ get: ((k) => from[k]).bind(null, key),
22
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
23
+ });
24
+ }
25
+ return to;
26
+ };
27
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
28
+ value: mod,
29
+ enumerable: true
30
+ }) : target, mod));
31
+ //#endregion
32
+ let valibot = require("valibot");
33
+ valibot = __toESM(valibot, 1);
34
+ //#region src/validation.ts
35
+ /**
36
+ * Runtime validation for record inputs and control-plane inputs, built on
37
+ * `valibot` (like the sibling packages). Action-specific `metadata` is validated
38
+ * separately by the host's Standard Schema validators (ADR 0012).
39
+ *
40
+ * @module
41
+ */
42
+ /** Allowed characters for tenant keys. */
43
+ const TENANT_REGEX = /^[a-zA-Z0-9_.:@-]+$/;
44
+ /** Allowed characters for action names (`invoice.paid`, `member:role_changed`). */
45
+ const ACTION_REGEX = /^[a-zA-Z0-9][a-zA-Z0-9._:-]*$/;
46
+ /** Maximum serialized size of one event's free-form sections, in bytes. Default for `maxEventBytes`. */
47
+ const DEFAULT_MAX_EVENT_BYTES = 65536;
48
+ /** Raised by {@link assertValid} when an input fails validation. Maps to HTTP 422. */
49
+ var ValidationError = class extends Error {
50
+ errors;
51
+ constructor(errors) {
52
+ super(`Validation failed:\n${errors.map((e) => ` - ${e.path}: ${e.message}`).join("\n")}`);
53
+ this.name = "ValidationError";
54
+ this.errors = errors;
55
+ }
56
+ };
57
+ /** Throw a {@link ValidationError} when `result` is invalid. */
58
+ function assertValid(result) {
59
+ if (!result.valid) throw new ValidationError(result.errors);
60
+ }
61
+ const jsonValueSchema = valibot.lazy(() => valibot.union([
62
+ valibot.string(),
63
+ valibot.pipe(valibot.number(), valibot.finite()),
64
+ valibot.boolean(),
65
+ valibot.null(),
66
+ valibot.array(jsonValueSchema),
67
+ valibot.record(valibot.string(), jsonValueSchema)
68
+ ]));
69
+ const jsonObjectSchema = valibot.record(valibot.string(), jsonValueSchema);
70
+ const tenantSchema = valibot.pipe(valibot.string(), valibot.minLength(1), valibot.maxLength(128), valibot.regex(TENANT_REGEX, "must match " + String(TENANT_REGEX)), valibot.check((s) => !/^\.+$/.test(s), "must not be only dots"));
71
+ const actionSchema = valibot.pipe(valibot.string(), valibot.minLength(1), valibot.maxLength(128), valibot.regex(ACTION_REGEX, "must match " + String(ACTION_REGEX)));
72
+ const idString = valibot.pipe(valibot.string(), valibot.minLength(1), valibot.maxLength(256));
73
+ const actorSchema = valibot.object({
74
+ id: idString,
75
+ type: valibot.optional(valibot.pipe(valibot.string(), valibot.minLength(1), valibot.maxLength(64))),
76
+ name: valibot.optional(valibot.pipe(valibot.string(), valibot.maxLength(256))),
77
+ email: valibot.optional(valibot.pipe(valibot.string(), valibot.maxLength(320))),
78
+ metadata: valibot.optional(jsonObjectSchema)
79
+ });
80
+ const targetSchema = valibot.object({
81
+ type: valibot.pipe(valibot.string(), valibot.minLength(1), valibot.maxLength(64)),
82
+ id: idString,
83
+ name: valibot.optional(valibot.pipe(valibot.string(), valibot.maxLength(256))),
84
+ metadata: valibot.optional(jsonObjectSchema)
85
+ });
86
+ const isoOrDate = valibot.union([valibot.date(), valibot.pipe(valibot.string(), valibot.check((s) => !Number.isNaN(Date.parse(s)), "must be an ISO-8601 timestamp"))]);
87
+ const eventInputSchema = valibot.object({
88
+ id: valibot.optional(valibot.pipe(valibot.string(), valibot.regex(/^evt_[0-9A-Za-z]{1,64}$/, "must look like evt_…"))),
89
+ tenant: tenantSchema,
90
+ action: actionSchema,
91
+ occurredAt: valibot.optional(isoOrDate),
92
+ actor: valibot.optional(actorSchema),
93
+ targets: valibot.optional(valibot.pipe(valibot.array(targetSchema), valibot.maxLength(64))),
94
+ context: valibot.optional(jsonObjectSchema),
95
+ metadata: valibot.optional(jsonObjectSchema),
96
+ outcome: valibot.optional(valibot.picklist(["success", "failure"])),
97
+ description: valibot.optional(valibot.pipe(valibot.string(), valibot.maxLength(2048)))
98
+ });
99
+ const actionDefinitionSchema = valibot.object({
100
+ name: actionSchema,
101
+ description: valibot.optional(valibot.pipe(valibot.string(), valibot.maxLength(2048))),
102
+ group: valibot.optional(valibot.pipe(valibot.string(), valibot.maxLength(128))),
103
+ targets: valibot.optional(valibot.array(valibot.pipe(valibot.string(), valibot.minLength(1), valibot.maxLength(64)))),
104
+ schema: valibot.optional(jsonValueSchema),
105
+ deprecated: valibot.optional(valibot.boolean()),
106
+ source: valibot.optional(valibot.picklist(["code", "ui"])),
107
+ createdAt: valibot.optional(valibot.string()),
108
+ updatedAt: valibot.optional(valibot.string())
109
+ });
110
+ function structuralIssues(issues, basePath) {
111
+ return issues.map((issue) => {
112
+ const sub = (issue.path ?? []).map((p) => String(p.key)).join(".");
113
+ return {
114
+ path: sub ? `${basePath}.${sub}` : basePath,
115
+ message: issue.message
116
+ };
117
+ });
118
+ }
119
+ /** Validate a tenant key. */
120
+ function validateTenant(tenant, basePath = "tenant") {
121
+ const r = valibot.safeParse(tenantSchema, tenant);
122
+ return r.success ? {
123
+ valid: true,
124
+ errors: []
125
+ } : {
126
+ valid: false,
127
+ errors: structuralIssues(r.issues, basePath)
128
+ };
129
+ }
130
+ /**
131
+ * Validate the structure of a record input (not the action's metadata schema).
132
+ *
133
+ * @example
134
+ * ```ts
135
+ * import { validateEventInput } from "@xtandard/audit";
136
+ *
137
+ * validateEventInput({ tenant: "acme", action: "invoice.paid", actor: { id: "u_1" } }).valid; // true
138
+ * ```
139
+ */
140
+ function validateEventInput(input, options = {}) {
141
+ const basePath = options.basePath ?? "event";
142
+ const r = valibot.safeParse(eventInputSchema, input);
143
+ if (!r.success) return {
144
+ valid: false,
145
+ errors: structuralIssues(r.issues, basePath)
146
+ };
147
+ const e = input;
148
+ const max = options.maxEventBytes ?? 65536;
149
+ const size = new TextEncoder().encode(JSON.stringify([
150
+ e.actor,
151
+ e.targets,
152
+ e.context,
153
+ e.metadata,
154
+ e.description
155
+ ])).length;
156
+ if (size > max) return {
157
+ valid: false,
158
+ errors: [{
159
+ path: basePath,
160
+ message: `event is ${size} bytes; the limit is ${max}`
161
+ }]
162
+ };
163
+ return {
164
+ valid: true,
165
+ errors: []
166
+ };
167
+ }
168
+ /** Validate an action catalog entry. */
169
+ function validateActionDefinition(input, basePath = "action") {
170
+ const r = valibot.safeParse(actionDefinitionSchema, input);
171
+ return r.success ? {
172
+ valid: true,
173
+ errors: []
174
+ } : {
175
+ valid: false,
176
+ errors: structuralIssues(r.issues, basePath)
177
+ };
178
+ }
179
+ //#endregion
180
+ Object.defineProperty(exports, "ACTION_REGEX", {
181
+ enumerable: true,
182
+ get: function() {
183
+ return ACTION_REGEX;
184
+ }
185
+ });
186
+ Object.defineProperty(exports, "DEFAULT_MAX_EVENT_BYTES", {
187
+ enumerable: true,
188
+ get: function() {
189
+ return DEFAULT_MAX_EVENT_BYTES;
190
+ }
191
+ });
192
+ Object.defineProperty(exports, "TENANT_REGEX", {
193
+ enumerable: true,
194
+ get: function() {
195
+ return TENANT_REGEX;
196
+ }
197
+ });
198
+ Object.defineProperty(exports, "ValidationError", {
199
+ enumerable: true,
200
+ get: function() {
201
+ return ValidationError;
202
+ }
203
+ });
204
+ Object.defineProperty(exports, "__exportAll", {
205
+ enumerable: true,
206
+ get: function() {
207
+ return __exportAll;
208
+ }
209
+ });
210
+ Object.defineProperty(exports, "assertValid", {
211
+ enumerable: true,
212
+ get: function() {
213
+ return assertValid;
214
+ }
215
+ });
216
+ Object.defineProperty(exports, "validateActionDefinition", {
217
+ enumerable: true,
218
+ get: function() {
219
+ return validateActionDefinition;
220
+ }
221
+ });
222
+ Object.defineProperty(exports, "validateEventInput", {
223
+ enumerable: true,
224
+ get: function() {
225
+ return validateEventInput;
226
+ }
227
+ });
228
+ Object.defineProperty(exports, "validateTenant", {
229
+ enumerable: true,
230
+ get: function() {
231
+ return validateTenant;
232
+ }
233
+ });
234
+
235
+ //# sourceMappingURL=validation-lb0YXrxx.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation-lb0YXrxx.cjs","names":["v"],"sources":["../src/validation.ts"],"sourcesContent":["/**\n * Runtime validation for record inputs and control-plane inputs, built on\n * `valibot` (like the sibling packages). Action-specific `metadata` is validated\n * separately by the host's Standard Schema validators (ADR 0012).\n *\n * @module\n */\n\nimport * as v from \"valibot\";\nimport type { AuditEventInput } from \"./schema.ts\";\n\n/** Allowed characters for tenant keys. */\nexport const TENANT_REGEX = /^[a-zA-Z0-9_.:@-]+$/;\n/** Allowed characters for action names (`invoice.paid`, `member:role_changed`). */\nexport const ACTION_REGEX = /^[a-zA-Z0-9][a-zA-Z0-9._:-]*$/;\n/** Maximum serialized size of one event's free-form sections, in bytes. Default for `maxEventBytes`. */\nexport const DEFAULT_MAX_EVENT_BYTES = 65_536;\n\n/** A single validation problem with a dotted path into the offending data. */\nexport interface ValidationIssue {\n path: string;\n message: string;\n}\n\n/** Result of the `validate*` functions. */\nexport interface ValidationResult {\n valid: boolean;\n errors: ValidationIssue[];\n}\n\n/** Raised by {@link assertValid} when an input fails validation. Maps to HTTP 422. */\nexport class ValidationError extends Error {\n readonly errors: ValidationIssue[];\n constructor(errors: ValidationIssue[]) {\n super(`Validation failed:\\n${errors.map((e) => ` - ${e.path}: ${e.message}`).join(\"\\n\")}`);\n this.name = \"ValidationError\";\n this.errors = errors;\n }\n}\n\n/** Throw a {@link ValidationError} when `result` is invalid. */\nexport function assertValid(result: ValidationResult): void {\n if (!result.valid) throw new ValidationError(result.errors);\n}\n\nconst jsonValueSchema: v.GenericSchema<unknown> = v.lazy(() =>\n v.union([\n v.string(),\n v.pipe(v.number(), v.finite()),\n v.boolean(),\n v.null(),\n v.array(jsonValueSchema),\n v.record(v.string(), jsonValueSchema),\n ]),\n);\n\nconst jsonObjectSchema = v.record(v.string(), jsonValueSchema);\n\nconst tenantSchema = v.pipe(\n v.string(),\n v.minLength(1),\n v.maxLength(128),\n v.regex(TENANT_REGEX, \"must match \" + String(TENANT_REGEX)),\n v.check((s) => !/^\\.+$/.test(s), \"must not be only dots\"),\n);\n\nconst actionSchema = v.pipe(\n v.string(),\n v.minLength(1),\n v.maxLength(128),\n v.regex(ACTION_REGEX, \"must match \" + String(ACTION_REGEX)),\n);\n\nconst idString = v.pipe(v.string(), v.minLength(1), v.maxLength(256));\n\nconst actorSchema = v.object({\n id: idString,\n type: v.optional(v.pipe(v.string(), v.minLength(1), v.maxLength(64))),\n name: v.optional(v.pipe(v.string(), v.maxLength(256))),\n email: v.optional(v.pipe(v.string(), v.maxLength(320))),\n metadata: v.optional(jsonObjectSchema),\n});\n\nconst targetSchema = v.object({\n type: v.pipe(v.string(), v.minLength(1), v.maxLength(64)),\n id: idString,\n name: v.optional(v.pipe(v.string(), v.maxLength(256))),\n metadata: v.optional(jsonObjectSchema),\n});\n\nconst isoOrDate = v.union([\n v.date(),\n v.pipe(\n v.string(),\n v.check((s) => !Number.isNaN(Date.parse(s)), \"must be an ISO-8601 timestamp\"),\n ),\n]);\n\nconst eventInputSchema = v.object({\n id: v.optional(v.pipe(v.string(), v.regex(/^evt_[0-9A-Za-z]{1,64}$/, \"must look like evt_…\"))),\n tenant: tenantSchema,\n action: actionSchema,\n occurredAt: v.optional(isoOrDate),\n actor: v.optional(actorSchema),\n targets: v.optional(v.pipe(v.array(targetSchema), v.maxLength(64))),\n context: v.optional(jsonObjectSchema),\n metadata: v.optional(jsonObjectSchema),\n outcome: v.optional(v.picklist([\"success\", \"failure\"])),\n description: v.optional(v.pipe(v.string(), v.maxLength(2048))),\n});\n\nconst actionDefinitionSchema = v.object({\n name: actionSchema,\n description: v.optional(v.pipe(v.string(), v.maxLength(2048))),\n group: v.optional(v.pipe(v.string(), v.maxLength(128))),\n targets: v.optional(v.array(v.pipe(v.string(), v.minLength(1), v.maxLength(64)))),\n schema: v.optional(jsonValueSchema),\n deprecated: v.optional(v.boolean()),\n source: v.optional(v.picklist([\"code\", \"ui\"])),\n createdAt: v.optional(v.string()),\n updatedAt: v.optional(v.string()),\n});\n\nfunction structuralIssues(\n issues: readonly v.BaseIssue<unknown>[],\n basePath: string,\n): ValidationIssue[] {\n return issues.map((issue) => {\n const sub = (issue.path ?? []).map((p) => String(p.key)).join(\".\");\n return { path: sub ? `${basePath}.${sub}` : basePath, message: issue.message };\n });\n}\n\n/** Validate a tenant key. */\nexport function validateTenant(tenant: unknown, basePath = \"tenant\"): ValidationResult {\n const r = v.safeParse(tenantSchema, tenant);\n return r.success\n ? { valid: true, errors: [] }\n : { valid: false, errors: structuralIssues(r.issues, basePath) };\n}\n\n/**\n * Validate the structure of a record input (not the action's metadata schema).\n *\n * @example\n * ```ts\n * import { validateEventInput } from \"@xtandard/audit\";\n *\n * validateEventInput({ tenant: \"acme\", action: \"invoice.paid\", actor: { id: \"u_1\" } }).valid; // true\n * ```\n */\nexport function validateEventInput(\n input: unknown,\n options: { maxEventBytes?: number; basePath?: string } = {},\n): ValidationResult {\n const basePath = options.basePath ?? \"event\";\n const r = v.safeParse(eventInputSchema, input);\n if (!r.success) return { valid: false, errors: structuralIssues(r.issues, basePath) };\n const e = input as AuditEventInput;\n const max = options.maxEventBytes ?? DEFAULT_MAX_EVENT_BYTES;\n const size = new TextEncoder().encode(\n JSON.stringify([e.actor, e.targets, e.context, e.metadata, e.description]),\n ).length;\n if (size > max) {\n return {\n valid: false,\n errors: [{ path: basePath, message: `event is ${size} bytes; the limit is ${max}` }],\n };\n }\n return { valid: true, errors: [] };\n}\n\n/** Validate an action catalog entry. */\nexport function validateActionDefinition(input: unknown, basePath = \"action\"): ValidationResult {\n const r = v.safeParse(actionDefinitionSchema, input);\n return r.success\n ? { valid: true, errors: [] }\n : { valid: false, errors: structuralIssues(r.issues, basePath) };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,MAAa,eAAe;;AAE5B,MAAa,eAAe;;AAE5B,MAAa,0BAA0B;;AAevC,IAAa,kBAAb,cAAqC,MAAM;CACzC;CACA,YAAY,QAA2B;EACrC,MAAM,uBAAuB,OAAO,KAAK,MAAM,OAAO,EAAE,KAAK,IAAI,EAAE,SAAS,EAAE,KAAK,IAAI,GAAG;EAC1F,KAAK,OAAO;EACZ,KAAK,SAAS;CAChB;AACF;;AAGA,SAAgB,YAAY,QAAgC;CAC1D,IAAI,CAAC,OAAO,OAAO,MAAM,IAA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O;EACL,OAAO;EACP,QAAQ,CAAC;GAAE,MAAM;GAAU,SAAS,YAAY,KAAK,uBAAuB;EAAM,CAAC;CACrF;CAEF,OAAO;EAAE,OAAO;EAAM,QAAQ,CAAC;CAAE;AACnC;;AAGA,SAAgB,yBAAyB,OAAgB,WAAW,UAA4B;CAC9F,MAAM,IAAIA,QAAE,UAAU,wBAAwB,KAAK;CACnD,OAAO,EAAE,UACL;EAAE,OAAO;EAAM,QAAQ,CAAC;CAAE,IAC1B;EAAE,OAAO;EAAO,QAAQ,iBAAiB,EAAE,QAAQ,QAAQ;CAAE;AACnE"}
@@ -0,0 +1,14 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_integrity = require("./integrity-BHhjTBNk.cjs");
3
+ const require_export = require("./export-DYfMd-ep.cjs");
4
+ exports.GENESIS_HASH = require_integrity.GENESIS_HASH;
5
+ exports.canonicalStringify = require_integrity.canonicalStringify;
6
+ exports.ed25519VerificationKey = require_integrity.ed25519VerificationKey;
7
+ exports.hmacVerificationKey = require_integrity.hmacVerificationKey;
8
+ exports.keysFromJwks = require_integrity.keysFromJwks;
9
+ exports.parseBundle = require_export.parseBundle;
10
+ exports.sha256 = require_integrity.sha256;
11
+ exports.verifyBundle = require_export.verifyBundle;
12
+ exports.verifyChain = require_integrity.verifyChain;
13
+ exports.verifyCheckpointSignature = require_integrity.verifyCheckpointSignature;
14
+ exports.verifyEvent = require_integrity.verifyEvent;
@@ -0,0 +1,5 @@
1
+ import { i as AuditCheckpoint, s as AuditEvent } from "./schema-DmU7Wp0F.cjs";
2
+ import { $ as verifyCheckpointSignature, F as VerifyChainOptions, G as hmacVerificationKey, H as ed25519VerificationKey, I as VerifyIssue, K as keysFromJwks, L as VerifyIssueKind, N as AuditVerificationKey, P as GENESIS_HASH, Q as verifyChain, R as VerifyReport, X as sha256, et as verifyEvent } from "./core-C0ceVOTk.cjs";
3
+ import { d as verifyBundle, o as ParsedBundle, t as BundleHeader, u as parseBundle } from "./export-Dh8T8I1p.cjs";
4
+ import { t as canonicalStringify } from "./canonical-BOgkrX9_.cjs";
5
+ export { type AuditCheckpoint, type AuditEvent, type AuditVerificationKey, type BundleHeader, GENESIS_HASH, type ParsedBundle, type VerifyChainOptions, type VerifyIssue, type VerifyIssueKind, type VerifyReport, canonicalStringify, ed25519VerificationKey, hmacVerificationKey, keysFromJwks, parseBundle, sha256, verifyBundle, verifyChain, verifyCheckpointSignature, verifyEvent };
@@ -0,0 +1,5 @@
1
+ import { i as AuditCheckpoint, s as AuditEvent } from "./schema-DmU7Wp0F.mjs";
2
+ import { $ as verifyCheckpointSignature, F as VerifyChainOptions, G as hmacVerificationKey, H as ed25519VerificationKey, I as VerifyIssue, K as keysFromJwks, L as VerifyIssueKind, N as AuditVerificationKey, P as GENESIS_HASH, Q as verifyChain, R as VerifyReport, X as sha256, et as verifyEvent } from "./core-KtEHRScZ.mjs";
3
+ import { d as verifyBundle, o as ParsedBundle, t as BundleHeader, u as parseBundle } from "./export-BZq0KCCn.mjs";
4
+ import { t as canonicalStringify } from "./canonical-CL7gfwhb.mjs";
5
+ export { type AuditCheckpoint, type AuditEvent, type AuditVerificationKey, type BundleHeader, GENESIS_HASH, type ParsedBundle, type VerifyChainOptions, type VerifyIssue, type VerifyIssueKind, type VerifyReport, canonicalStringify, ed25519VerificationKey, hmacVerificationKey, keysFromJwks, parseBundle, sha256, verifyBundle, verifyChain, verifyCheckpointSignature, verifyEvent };
@@ -0,0 +1,3 @@
1
+ import { S as canonicalStringify, _ as sha256, b as verifyCheckpointSignature, d as hmacVerificationKey, f as keysFromJwks, s as ed25519VerificationKey, t as GENESIS_HASH, x as verifyEvent, y as verifyChain } from "./integrity-kfY2DNAi.mjs";
2
+ import { o as parseBundle, s as verifyBundle } from "./export-B9S-JeYl.mjs";
3
+ export { GENESIS_HASH, canonicalStringify, ed25519VerificationKey, hmacVerificationKey, keysFromJwks, parseBundle, sha256, verifyBundle, verifyChain, verifyCheckpointSignature, verifyEvent };