@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.
- package/LICENSE +21 -0
- package/README.md +384 -2
- package/bin/xtandard-audit.mjs +3 -0
- package/dist/basic-DU_nPrWV.mjs +176 -0
- package/dist/basic-DU_nPrWV.mjs.map +1 -0
- package/dist/basic-hcXnMF9X.cjs +199 -0
- package/dist/basic-hcXnMF9X.cjs.map +1 -0
- package/dist/canonical-BOgkrX9_.d.cts +17 -0
- package/dist/canonical-CL7gfwhb.d.mts +17 -0
- package/dist/chunk-D7D4PA-g.mjs +13 -0
- package/dist/cli.cjs +773 -0
- package/dist/cli.cjs.map +1 -0
- package/dist/cli.d.cts +46 -0
- package/dist/cli.d.mts +46 -0
- package/dist/cli.mjs +762 -0
- package/dist/cli.mjs.map +1 -0
- package/dist/context-BtR9k9Mt.d.mts +52 -0
- package/dist/context-CJM87uG8.d.cts +52 -0
- package/dist/context-shared-AgBWIRUQ.d.mts +29 -0
- package/dist/context-shared-CUq3cSpV.d.cts +29 -0
- package/dist/context-shared-CupikwQo.mjs +39 -0
- package/dist/context-shared-CupikwQo.mjs.map +1 -0
- package/dist/context-shared-X2ulHHSB.cjs +44 -0
- package/dist/context-shared-X2ulHHSB.cjs.map +1 -0
- package/dist/context.cjs +82 -0
- package/dist/context.cjs.map +1 -0
- package/dist/context.d.cts +2 -0
- package/dist/context.d.mts +2 -0
- package/dist/context.mjs +78 -0
- package/dist/context.mjs.map +1 -0
- package/dist/contract-BljSE-Hx.mjs +33 -0
- package/dist/contract-BljSE-Hx.mjs.map +1 -0
- package/dist/contract-BmwHIiMR.d.mts +150 -0
- package/dist/contract-CWJSYoJl.d.cts +150 -0
- package/dist/contract-Cht05WYQ.d.mts +159 -0
- package/dist/contract-CqYQzB6e.d.cts +49 -0
- package/dist/contract-DYvBNdnR.cjs +74 -0
- package/dist/contract-DYvBNdnR.cjs.map +1 -0
- package/dist/contract-DlTo4u2t.d.cts +30 -0
- package/dist/contract-DlTo4u2t.d.mts +30 -0
- package/dist/contract-DsVL5-gy.cjs +50 -0
- package/dist/contract-DsVL5-gy.cjs.map +1 -0
- package/dist/contract-isM9SjjQ.mjs +39 -0
- package/dist/contract-isM9SjjQ.mjs.map +1 -0
- package/dist/contract-pU3wGFmo.d.cts +159 -0
- package/dist/contract-yPNuFnVy.d.mts +49 -0
- package/dist/core-C0ceVOTk.d.cts +513 -0
- package/dist/core-CTr7dw0v.cjs +1725 -0
- package/dist/core-CTr7dw0v.cjs.map +1 -0
- package/dist/core-IdGEbYdM.mjs +1541 -0
- package/dist/core-IdGEbYdM.mjs.map +1 -0
- package/dist/core-KtEHRScZ.d.mts +513 -0
- package/dist/core.cjs +9 -0
- package/dist/core.d.cts +2 -0
- package/dist/core.d.mts +2 -0
- package/dist/core.mjs +2 -0
- package/dist/create-fetch-handler-1pXSEhGi.d.cts +311 -0
- package/dist/create-fetch-handler-BwQQ_IWf.mjs +2156 -0
- package/dist/create-fetch-handler-BwQQ_IWf.mjs.map +1 -0
- package/dist/create-fetch-handler-D8cTMVX9.cjs +2232 -0
- package/dist/create-fetch-handler-D8cTMVX9.cjs.map +1 -0
- package/dist/create-fetch-handler-zioPVS18.d.mts +311 -0
- package/dist/elysia-shared-C7geKqPP.mjs +55 -0
- package/dist/elysia-shared-C7geKqPP.mjs.map +1 -0
- package/dist/elysia-shared-DT4bfekR.d.cts +20 -0
- package/dist/elysia-shared-DXyAyGz_.cjs +66 -0
- package/dist/elysia-shared-DXyAyGz_.cjs.map +1 -0
- package/dist/elysia-shared-DoL5ab52.d.mts +20 -0
- package/dist/entry-auth-basic.cjs +5 -0
- package/dist/entry-auth-basic.d.cts +83 -0
- package/dist/entry-auth-basic.d.mts +83 -0
- package/dist/entry-auth-basic.mjs +2 -0
- package/dist/entry-auth-delegated.cjs +28 -0
- package/dist/entry-auth-delegated.cjs.map +1 -0
- package/dist/entry-auth-delegated.d.cts +36 -0
- package/dist/entry-auth-delegated.d.mts +36 -0
- package/dist/entry-auth-delegated.mjs +27 -0
- package/dist/entry-auth-delegated.mjs.map +1 -0
- package/dist/entry-auth-none.cjs +4 -0
- package/dist/entry-auth-none.d.cts +25 -0
- package/dist/entry-auth-none.d.mts +25 -0
- package/dist/entry-auth-none.mjs +2 -0
- package/dist/entry-authorization-delegated.cjs +28 -0
- package/dist/entry-authorization-delegated.cjs.map +1 -0
- package/dist/entry-authorization-delegated.d.cts +32 -0
- package/dist/entry-authorization-delegated.d.mts +32 -0
- package/dist/entry-authorization-delegated.mjs +27 -0
- package/dist/entry-authorization-delegated.mjs.map +1 -0
- package/dist/entry-authorization-none.cjs +3 -0
- package/dist/entry-authorization-none.d.cts +18 -0
- package/dist/entry-authorization-none.d.mts +18 -0
- package/dist/entry-authorization-none.mjs +2 -0
- package/dist/entry-authorization-roles.cjs +8 -0
- package/dist/entry-authorization-roles.d.cts +64 -0
- package/dist/entry-authorization-roles.d.mts +64 -0
- package/dist/entry-authorization-roles.mjs +3 -0
- package/dist/entry-bun.cjs +55 -0
- package/dist/entry-bun.cjs.map +1 -0
- package/dist/entry-bun.d.cts +29 -0
- package/dist/entry-bun.d.mts +29 -0
- package/dist/entry-bun.mjs +52 -0
- package/dist/entry-bun.mjs.map +1 -0
- package/dist/entry-drizzle-audit.cjs +191 -0
- package/dist/entry-drizzle-audit.cjs.map +1 -0
- package/dist/entry-drizzle-audit.d.cts +118 -0
- package/dist/entry-drizzle-audit.d.mts +118 -0
- package/dist/entry-drizzle-audit.mjs +186 -0
- package/dist/entry-drizzle-audit.mjs.map +1 -0
- package/dist/entry-drizzle-mysql.cjs +75 -0
- package/dist/entry-drizzle-mysql.cjs.map +1 -0
- package/dist/entry-drizzle-mysql.d.cts +42 -0
- package/dist/entry-drizzle-mysql.d.mts +42 -0
- package/dist/entry-drizzle-mysql.mjs +71 -0
- package/dist/entry-drizzle-mysql.mjs.map +1 -0
- package/dist/entry-drizzle-pg.cjs +82 -0
- package/dist/entry-drizzle-pg.cjs.map +1 -0
- package/dist/entry-drizzle-pg.d.cts +48 -0
- package/dist/entry-drizzle-pg.d.mts +48 -0
- package/dist/entry-drizzle-pg.mjs +78 -0
- package/dist/entry-drizzle-pg.mjs.map +1 -0
- package/dist/entry-drizzle-sqlite.cjs +71 -0
- package/dist/entry-drizzle-sqlite.cjs.map +1 -0
- package/dist/entry-drizzle-sqlite.d.cts +37 -0
- package/dist/entry-drizzle-sqlite.d.mts +37 -0
- package/dist/entry-drizzle-sqlite.mjs +67 -0
- package/dist/entry-drizzle-sqlite.mjs.map +1 -0
- package/dist/entry-elysia.cjs +112 -0
- package/dist/entry-elysia.cjs.map +1 -0
- package/dist/entry-elysia.d.cts +710 -0
- package/dist/entry-elysia.d.mts +710 -0
- package/dist/entry-elysia.mjs +109 -0
- package/dist/entry-elysia.mjs.map +1 -0
- package/dist/entry-elysia2.cjs +101 -0
- package/dist/entry-elysia2.cjs.map +1 -0
- package/dist/entry-elysia2.d.cts +905 -0
- package/dist/entry-elysia2.d.mts +905 -0
- package/dist/entry-elysia2.mjs +98 -0
- package/dist/entry-elysia2.mjs.map +1 -0
- package/dist/entry-express.cjs +90 -0
- package/dist/entry-express.cjs.map +1 -0
- package/dist/entry-express.d.cts +24 -0
- package/dist/entry-express.d.mts +24 -0
- package/dist/entry-express.mjs +88 -0
- package/dist/entry-express.mjs.map +1 -0
- package/dist/entry-hono.cjs +36 -0
- package/dist/entry-hono.cjs.map +1 -0
- package/dist/entry-hono.d.cts +24 -0
- package/dist/entry-hono.d.mts +24 -0
- package/dist/entry-hono.mjs +34 -0
- package/dist/entry-hono.mjs.map +1 -0
- package/dist/entry-hooks-log.cjs +22 -0
- package/dist/entry-hooks-log.cjs.map +1 -0
- package/dist/entry-hooks-log.d.cts +23 -0
- package/dist/entry-hooks-log.d.mts +23 -0
- package/dist/entry-hooks-log.mjs +21 -0
- package/dist/entry-hooks-log.mjs.map +1 -0
- package/dist/entry-sinks-console.cjs +43 -0
- package/dist/entry-sinks-console.cjs.map +1 -0
- package/dist/entry-sinks-console.d.cts +26 -0
- package/dist/entry-sinks-console.d.mts +26 -0
- package/dist/entry-sinks-console.mjs +41 -0
- package/dist/entry-sinks-console.mjs.map +1 -0
- package/dist/entry-sinks-datadog.cjs +97 -0
- package/dist/entry-sinks-datadog.cjs.map +1 -0
- package/dist/entry-sinks-datadog.d.cts +66 -0
- package/dist/entry-sinks-datadog.d.mts +66 -0
- package/dist/entry-sinks-datadog.mjs +91 -0
- package/dist/entry-sinks-datadog.mjs.map +1 -0
- package/dist/entry-sinks-file.cjs +100 -0
- package/dist/entry-sinks-file.cjs.map +1 -0
- package/dist/entry-sinks-file.d.cts +70 -0
- package/dist/entry-sinks-file.d.mts +70 -0
- package/dist/entry-sinks-file.mjs +97 -0
- package/dist/entry-sinks-file.mjs.map +1 -0
- package/dist/entry-sinks-http.cjs +63 -0
- package/dist/entry-sinks-http.cjs.map +1 -0
- package/dist/entry-sinks-http.d.cts +55 -0
- package/dist/entry-sinks-http.d.mts +55 -0
- package/dist/entry-sinks-http.mjs +60 -0
- package/dist/entry-sinks-http.mjs.map +1 -0
- package/dist/entry-sinks-s3.cjs +115 -0
- package/dist/entry-sinks-s3.cjs.map +1 -0
- package/dist/entry-sinks-s3.d.cts +79 -0
- package/dist/entry-sinks-s3.d.mts +79 -0
- package/dist/entry-sinks-s3.mjs +112 -0
- package/dist/entry-sinks-s3.mjs.map +1 -0
- package/dist/entry-sinks-splunk.cjs +80 -0
- package/dist/entry-sinks-splunk.cjs.map +1 -0
- package/dist/entry-sinks-splunk.d.cts +58 -0
- package/dist/entry-sinks-splunk.d.mts +58 -0
- package/dist/entry-sinks-splunk.mjs +77 -0
- package/dist/entry-sinks-splunk.mjs.map +1 -0
- package/dist/entry-sinks-webhook.cjs +130 -0
- package/dist/entry-sinks-webhook.cjs.map +1 -0
- package/dist/entry-sinks-webhook.d.cts +69 -0
- package/dist/entry-sinks-webhook.d.mts +69 -0
- package/dist/entry-sinks-webhook.mjs +125 -0
- package/dist/entry-sinks-webhook.mjs.map +1 -0
- package/dist/entry-sinks-xtandard-webhooks.cjs +64 -0
- package/dist/entry-sinks-xtandard-webhooks.cjs.map +1 -0
- package/dist/entry-sinks-xtandard-webhooks.d.cts +64 -0
- package/dist/entry-sinks-xtandard-webhooks.d.mts +64 -0
- package/dist/entry-sinks-xtandard-webhooks.mjs +63 -0
- package/dist/entry-sinks-xtandard-webhooks.mjs.map +1 -0
- package/dist/entry-storage-cloudflare-kv.cjs +47 -0
- package/dist/entry-storage-cloudflare-kv.cjs.map +1 -0
- package/dist/entry-storage-cloudflare-kv.d.cts +42 -0
- package/dist/entry-storage-cloudflare-kv.d.mts +42 -0
- package/dist/entry-storage-cloudflare-kv.mjs +46 -0
- package/dist/entry-storage-cloudflare-kv.mjs.map +1 -0
- package/dist/entry-storage-drizzle.cjs +228 -0
- package/dist/entry-storage-drizzle.cjs.map +1 -0
- package/dist/entry-storage-drizzle.d.cts +43 -0
- package/dist/entry-storage-drizzle.d.mts +43 -0
- package/dist/entry-storage-drizzle.mjs +227 -0
- package/dist/entry-storage-drizzle.mjs.map +1 -0
- package/dist/entry-storage-file.cjs +175 -0
- package/dist/entry-storage-file.cjs.map +1 -0
- package/dist/entry-storage-file.d.cts +41 -0
- package/dist/entry-storage-file.d.mts +41 -0
- package/dist/entry-storage-file.mjs +171 -0
- package/dist/entry-storage-file.mjs.map +1 -0
- package/dist/entry-storage-libsql.cjs +133 -0
- package/dist/entry-storage-libsql.cjs.map +1 -0
- package/dist/entry-storage-libsql.d.cts +60 -0
- package/dist/entry-storage-libsql.d.mts +60 -0
- package/dist/entry-storage-libsql.mjs +132 -0
- package/dist/entry-storage-libsql.mjs.map +1 -0
- package/dist/entry-storage-memory.cjs +3 -0
- package/dist/entry-storage-memory.d.cts +2 -0
- package/dist/entry-storage-memory.d.mts +2 -0
- package/dist/entry-storage-memory.mjs +2 -0
- package/dist/entry-storage-mongodb.cjs +306 -0
- package/dist/entry-storage-mongodb.cjs.map +1 -0
- package/dist/entry-storage-mongodb.d.cts +65 -0
- package/dist/entry-storage-mongodb.d.mts +65 -0
- package/dist/entry-storage-mongodb.mjs +304 -0
- package/dist/entry-storage-mongodb.mjs.map +1 -0
- package/dist/entry-storage-postgres.cjs +261 -0
- package/dist/entry-storage-postgres.cjs.map +1 -0
- package/dist/entry-storage-postgres.d.cts +66 -0
- package/dist/entry-storage-postgres.d.mts +66 -0
- package/dist/entry-storage-postgres.mjs +260 -0
- package/dist/entry-storage-postgres.mjs.map +1 -0
- package/dist/entry-storage-redis.cjs +223 -0
- package/dist/entry-storage-redis.cjs.map +1 -0
- package/dist/entry-storage-redis.d.cts +77 -0
- package/dist/entry-storage-redis.d.mts +77 -0
- package/dist/entry-storage-redis.mjs +221 -0
- package/dist/entry-storage-redis.mjs.map +1 -0
- package/dist/entry-storage-sqlite.cjs +85 -0
- package/dist/entry-storage-sqlite.cjs.map +1 -0
- package/dist/entry-storage-sqlite.d.cts +40 -0
- package/dist/entry-storage-sqlite.d.mts +40 -0
- package/dist/entry-storage-sqlite.mjs +84 -0
- package/dist/entry-storage-sqlite.mjs.map +1 -0
- package/dist/entry-storage-unstorage.cjs +57 -0
- package/dist/entry-storage-unstorage.cjs.map +1 -0
- package/dist/entry-storage-unstorage.d.cts +29 -0
- package/dist/entry-storage-unstorage.d.mts +29 -0
- package/dist/entry-storage-unstorage.mjs +56 -0
- package/dist/entry-storage-unstorage.mjs.map +1 -0
- package/dist/export-B9S-JeYl.mjs +239 -0
- package/dist/export-B9S-JeYl.mjs.map +1 -0
- package/dist/export-BZq0KCCn.d.mts +70 -0
- package/dist/export-DYfMd-ep.cjs +280 -0
- package/dist/export-DYfMd-ep.cjs.map +1 -0
- package/dist/export-Dh8T8I1p.d.cts +70 -0
- package/dist/index.cjs +279 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +286 -0
- package/dist/index.d.mts +284 -0
- package/dist/index.mjs +177 -0
- package/dist/index.mjs.map +1 -0
- package/dist/integrity-BHhjTBNk.cjs +614 -0
- package/dist/integrity-BHhjTBNk.cjs.map +1 -0
- package/dist/integrity-kfY2DNAi.mjs +483 -0
- package/dist/integrity-kfY2DNAi.mjs.map +1 -0
- package/dist/memory-CfykUo9W.cjs +155 -0
- package/dist/memory-CfykUo9W.cjs.map +1 -0
- package/dist/memory-DrR-Tlbf.d.mts +28 -0
- package/dist/memory-GG2Nba1D.mjs +150 -0
- package/dist/memory-GG2Nba1D.mjs.map +1 -0
- package/dist/memory-HpFdlMR_.d.cts +28 -0
- package/dist/none-Be7r6kHH.cjs +33 -0
- package/dist/none-Be7r6kHH.cjs.map +1 -0
- package/dist/none-CGmIIbI8.cjs +49 -0
- package/dist/none-CGmIIbI8.cjs.map +1 -0
- package/dist/none-CkV5mZsB.mjs +33 -0
- package/dist/none-CkV5mZsB.mjs.map +1 -0
- package/dist/none-DBeBeU0Z.mjs +23 -0
- package/dist/none-DBeBeU0Z.mjs.map +1 -0
- package/dist/query-ChGGtlA7.cjs +243 -0
- package/dist/query-ChGGtlA7.cjs.map +1 -0
- package/dist/query-LvZbyi37.mjs +172 -0
- package/dist/query-LvZbyi37.mjs.map +1 -0
- package/dist/react.css +1 -0
- package/dist/react.js +31935 -0
- package/dist/recorder-B3dG3jbd.d.mts +64 -0
- package/dist/recorder-CGY7HK29.d.cts +64 -0
- package/dist/roles-BARtYLSX.cjs +112 -0
- package/dist/roles-BARtYLSX.cjs.map +1 -0
- package/dist/roles-D7Pg89IJ.mjs +83 -0
- package/dist/roles-D7Pg89IJ.mjs.map +1 -0
- package/dist/schema-DmU7Wp0F.d.cts +251 -0
- package/dist/schema-DmU7Wp0F.d.mts +251 -0
- package/dist/schema.cjs +20 -0
- package/dist/schema.cjs.map +1 -0
- package/dist/schema.d.cts +2 -0
- package/dist/schema.d.mts +2 -0
- package/dist/schema.mjs +17 -0
- package/dist/schema.mjs.map +1 -0
- package/dist/shared-CJOyJKqT.d.mts +20 -0
- package/dist/shared-DSDY-V0n.mjs +100 -0
- package/dist/shared-DSDY-V0n.mjs.map +1 -0
- package/dist/shared-EANCdRqn.d.cts +20 -0
- package/dist/shared-OOAq-U4S.cjs +141 -0
- package/dist/shared-OOAq-U4S.cjs.map +1 -0
- package/dist/sql-B7b6HzGy.cjs +280 -0
- package/dist/sql-B7b6HzGy.cjs.map +1 -0
- package/dist/sql-COjPyn3F.mjs +209 -0
- package/dist/sql-COjPyn3F.mjs.map +1 -0
- package/dist/sqlite-event-log-BnoG8eos.cjs +184 -0
- package/dist/sqlite-event-log-BnoG8eos.cjs.map +1 -0
- package/dist/sqlite-event-log-nXmS2DS_.mjs +179 -0
- package/dist/sqlite-event-log-nXmS2DS_.mjs.map +1 -0
- package/dist/streams-CRuxOYcb.d.cts +124 -0
- package/dist/streams-DU0_gvI8.d.mts +124 -0
- package/dist/table-BcarDd10.d.cts +48 -0
- package/dist/table-BcarDd10.d.mts +48 -0
- package/dist/testing.cjs +189 -0
- package/dist/testing.cjs.map +1 -0
- package/dist/testing.d.cts +103 -0
- package/dist/testing.d.mts +103 -0
- package/dist/testing.mjs +185 -0
- package/dist/testing.mjs.map +1 -0
- package/dist/types-elysia2/adapters/bun.d.ts +47 -0
- package/dist/types-elysia2/adapters/context-shared.d.ts +40 -0
- package/dist/types-elysia2/adapters/elysia-shared.d.ts +36 -0
- package/dist/types-elysia2/adapters/elysia2.d.ts +588 -0
- package/dist/types-elysia2/auth/contract.d.ts +26 -0
- package/dist/types-elysia2/authorization/contract.d.ts +54 -0
- package/dist/types-elysia2/canonical.d.ts +25 -0
- package/dist/types-elysia2/context.d.ts +61 -0
- package/dist/types-elysia2/core.d.ts +232 -0
- package/dist/types-elysia2/duration.d.ts +26 -0
- package/dist/types-elysia2/entry-elysia2.d.ts +10 -0
- package/dist/types-elysia2/event-log.d.ts +33 -0
- package/dist/types-elysia2/export.d.ts +77 -0
- package/dist/types-elysia2/hooks/contract.d.ts +177 -0
- package/dist/types-elysia2/id.d.ts +27 -0
- package/dist/types-elysia2/integrity.d.ts +193 -0
- package/dist/types-elysia2/keys.d.ts +91 -0
- package/dist/types-elysia2/portal.d.ts +137 -0
- package/dist/types-elysia2/query.d.ts +88 -0
- package/dist/types-elysia2/schema.d.ts +247 -0
- package/dist/types-elysia2/server/base-path.d.ts +15 -0
- package/dist/types-elysia2/server/cors.d.ts +36 -0
- package/dist/types-elysia2/server/create-fetch-handler.d.ts +140 -0
- package/dist/types-elysia2/server/openapi.d.ts +25 -0
- package/dist/types-elysia2/server/render-index-html.d.ts +18 -0
- package/dist/types-elysia2/server/routes.d.ts +83 -0
- package/dist/types-elysia2/server/static-assets.d.ts +13 -0
- package/dist/types-elysia2/standard-schema.d.ts +100 -0
- package/dist/types-elysia2/storage/contract.d.ts +106 -0
- package/dist/types-elysia2/streams.d.ts +134 -0
- package/dist/types-elysia2/transforms.d.ts +56 -0
- package/dist/types-elysia2/validation.d.ts +48 -0
- package/dist/types-react/canonical.d.ts +25 -0
- package/dist/types-react/context.d.ts +61 -0
- package/dist/types-react/core.d.ts +232 -0
- package/dist/types-react/duration.d.ts +26 -0
- package/dist/types-react/event-log.d.ts +33 -0
- package/dist/types-react/hooks/contract.d.ts +177 -0
- package/dist/types-react/id.d.ts +27 -0
- package/dist/types-react/integrity.d.ts +193 -0
- package/dist/types-react/keys.d.ts +91 -0
- package/dist/types-react/query.d.ts +88 -0
- package/dist/types-react/react.d.ts +114 -0
- package/dist/types-react/schema.d.ts +247 -0
- package/dist/types-react/standard-schema.d.ts +100 -0
- package/dist/types-react/storage/contract.d.ts +106 -0
- package/dist/types-react/streams.d.ts +134 -0
- package/dist/types-react/transforms.d.ts +56 -0
- package/dist/types-react/ui/App.d.ts +36 -0
- package/dist/types-react/ui/api.d.ts +61 -0
- package/dist/types-react/ui/components/ActionFilter.d.ts +17 -0
- package/dist/types-react/ui/components/ExportMenu.d.ts +13 -0
- package/dist/types-react/ui/components/JsonCodeEditor.d.ts +12 -0
- package/dist/types-react/ui/components/ThemeToggle.d.ts +2 -0
- package/dist/types-react/ui/components/Toast.d.ts +16 -0
- package/dist/types-react/ui/components/audit-bits.d.ts +91 -0
- package/dist/types-react/ui/components/integrity-bits.d.ts +19 -0
- package/dist/types-react/ui/components/primitives.d.ts +50 -0
- package/dist/types-react/ui/components/ui-bits.d.ts +22 -0
- package/dist/types-react/ui/lib/filters.d.ts +70 -0
- package/dist/types-react/ui/lib/format.d.ts +82 -0
- package/dist/types-react/ui/lib/nav-guard.d.ts +20 -0
- package/dist/types-react/ui/lib/portal-container.d.ts +24 -0
- package/dist/types-react/ui/lib/utils.d.ts +3 -0
- package/dist/types-react/ui/theme.d.ts +40 -0
- package/dist/types-react/ui/types.d.ts +67 -0
- package/dist/types-react/ui/views/ActionsView.d.ts +10 -0
- package/dist/types-react/ui/views/EventDrawer.d.ts +15 -0
- package/dist/types-react/ui/views/EventsView.d.ts +10 -0
- package/dist/types-react/ui/views/IntegrityView.d.ts +10 -0
- package/dist/types-react/ui/views/OverviewView.d.ts +9 -0
- package/dist/types-react/ui/views/StreamsView.d.ts +10 -0
- package/dist/types-react/ui/views/TenantsView.d.ts +6 -0
- package/dist/types-react/validation.d.ts +48 -0
- package/dist/ui/assets/favicon-BSj8MPnj.svg +11 -0
- package/dist/ui/assets/index-Cd-mcIwC.css +1 -0
- package/dist/ui/assets/index-DUAgpiot.js +244 -0
- package/dist/ui/index.html +15 -0
- package/dist/validation-DFrLESZD.mjs +150 -0
- package/dist/validation-DFrLESZD.mjs.map +1 -0
- package/dist/validation-lb0YXrxx.cjs +235 -0
- package/dist/validation-lb0YXrxx.cjs.map +1 -0
- package/dist/verify.cjs +14 -0
- package/dist/verify.d.cts +5 -0
- package/dist/verify.d.mts +5 -0
- package/dist/verify.mjs +3 -0
- package/package.json +610 -4
|
@@ -0,0 +1,513 @@
|
|
|
1
|
+
import { c as AuditEventInput, d as AuditPage, f as AuditQuery, g as ChainHead, h as AuditTenant, i as AuditCheckpoint, n as ActionDefinition, o as AuditDuration, p as AuditSection, s as AuditEvent, u as AuditOutcome, v as JsonObject, y as JsonValue } from "./schema-DmU7Wp0F.mjs";
|
|
2
|
+
import { i as EventLogStorage, t as AuditStorage } from "./contract-BmwHIiMR.mjs";
|
|
3
|
+
import { i as AuditHooksInput, l as HookErrorReporter, r as AuditHooks, s as HookActor } from "./contract-Cht05WYQ.mjs";
|
|
4
|
+
|
|
5
|
+
//#region src/event-log.d.ts
|
|
6
|
+
/** The event-log operations the core needs (the native capability minus KV). */
|
|
7
|
+
type EventLog = Pick<EventLogStorage, "appendEvents" | "getEvent" | "lastEvent" | "eventsBySeq" | "queryEvents" | "replaceEvent" | "deleteEventsThrough" | "countEvents" | "listEventTenants"> & {
|
|
8
|
+
/** True when backed by the storage's native capability. */readonly native: boolean;
|
|
9
|
+
};
|
|
10
|
+
/** Resolve the event log for a storage: native capability or the KV fallback. */
|
|
11
|
+
declare function resolveEventLog(storage: AuditStorage): EventLog;
|
|
12
|
+
/** The generic event log over the four-method KV contract. */
|
|
13
|
+
declare function createKvEventLog(storage: AuditStorage): EventLog;
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/integrity.d.ts
|
|
16
|
+
/** `prevHash` of the first event of every chain. */
|
|
17
|
+
declare const GENESIS_HASH: string;
|
|
18
|
+
/** `"sha256:" + hex(SHA-256(utf8(text)))`. */
|
|
19
|
+
declare function sha256(text: string): Promise<string>;
|
|
20
|
+
/** An event before it is sealed into the chain. */
|
|
21
|
+
type UnsealedEvent = Omit<AuditEvent, "integrity">;
|
|
22
|
+
/** Salted digest of one section's value. */
|
|
23
|
+
declare function sectionDigest(eventId: string, value: JsonValue): Promise<string>;
|
|
24
|
+
/** Compute every section digest of an (unerased) event. */
|
|
25
|
+
declare function computeDigests(event: UnsealedEvent): Promise<Record<AuditSection, string>>;
|
|
26
|
+
/** The chained header for an event (what `hash` is computed over). */
|
|
27
|
+
declare function chainHeader(event: UnsealedEvent, prevHash: string, digests: Record<AuditSection, string>): JsonValue;
|
|
28
|
+
/** Seal an event: compute its digests and its chain hash linked to `prevHash`. */
|
|
29
|
+
declare function sealEvent(event: UnsealedEvent, prevHash: string): Promise<AuditEvent>;
|
|
30
|
+
/** Seal a batch for one tenant, linking each event to the previous one. */
|
|
31
|
+
declare function sealChain(events: UnsealedEvent[], prevHash: string): Promise<AuditEvent[]>;
|
|
32
|
+
/** Why verification failed at a given point. */
|
|
33
|
+
type VerifyIssueKind = "digest-mismatch" | "hash-mismatch" | "link-mismatch" | "seq-gap" | "tenant-mismatch" | "bad-signature" | "checkpoint-mismatch" | "unknown-key" | "unjustified-erasure" | "malformed";
|
|
34
|
+
/** One verification failure. */
|
|
35
|
+
interface VerifyIssue {
|
|
36
|
+
kind: VerifyIssueKind;
|
|
37
|
+
seq?: number;
|
|
38
|
+
eventId?: string;
|
|
39
|
+
checkpointId?: string;
|
|
40
|
+
section?: AuditSection;
|
|
41
|
+
message: string;
|
|
42
|
+
}
|
|
43
|
+
/** Result of {@link verifyChain}. */
|
|
44
|
+
interface VerifyReport {
|
|
45
|
+
/** True when no issue was found. */
|
|
46
|
+
ok: boolean;
|
|
47
|
+
tenant: string | null;
|
|
48
|
+
/** Events checked. */
|
|
49
|
+
checked: number;
|
|
50
|
+
/** First and last seq checked (null when empty). */
|
|
51
|
+
fromSeq: number | null;
|
|
52
|
+
toSeq: number | null;
|
|
53
|
+
/** Hash of the last checked event. */
|
|
54
|
+
headHash: string | null;
|
|
55
|
+
/**
|
|
56
|
+
* How the start of the range is anchored: `"genesis"` (seq 1),
|
|
57
|
+
* `"checkpoint"` (a verified checkpoint covers `fromSeq - 1`, or a `base`
|
|
58
|
+
* checkpoint), or `"unanchored"` (the first `prevHash` is trusted as given).
|
|
59
|
+
*/
|
|
60
|
+
anchor: "genesis" | "checkpoint" | "unanchored" | "none";
|
|
61
|
+
/** Whether links between events were checked (false for non-contiguous subsets). */
|
|
62
|
+
linksChecked: boolean;
|
|
63
|
+
/** Checkpoints whose signature and hash were verified. */
|
|
64
|
+
checkpointsVerified: number;
|
|
65
|
+
/**
|
|
66
|
+
* The highest seq covered by a verified checkpoint, or null. Events after it
|
|
67
|
+
* are internally consistent but not yet anchored by a signature.
|
|
68
|
+
*/
|
|
69
|
+
signedThrough: number | null;
|
|
70
|
+
/** Sections reported as erased (content removed, digest kept). */
|
|
71
|
+
erased: {
|
|
72
|
+
seq: number;
|
|
73
|
+
eventId: string;
|
|
74
|
+
sections: AuditSection[];
|
|
75
|
+
}[];
|
|
76
|
+
issues: VerifyIssue[];
|
|
77
|
+
}
|
|
78
|
+
/** A key able to verify checkpoint signatures. */
|
|
79
|
+
interface AuditVerificationKey {
|
|
80
|
+
keyId: string;
|
|
81
|
+
alg: AuditCheckpoint["alg"];
|
|
82
|
+
verify(data: Uint8Array, signature: Uint8Array): Promise<boolean>;
|
|
83
|
+
}
|
|
84
|
+
/** Options for {@link verifyChain}. */
|
|
85
|
+
interface VerifyChainOptions {
|
|
86
|
+
/** Checkpoints to check against the events (and whose signatures to verify). */
|
|
87
|
+
checkpoints?: AuditCheckpoint[];
|
|
88
|
+
/** Keys to verify checkpoint signatures with. Without keys, signatures are not checked. */
|
|
89
|
+
keys?: AuditVerificationKey[];
|
|
90
|
+
/**
|
|
91
|
+
* Treat the events as a contiguous range (default `true`): check seq
|
|
92
|
+
* continuity and `prevHash` links. Set `false` for filtered subsets — each
|
|
93
|
+
* event is then verified on its own.
|
|
94
|
+
*/
|
|
95
|
+
contiguous?: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Require every erased section to be justified by a chained
|
|
98
|
+
* `audit_log.erased` event (default `true`). The `erased` list itself is not
|
|
99
|
+
* covered by the hash, so this is what stops "erase" from being a way to
|
|
100
|
+
* silently replace content (ADR 0011). Set `false` when verifying a range
|
|
101
|
+
* that ends before the erasure records, or when self-audit is disabled.
|
|
102
|
+
*/
|
|
103
|
+
requireErasureRecords?: boolean;
|
|
104
|
+
}
|
|
105
|
+
/** Re-derive one event's digests and hash; returns the issues found. */
|
|
106
|
+
declare function verifyEvent(event: AuditEvent): Promise<VerifyIssue[]>;
|
|
107
|
+
/**
|
|
108
|
+
* Verify a tenant's events (and optionally checkpoints). Pure: it trusts
|
|
109
|
+
* nothing but the data passed in and the keys.
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* ```ts
|
|
113
|
+
* import { verifyChain, keysFromJwks } from "@xtandard/audit/verify";
|
|
114
|
+
*
|
|
115
|
+
* const report = await verifyChain(events, {
|
|
116
|
+
* checkpoints,
|
|
117
|
+
* keys: await keysFromJwks(jwks),
|
|
118
|
+
* });
|
|
119
|
+
* if (!report.ok) console.error(report.issues);
|
|
120
|
+
* ```
|
|
121
|
+
*/
|
|
122
|
+
declare function verifyChain(events: AuditEvent[], options?: VerifyChainOptions): Promise<VerifyReport>;
|
|
123
|
+
/** Signs checkpoints. Implement your own (KMS, HSM) or use the built-ins. */
|
|
124
|
+
interface AuditSigner {
|
|
125
|
+
keyId: string;
|
|
126
|
+
alg: AuditCheckpoint["alg"];
|
|
127
|
+
sign(data: Uint8Array): Promise<Uint8Array>;
|
|
128
|
+
/** The public verification key as a JWK (asymmetric signers only), for the JWKS route. */
|
|
129
|
+
publicJwk?(): Promise<JsonWebKey | null>;
|
|
130
|
+
/** A verification key for this signer (used by `core.verify`). */
|
|
131
|
+
verificationKey(): Promise<AuditVerificationKey>;
|
|
132
|
+
}
|
|
133
|
+
/** Sign an unsigned checkpoint. */
|
|
134
|
+
declare function signCheckpoint(signer: AuditSigner, unsigned: Omit<AuditCheckpoint, "signature" | "keyId" | "alg">): Promise<AuditCheckpoint>;
|
|
135
|
+
/** Verify one checkpoint's signature with a key. */
|
|
136
|
+
declare function verifyCheckpointSignature(cp: AuditCheckpoint, key: AuditVerificationKey): Promise<boolean>;
|
|
137
|
+
/** A JWK with its key id. */
|
|
138
|
+
type AuditJwk = JsonWebKey & {
|
|
139
|
+
kid?: string;
|
|
140
|
+
};
|
|
141
|
+
/** Generate an Ed25519 key pair as JWKs (store `privateJwk` as a secret). */
|
|
142
|
+
declare function generateSigningKeyPair(): Promise<{
|
|
143
|
+
keyId: string;
|
|
144
|
+
privateJwk: AuditJwk;
|
|
145
|
+
publicJwk: AuditJwk;
|
|
146
|
+
}>;
|
|
147
|
+
/** A verification key from an Ed25519 public JWK. */
|
|
148
|
+
declare function ed25519VerificationKey(jwk: AuditJwk, keyId?: string): Promise<AuditVerificationKey>;
|
|
149
|
+
/**
|
|
150
|
+
* An Ed25519 signer from a private JWK (from {@link generateSigningKeyPair} or
|
|
151
|
+
* `xtandard-audit keygen`). The public half is served as a JWKS so customers
|
|
152
|
+
* can verify checkpoints themselves.
|
|
153
|
+
*
|
|
154
|
+
* @example
|
|
155
|
+
* ```ts
|
|
156
|
+
* import { ed25519Signer } from "@xtandard/audit";
|
|
157
|
+
*
|
|
158
|
+
* const signer = await ed25519Signer(JSON.parse(process.env.AUDIT_SIGNING_KEY!));
|
|
159
|
+
* ```
|
|
160
|
+
*/
|
|
161
|
+
declare function ed25519Signer(privateJwk: AuditJwk, options?: {
|
|
162
|
+
keyId?: string;
|
|
163
|
+
}): Promise<AuditSigner>;
|
|
164
|
+
/** A verification key for {@link hmacSigner} checkpoints (needs the secret). */
|
|
165
|
+
declare function hmacVerificationKey(secret: string, keyId?: string): AuditVerificationKey;
|
|
166
|
+
/**
|
|
167
|
+
* A symmetric HMAC-SHA256 signer: simplest setup, but only holders of the
|
|
168
|
+
* secret can verify — prefer {@link ed25519Signer} when customers verify.
|
|
169
|
+
*/
|
|
170
|
+
declare function hmacSigner(secret: string, options?: {
|
|
171
|
+
keyId?: string;
|
|
172
|
+
}): AuditSigner;
|
|
173
|
+
/** Verification keys from a JWKS document (`GET {basePath}/api/integrity/keys`). */
|
|
174
|
+
declare function keysFromJwks(jwks: {
|
|
175
|
+
keys: AuditJwk[];
|
|
176
|
+
}): Promise<AuditVerificationKey[]>;
|
|
177
|
+
//#endregion
|
|
178
|
+
//#region src/standard-schema.d.ts
|
|
179
|
+
/** The Standard Schema v1 interface (vendored, type-only). */
|
|
180
|
+
interface StandardSchemaV1<Input = unknown, Output = Input> {
|
|
181
|
+
readonly "~standard": StandardSchemaV1.Props<Input, Output>;
|
|
182
|
+
}
|
|
183
|
+
declare namespace StandardSchemaV1 {
|
|
184
|
+
interface Props<Input = unknown, Output = Input> {
|
|
185
|
+
readonly version: 1;
|
|
186
|
+
readonly vendor: string;
|
|
187
|
+
readonly validate: (value: unknown) => Result<Output> | Promise<Result<Output>>;
|
|
188
|
+
readonly types?: Types<Input, Output> | undefined;
|
|
189
|
+
}
|
|
190
|
+
type Result<Output> = SuccessResult<Output> | FailureResult;
|
|
191
|
+
interface SuccessResult<Output> {
|
|
192
|
+
readonly value: Output;
|
|
193
|
+
readonly issues?: undefined;
|
|
194
|
+
}
|
|
195
|
+
interface FailureResult {
|
|
196
|
+
readonly issues: ReadonlyArray<Issue>;
|
|
197
|
+
}
|
|
198
|
+
interface Issue {
|
|
199
|
+
readonly message: string;
|
|
200
|
+
readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
|
|
201
|
+
}
|
|
202
|
+
interface PathSegment {
|
|
203
|
+
readonly key: PropertyKey;
|
|
204
|
+
}
|
|
205
|
+
interface Types<Input = unknown, Output = Input> {
|
|
206
|
+
readonly input: Input;
|
|
207
|
+
readonly output: Output;
|
|
208
|
+
}
|
|
209
|
+
type InferInput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["input"];
|
|
210
|
+
type InferOutput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["output"];
|
|
211
|
+
}
|
|
212
|
+
/** One action's definition in code. */
|
|
213
|
+
interface ActionSpec<TMetadata extends StandardSchemaV1 | undefined = StandardSchemaV1 | undefined> {
|
|
214
|
+
/** Validator for `metadata` (any Standard Schema). Omit for untyped metadata. */
|
|
215
|
+
metadata?: TMetadata;
|
|
216
|
+
description?: string;
|
|
217
|
+
/** UI grouping label. */
|
|
218
|
+
group?: string;
|
|
219
|
+
/** Target types this action carries (documentation; enforced when `strictTargets`). */
|
|
220
|
+
targets?: string[];
|
|
221
|
+
/** JSON-Schema-ish description of `metadata` for the UI catalog. */
|
|
222
|
+
schema?: JsonValue;
|
|
223
|
+
/** Default outcome when the caller does not pass one. */
|
|
224
|
+
outcome?: AuditOutcome;
|
|
225
|
+
deprecated?: boolean;
|
|
226
|
+
}
|
|
227
|
+
/** A map of action name → spec. */
|
|
228
|
+
type ActionMap = Record<string, ActionSpec>;
|
|
229
|
+
/** The `metadata` input type of one action. */
|
|
230
|
+
type ActionMetadataInput<TSpec> = TSpec extends ActionSpec<infer S> ? S extends StandardSchemaV1 ? StandardSchemaV1.InferInput<S> : JsonObject : JsonObject;
|
|
231
|
+
/**
|
|
232
|
+
* Declare the typed action catalog. Identity at runtime; preserves the literal
|
|
233
|
+
* types so `core.record()` can infer action names and metadata shapes.
|
|
234
|
+
*
|
|
235
|
+
* @example
|
|
236
|
+
* ```ts
|
|
237
|
+
* import * as v from "valibot";
|
|
238
|
+
* import { createAuditCore, defineActions } from "@xtandard/audit";
|
|
239
|
+
*
|
|
240
|
+
* const actions = defineActions({
|
|
241
|
+
* "invoice.paid": {
|
|
242
|
+
* metadata: v.object({ invoiceId: v.string(), amount: v.number() }),
|
|
243
|
+
* targets: ["invoice"],
|
|
244
|
+
* description: "An invoice was paid",
|
|
245
|
+
* },
|
|
246
|
+
* "member.removed": { targets: ["user"] },
|
|
247
|
+
* });
|
|
248
|
+
*
|
|
249
|
+
* const audit = createAuditCore({ storage, actions });
|
|
250
|
+
* await audit.record({
|
|
251
|
+
* tenant: "acme",
|
|
252
|
+
* action: "invoice.paid", // ← autocompletes; typos are compile errors
|
|
253
|
+
* actor: { id: "user_1" },
|
|
254
|
+
* metadata: { invoiceId: "inv_1", amount: 4200 }, // ← typed
|
|
255
|
+
* });
|
|
256
|
+
* ```
|
|
257
|
+
*/
|
|
258
|
+
declare function defineActions<const T extends ActionMap>(actions: T): T;
|
|
259
|
+
/** Run a Standard Schema validator; returns the output or the issue messages. */
|
|
260
|
+
declare function runStandardSchema<T>(schema: StandardSchemaV1<unknown, T>, value: unknown): Promise<{
|
|
261
|
+
ok: true;
|
|
262
|
+
value: T;
|
|
263
|
+
} | {
|
|
264
|
+
ok: false;
|
|
265
|
+
issues: {
|
|
266
|
+
path: string;
|
|
267
|
+
message: string;
|
|
268
|
+
}[];
|
|
269
|
+
}>;
|
|
270
|
+
//#endregion
|
|
271
|
+
//#region src/transforms.d.ts
|
|
272
|
+
/** The event shape transforms see: fully resolved, not yet chained. */
|
|
273
|
+
type TransformableEvent = Omit<AuditEvent, "integrity" | "seq" | "recordedAt"> & {
|
|
274
|
+
recordedAt?: string;
|
|
275
|
+
};
|
|
276
|
+
/** A transform: sync or async, returns the (possibly new) event. */
|
|
277
|
+
type AuditTransform = (event: TransformableEvent) => TransformableEvent | Promise<TransformableEvent>;
|
|
278
|
+
/** Replacement value used by {@link redact}. */
|
|
279
|
+
declare const REDACTED = "[REDACTED]";
|
|
280
|
+
/** Replace the values at `paths` with `"[REDACTED]"`. */
|
|
281
|
+
declare function redact(...paths: string[]): AuditTransform;
|
|
282
|
+
/** Remove the values at `paths` entirely. */
|
|
283
|
+
declare function omit(...paths: string[]): AuditTransform;
|
|
284
|
+
/**
|
|
285
|
+
* Partially mask string values: emails become `j***@e***.com`, short strings
|
|
286
|
+
* `****`, longer strings keep their last four characters.
|
|
287
|
+
*/
|
|
288
|
+
declare function mask(...paths: string[]): AuditTransform;
|
|
289
|
+
/** The masking used by {@link mask}. */
|
|
290
|
+
declare function maskValue(str: string): string;
|
|
291
|
+
/**
|
|
292
|
+
* Replace values with a SHA-256 digest (`sha256:…`). Pass a `salt` (a secret)
|
|
293
|
+
* to keep low-entropy values (emails, IPs) from being confirmed by brute force;
|
|
294
|
+
* equal inputs still produce equal digests, so you can correlate without storing.
|
|
295
|
+
*/
|
|
296
|
+
declare function hashValue(paths: string | string[], options?: {
|
|
297
|
+
salt?: string;
|
|
298
|
+
}): AuditTransform;
|
|
299
|
+
/** Run transforms in order. */
|
|
300
|
+
declare function applyTransforms(event: TransformableEvent, transforms: readonly AuditTransform[]): Promise<TransformableEvent>;
|
|
301
|
+
//#endregion
|
|
302
|
+
//#region src/core.d.ts
|
|
303
|
+
/** Thrown by mutating operations when the core is in readonly mode. */
|
|
304
|
+
declare class ReadonlyError extends Error {
|
|
305
|
+
constructor(operation: string);
|
|
306
|
+
}
|
|
307
|
+
/** Thrown when a referenced entity does not exist. Maps to HTTP 404. */
|
|
308
|
+
declare class NotFoundError extends Error {
|
|
309
|
+
constructor(message: string);
|
|
310
|
+
}
|
|
311
|
+
/** Thrown when an operation conflicts with existing state. Maps to HTTP 409. */
|
|
312
|
+
declare class ConflictError extends Error {
|
|
313
|
+
constructor(message: string);
|
|
314
|
+
}
|
|
315
|
+
/** Thrown when an operation needs a signer and none is configured. Maps to HTTP 409. */
|
|
316
|
+
declare class SignerRequiredError extends Error {
|
|
317
|
+
constructor();
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* One retention rule. When both fields are set an event is **kept if either
|
|
321
|
+
* rule keeps it** (union of keeps, the sibling packages' semantics): pruned only
|
|
322
|
+
* when it is outside the `keepLast` most recent AND older than `maxAge`.
|
|
323
|
+
* Retention always removes a **prefix** of a tenant's chain (by seq), anchored
|
|
324
|
+
* by a base checkpoint, so what remains still verifies (ADR 0004).
|
|
325
|
+
*/
|
|
326
|
+
interface RetentionRule {
|
|
327
|
+
/** Keep at most the N most recent events per tenant. */
|
|
328
|
+
keepLast?: number;
|
|
329
|
+
/** Keep events recorded within this age (e.g. `"365d"`). */
|
|
330
|
+
maxAge?: AuditDuration;
|
|
331
|
+
}
|
|
332
|
+
/** Retention policy for {@link AuditCoreOptions.retention}. */
|
|
333
|
+
interface RetentionOptions extends RetentionRule {
|
|
334
|
+
/** Per-tenant overrides (e.g. an enterprise plan with longer retention). */
|
|
335
|
+
tenants?: Record<string, RetentionRule>;
|
|
336
|
+
/**
|
|
337
|
+
* Prune even past stream cursors that have not caught up (default `false`:
|
|
338
|
+
* events a stream has not delivered yet are kept, ADR 0008).
|
|
339
|
+
*/
|
|
340
|
+
ignoreStreams?: boolean;
|
|
341
|
+
}
|
|
342
|
+
/** Automatic checkpointing (requires a `signer`). */
|
|
343
|
+
interface CheckpointOptions {
|
|
344
|
+
/** Sign the head after this many new events in a tenant. */
|
|
345
|
+
every?: number;
|
|
346
|
+
/** Sign the head when the last checkpoint is older than this (checked on record). */
|
|
347
|
+
interval?: AuditDuration;
|
|
348
|
+
}
|
|
349
|
+
/** Options for {@link createAuditCore}. */
|
|
350
|
+
interface AuditCoreOptions<A extends ActionMap = ActionMap> {
|
|
351
|
+
/** Where everything lives (see `@xtandard/audit/storage/*`). */
|
|
352
|
+
storage: AuditStorage;
|
|
353
|
+
/** Typed action catalog from `defineActions` (ADR 0012). */
|
|
354
|
+
actions?: A;
|
|
355
|
+
/**
|
|
356
|
+
* Reject actions that are not in `actions`. Default: `true` when `actions`
|
|
357
|
+
* is given, `false` otherwise.
|
|
358
|
+
*/
|
|
359
|
+
strictActions?: boolean;
|
|
360
|
+
/** Redact / mask / hash / omit before chaining (see `@xtandard/audit` transforms). */
|
|
361
|
+
transforms?: AuditTransform[];
|
|
362
|
+
/** Merge the ambient request context (`@xtandard/audit/context`). Default `true`. */
|
|
363
|
+
context?: boolean;
|
|
364
|
+
/** Checkpoint signer (ADR 0004). Without one, checkpoints are unavailable. */
|
|
365
|
+
signer?: AuditSigner;
|
|
366
|
+
/** Extra keys `verify` accepts (e.g. retired signing keys). */
|
|
367
|
+
verificationKeys?: AuditVerificationKey[];
|
|
368
|
+
/** Automatic checkpoints. Default `{ every: 1000, interval: "1h" }` when a signer is set. */
|
|
369
|
+
checkpoints?: CheckpointOptions | false;
|
|
370
|
+
/** Retention. Pruning runs on demand ({@link AuditCore.prune}) or via the panel/CLI schedule. */
|
|
371
|
+
retention?: RetentionOptions;
|
|
372
|
+
/** Control-plane hooks (`before` may deny, `after` observes). */
|
|
373
|
+
hooks?: AuditHooksInput;
|
|
374
|
+
/** Reporter invoked when an `after` hook throws. Default `console.warn`. */
|
|
375
|
+
onHookError?: HookErrorReporter;
|
|
376
|
+
/** Fire-and-forget tap invoked with every committed batch (metrics, cache busting). */
|
|
377
|
+
onRecord?: (events: AuditEvent[]) => void;
|
|
378
|
+
/**
|
|
379
|
+
* Record the log's own sensitive operations (exports, erasures, prunes) into
|
|
380
|
+
* the affected tenant's log, and catalog changes into `systemTenant`.
|
|
381
|
+
* Default `true`.
|
|
382
|
+
*/
|
|
383
|
+
selfAudit?: boolean;
|
|
384
|
+
/** Tenant receiving self-audit events that belong to no tenant. Default `"_system"`. */
|
|
385
|
+
systemTenant?: string;
|
|
386
|
+
/** Max serialized size of an event's free-form sections. Default 64 KiB. */
|
|
387
|
+
maxEventBytes?: number;
|
|
388
|
+
/** Block every mutation except recording when true (a read-only panel). */
|
|
389
|
+
readonly?: boolean;
|
|
390
|
+
/** Injectable clock (unix millis) for tests. Default `Date.now`. */
|
|
391
|
+
now?: () => number;
|
|
392
|
+
}
|
|
393
|
+
/** Per-call actor attribution for control-plane operations. */
|
|
394
|
+
interface ActorOptions {
|
|
395
|
+
actor?: HookActor | null;
|
|
396
|
+
}
|
|
397
|
+
/** A record input, typed by the action map when one is given (ADR 0012). */
|
|
398
|
+
type RecordInput<A extends ActionMap = ActionMap> = string extends keyof A ? Omit<AuditEventInput, "tenant"> & {
|
|
399
|
+
tenant?: string;
|
|
400
|
+
} : { [K in keyof A & string]: Omit<AuditEventInput<K, ActionMetadataInput<A[K]>>, "tenant"> & {
|
|
401
|
+
/** Defaults to the ambient context's tenant. */tenant?: string;
|
|
402
|
+
} }[keyof A & string];
|
|
403
|
+
/** Input to {@link AuditCore.erase}. */
|
|
404
|
+
interface EraseInput {
|
|
405
|
+
/** Sections to erase. Default: every section. */
|
|
406
|
+
sections?: AuditSection[];
|
|
407
|
+
/** Why (recorded in the self-audit event). */
|
|
408
|
+
reason?: string;
|
|
409
|
+
}
|
|
410
|
+
/** Result of one tenant's prune. */
|
|
411
|
+
interface PruneResult {
|
|
412
|
+
tenant: string;
|
|
413
|
+
/** Events removed. */
|
|
414
|
+
pruned: number;
|
|
415
|
+
/** New first retained seq. */
|
|
416
|
+
baseSeq: number;
|
|
417
|
+
}
|
|
418
|
+
/** Self-audit action names (always accepted, even with `strictActions`). */
|
|
419
|
+
declare const SELF_AUDIT_ACTIONS: readonly ["audit_log.exported", "audit_log.erased", "audit_log.pruned", "audit_log.action_upserted", "audit_log.action_deleted"];
|
|
420
|
+
/** The audit core surface. */
|
|
421
|
+
interface AuditCore<A extends ActionMap = ActionMap> {
|
|
422
|
+
readonly options: {
|
|
423
|
+
storage: AuditStorage;
|
|
424
|
+
actions?: A;
|
|
425
|
+
strictActions: boolean;
|
|
426
|
+
readonly: boolean;
|
|
427
|
+
selfAudit: boolean;
|
|
428
|
+
systemTenant: string;
|
|
429
|
+
signer?: AuditSigner;
|
|
430
|
+
retention?: RetentionOptions;
|
|
431
|
+
checkpoints: CheckpointOptions | false;
|
|
432
|
+
hooks: AuditHooks[];
|
|
433
|
+
now: () => number;
|
|
434
|
+
};
|
|
435
|
+
/** The resolved event log (native or KV fallback). */
|
|
436
|
+
readonly eventLog: EventLog;
|
|
437
|
+
/** Validate, transform, chain and append one event. Throws on failure (ADR 0002). */
|
|
438
|
+
record(input: RecordInput<A>): Promise<AuditEvent>;
|
|
439
|
+
/** Same as {@link record} for a batch; one chain append per tenant. */
|
|
440
|
+
recordMany(inputs: RecordInput<A>[]): Promise<AuditEvent[]>;
|
|
441
|
+
query(query?: AuditQuery): Promise<AuditPage>;
|
|
442
|
+
get(tenant: string, id: string): Promise<AuditEvent | null>;
|
|
443
|
+
/** Events of a tenant with `seq > afterSeq`, ascending (streams, verification, bundles). */
|
|
444
|
+
eventsBySeq(tenant: string, options: {
|
|
445
|
+
afterSeq: number;
|
|
446
|
+
limit: number;
|
|
447
|
+
}): Promise<AuditEvent[]>;
|
|
448
|
+
count(tenant?: string): Promise<number>;
|
|
449
|
+
listTenants(): Promise<AuditTenant[]>;
|
|
450
|
+
head(tenant: string): Promise<ChainHead>;
|
|
451
|
+
/** Verify a tenant's chain (whole retained range, or `fromSeq`..`toSeq`). */
|
|
452
|
+
verify(tenant: string, range?: {
|
|
453
|
+
fromSeq?: number;
|
|
454
|
+
toSeq?: number;
|
|
455
|
+
}): Promise<VerifyReport>;
|
|
456
|
+
/** Sign the tenant's current head. Throws {@link SignerRequiredError} without a signer. */
|
|
457
|
+
checkpoint(tenant: string, options?: ActorOptions): Promise<AuditCheckpoint>;
|
|
458
|
+
listCheckpoints(tenant: string): Promise<AuditCheckpoint[]>;
|
|
459
|
+
/** The public verification keys as a JWKS (empty for HMAC signers). */
|
|
460
|
+
jwks(): Promise<{
|
|
461
|
+
keys: JsonWebKey[];
|
|
462
|
+
}>;
|
|
463
|
+
erase(tenant: string, eventId: string, input?: EraseInput, options?: ActorOptions): Promise<AuditEvent>;
|
|
464
|
+
/** Erase the `actor` section of every event by `actorId` in the tenant. Resolves to the count. */
|
|
465
|
+
eraseActor(tenant: string, actorId: string, input?: {
|
|
466
|
+
reason?: string;
|
|
467
|
+
}, options?: ActorOptions): Promise<number>;
|
|
468
|
+
/** Note an export (before hook + self-audit). The export module calls this. */
|
|
469
|
+
noteExport(tenant: string, query: AuditQuery, format: string, options?: ActorOptions): Promise<void>;
|
|
470
|
+
listActions(): Promise<ActionDefinition[]>;
|
|
471
|
+
getAction(name: string): Promise<ActionDefinition | null>;
|
|
472
|
+
upsertAction(input: ActionDefinition, options?: ActorOptions): Promise<ActionDefinition>;
|
|
473
|
+
deleteAction(name: string, options?: ActorOptions): Promise<void>;
|
|
474
|
+
prune(options?: ActorOptions): Promise<PruneResult[]>;
|
|
475
|
+
pruneTenant(tenant: string, options?: ActorOptions): Promise<PruneResult>;
|
|
476
|
+
/**
|
|
477
|
+
* Register a lower bound retention must not prune past (stream runners
|
|
478
|
+
* register their slowest cursor). Returns an unregister function.
|
|
479
|
+
*/
|
|
480
|
+
addRetentionFloor(floor: (tenant: string) => Promise<number | null>): () => void;
|
|
481
|
+
/**
|
|
482
|
+
* Resolves once background work started by recording (automatic checkpoints)
|
|
483
|
+
* has settled. Await it in tests and before shutting down.
|
|
484
|
+
*/
|
|
485
|
+
settled(): Promise<void>;
|
|
486
|
+
}
|
|
487
|
+
/**
|
|
488
|
+
* Create the audit core.
|
|
489
|
+
*
|
|
490
|
+
* @example
|
|
491
|
+
* ```ts
|
|
492
|
+
* import { createAuditCore } from "@xtandard/audit";
|
|
493
|
+
* import { createMemoryStorage } from "@xtandard/audit/storage/memory";
|
|
494
|
+
*
|
|
495
|
+
* const audit = createAuditCore({ storage: createMemoryStorage() });
|
|
496
|
+
*
|
|
497
|
+
* await audit.record({
|
|
498
|
+
* tenant: "acme",
|
|
499
|
+
* action: "invoice.paid",
|
|
500
|
+
* actor: { id: "user_1", name: "Ada" },
|
|
501
|
+
* targets: [{ type: "invoice", id: "inv_1" }],
|
|
502
|
+
* metadata: { amount: 4200 },
|
|
503
|
+
* });
|
|
504
|
+
*
|
|
505
|
+
* const page = await audit.query({ tenant: "acme", actions: ["invoice.*"] });
|
|
506
|
+
* ```
|
|
507
|
+
*/
|
|
508
|
+
declare function createAuditCore<const A extends ActionMap = ActionMap>(options: AuditCoreOptions<A>): AuditCore<A>;
|
|
509
|
+
/** Erase sections of an event, keeping its digests (ADR 0011). */
|
|
510
|
+
declare function eraseSections(event: AuditEvent, sections: readonly AuditSection[]): AuditEvent;
|
|
511
|
+
//#endregion
|
|
512
|
+
export { verifyCheckpointSignature as $, defineActions as A, computeDigests as B, maskValue as C, ActionMetadataInput as D, ActionMap as E, VerifyChainOptions as F, hmacVerificationKey as G, ed25519VerificationKey as H, VerifyIssue as I, sealEvent as J, keysFromJwks as K, VerifyIssueKind as L, AuditSigner as M, AuditVerificationKey as N, ActionSpec as O, GENESIS_HASH as P, verifyChain as Q, VerifyReport as R, mask as S, redact as T, generateSigningKeyPair as U, ed25519Signer as V, hmacSigner as W, sha256 as X, sectionDigest as Y, signCheckpoint as Z, AuditTransform as _, ConflictError as a, applyTransforms as b, PruneResult as c, RetentionOptions as d, verifyEvent as et, RetentionRule as f, eraseSections as g, createAuditCore as h, CheckpointOptions as i, runStandardSchema as j, StandardSchemaV1 as k, ReadonlyError as l, SignerRequiredError as m, AuditCore as n, createKvEventLog as nt, EraseInput as o, SELF_AUDIT_ACTIONS as p, sealChain as q, AuditCoreOptions as r, resolveEventLog as rt, NotFoundError as s, ActorOptions as t, EventLog as tt, RecordInput as u, REDACTED as v, omit as w, hashValue as x, TransformableEvent as y, chainHeader as z };
|
|
513
|
+
//# sourceMappingURL=core-KtEHRScZ.d.mts.map
|
package/dist/core.cjs
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_core = require("./core-CTr7dw0v.cjs");
|
|
3
|
+
exports.ConflictError = require_core.ConflictError;
|
|
4
|
+
exports.NotFoundError = require_core.NotFoundError;
|
|
5
|
+
exports.ReadonlyError = require_core.ReadonlyError;
|
|
6
|
+
exports.SELF_AUDIT_ACTIONS = require_core.SELF_AUDIT_ACTIONS;
|
|
7
|
+
exports.SignerRequiredError = require_core.SignerRequiredError;
|
|
8
|
+
exports.createAuditCore = require_core.createAuditCore;
|
|
9
|
+
exports.eraseSections = require_core.eraseSections;
|
package/dist/core.d.cts
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as ConflictError, c as PruneResult, d as RetentionOptions, f as RetentionRule, g as eraseSections, h as createAuditCore, i as CheckpointOptions, l as ReadonlyError, m as SignerRequiredError, n as AuditCore, o as EraseInput, p as SELF_AUDIT_ACTIONS, r as AuditCoreOptions, s as NotFoundError, t as ActorOptions, u as RecordInput } from "./core-C0ceVOTk.cjs";
|
|
2
|
+
export { ActorOptions, AuditCore, AuditCoreOptions, CheckpointOptions, ConflictError, EraseInput, NotFoundError, PruneResult, ReadonlyError, RecordInput, RetentionOptions, RetentionRule, SELF_AUDIT_ACTIONS, SignerRequiredError, createAuditCore, eraseSections };
|
package/dist/core.d.mts
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as ConflictError, c as PruneResult, d as RetentionOptions, f as RetentionRule, g as eraseSections, h as createAuditCore, i as CheckpointOptions, l as ReadonlyError, m as SignerRequiredError, n as AuditCore, o as EraseInput, p as SELF_AUDIT_ACTIONS, r as AuditCoreOptions, s as NotFoundError, t as ActorOptions, u as RecordInput } from "./core-KtEHRScZ.mjs";
|
|
2
|
+
export { ActorOptions, AuditCore, AuditCoreOptions, CheckpointOptions, ConflictError, EraseInput, NotFoundError, PruneResult, ReadonlyError, RecordInput, RetentionOptions, RetentionRule, SELF_AUDIT_ACTIONS, SignerRequiredError, createAuditCore, eraseSections };
|
package/dist/core.mjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as SignerRequiredError, i as SELF_AUDIT_ACTIONS, n as NotFoundError, o as createAuditCore, r as ReadonlyError, s as eraseSections, t as ConflictError } from "./core-IdGEbYdM.mjs";
|
|
2
|
+
export { ConflictError, NotFoundError, ReadonlyError, SELF_AUDIT_ACTIONS, SignerRequiredError, createAuditCore, eraseSections };
|