@xtandard/audit 0.0.0-stage → 0.1.1
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 +386 -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 +31936 -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-B-qrQSOM.css +1 -0
- package/dist/ui/assets/index-CemlP5hR.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,193 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tamper evidence (ADR 0004): per-tenant hash chains with salted per-section
|
|
3
|
+
* digests, signed checkpoints, and a pure verifier.
|
|
4
|
+
*
|
|
5
|
+
* ```txt
|
|
6
|
+
* digest(section) = "sha256:" + hex(SHA-256(id + "\n" + canonical(section)))
|
|
7
|
+
* header = { v, id, tenant, seq, action, occurredAt, recordedAt,
|
|
8
|
+
* outcome, prevHash, digests }
|
|
9
|
+
* hash = "sha256:" + hex(SHA-256(canonical(header)))
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* Zero dependencies — Web Crypto only — so it runs in Bun, Node ≥ 20, Deno,
|
|
13
|
+
* browsers and Workers, and is what an auditor runs (`@xtandard/audit/verify`).
|
|
14
|
+
*
|
|
15
|
+
* @module
|
|
16
|
+
*/
|
|
17
|
+
import type { AuditCheckpoint, AuditEvent, AuditSection, JsonValue } from "./schema.ts";
|
|
18
|
+
/** `prevHash` of the first event of every chain. */
|
|
19
|
+
export declare const GENESIS_HASH: string;
|
|
20
|
+
/** `"sha256:" + hex(SHA-256(utf8(text)))`. */
|
|
21
|
+
export declare function sha256(text: string): Promise<string>;
|
|
22
|
+
/** base64url without padding. */
|
|
23
|
+
export declare function base64urlEncode(bytes: Uint8Array): string;
|
|
24
|
+
/** Decode base64url (with or without padding). */
|
|
25
|
+
export declare function base64urlDecode(value: string): Uint8Array;
|
|
26
|
+
/** An event before it is sealed into the chain. */
|
|
27
|
+
export type UnsealedEvent = Omit<AuditEvent, "integrity">;
|
|
28
|
+
/** The JSON value of one section of an event, as hashed. */
|
|
29
|
+
export declare function sectionValue(event: UnsealedEvent, section: AuditSection): JsonValue;
|
|
30
|
+
/** Salted digest of one section's value. */
|
|
31
|
+
export declare function sectionDigest(eventId: string, value: JsonValue): Promise<string>;
|
|
32
|
+
/** Compute every section digest of an (unerased) event. */
|
|
33
|
+
export declare function computeDigests(event: UnsealedEvent): Promise<Record<AuditSection, string>>;
|
|
34
|
+
/** The chained header for an event (what `hash` is computed over). */
|
|
35
|
+
export declare function chainHeader(event: UnsealedEvent, prevHash: string, digests: Record<AuditSection, string>): JsonValue;
|
|
36
|
+
/** Seal an event: compute its digests and its chain hash linked to `prevHash`. */
|
|
37
|
+
export declare function sealEvent(event: UnsealedEvent, prevHash: string): Promise<AuditEvent>;
|
|
38
|
+
/** Seal a batch for one tenant, linking each event to the previous one. */
|
|
39
|
+
export declare function sealChain(events: UnsealedEvent[], prevHash: string): Promise<AuditEvent[]>;
|
|
40
|
+
/** Why verification failed at a given point. */
|
|
41
|
+
export type VerifyIssueKind = "digest-mismatch" | "hash-mismatch" | "link-mismatch" | "seq-gap" | "tenant-mismatch" | "bad-signature" | "checkpoint-mismatch" | "unknown-key" | "unjustified-erasure" | "malformed";
|
|
42
|
+
/** One verification failure. */
|
|
43
|
+
export interface VerifyIssue {
|
|
44
|
+
kind: VerifyIssueKind;
|
|
45
|
+
seq?: number;
|
|
46
|
+
eventId?: string;
|
|
47
|
+
checkpointId?: string;
|
|
48
|
+
section?: AuditSection;
|
|
49
|
+
message: string;
|
|
50
|
+
}
|
|
51
|
+
/** Result of {@link verifyChain}. */
|
|
52
|
+
export interface VerifyReport {
|
|
53
|
+
/** True when no issue was found. */
|
|
54
|
+
ok: boolean;
|
|
55
|
+
tenant: string | null;
|
|
56
|
+
/** Events checked. */
|
|
57
|
+
checked: number;
|
|
58
|
+
/** First and last seq checked (null when empty). */
|
|
59
|
+
fromSeq: number | null;
|
|
60
|
+
toSeq: number | null;
|
|
61
|
+
/** Hash of the last checked event. */
|
|
62
|
+
headHash: string | null;
|
|
63
|
+
/**
|
|
64
|
+
* How the start of the range is anchored: `"genesis"` (seq 1),
|
|
65
|
+
* `"checkpoint"` (a verified checkpoint covers `fromSeq - 1`, or a `base`
|
|
66
|
+
* checkpoint), or `"unanchored"` (the first `prevHash` is trusted as given).
|
|
67
|
+
*/
|
|
68
|
+
anchor: "genesis" | "checkpoint" | "unanchored" | "none";
|
|
69
|
+
/** Whether links between events were checked (false for non-contiguous subsets). */
|
|
70
|
+
linksChecked: boolean;
|
|
71
|
+
/** Checkpoints whose signature and hash were verified. */
|
|
72
|
+
checkpointsVerified: number;
|
|
73
|
+
/**
|
|
74
|
+
* The highest seq covered by a verified checkpoint, or null. Events after it
|
|
75
|
+
* are internally consistent but not yet anchored by a signature.
|
|
76
|
+
*/
|
|
77
|
+
signedThrough: number | null;
|
|
78
|
+
/** Sections reported as erased (content removed, digest kept). */
|
|
79
|
+
erased: {
|
|
80
|
+
seq: number;
|
|
81
|
+
eventId: string;
|
|
82
|
+
sections: AuditSection[];
|
|
83
|
+
}[];
|
|
84
|
+
issues: VerifyIssue[];
|
|
85
|
+
}
|
|
86
|
+
/** A key able to verify checkpoint signatures. */
|
|
87
|
+
export interface AuditVerificationKey {
|
|
88
|
+
keyId: string;
|
|
89
|
+
alg: AuditCheckpoint["alg"];
|
|
90
|
+
verify(data: Uint8Array, signature: Uint8Array): Promise<boolean>;
|
|
91
|
+
}
|
|
92
|
+
/** Options for {@link verifyChain}. */
|
|
93
|
+
export interface VerifyChainOptions {
|
|
94
|
+
/** Checkpoints to check against the events (and whose signatures to verify). */
|
|
95
|
+
checkpoints?: AuditCheckpoint[];
|
|
96
|
+
/** Keys to verify checkpoint signatures with. Without keys, signatures are not checked. */
|
|
97
|
+
keys?: AuditVerificationKey[];
|
|
98
|
+
/**
|
|
99
|
+
* Treat the events as a contiguous range (default `true`): check seq
|
|
100
|
+
* continuity and `prevHash` links. Set `false` for filtered subsets — each
|
|
101
|
+
* event is then verified on its own.
|
|
102
|
+
*/
|
|
103
|
+
contiguous?: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Require every erased section to be justified by a chained
|
|
106
|
+
* `audit_log.erased` event (default `true`). The `erased` list itself is not
|
|
107
|
+
* covered by the hash, so this is what stops "erase" from being a way to
|
|
108
|
+
* silently replace content (ADR 0011). Set `false` when verifying a range
|
|
109
|
+
* that ends before the erasure records, or when self-audit is disabled.
|
|
110
|
+
*/
|
|
111
|
+
requireErasureRecords?: boolean;
|
|
112
|
+
}
|
|
113
|
+
/** Re-derive one event's digests and hash; returns the issues found. */
|
|
114
|
+
export declare function verifyEvent(event: AuditEvent): Promise<VerifyIssue[]>;
|
|
115
|
+
/**
|
|
116
|
+
* Verify a tenant's events (and optionally checkpoints). Pure: it trusts
|
|
117
|
+
* nothing but the data passed in and the keys.
|
|
118
|
+
*
|
|
119
|
+
* @example
|
|
120
|
+
* ```ts
|
|
121
|
+
* import { verifyChain, keysFromJwks } from "@xtandard/audit/verify";
|
|
122
|
+
*
|
|
123
|
+
* const report = await verifyChain(events, {
|
|
124
|
+
* checkpoints,
|
|
125
|
+
* keys: await keysFromJwks(jwks),
|
|
126
|
+
* });
|
|
127
|
+
* if (!report.ok) console.error(report.issues);
|
|
128
|
+
* ```
|
|
129
|
+
*/
|
|
130
|
+
export declare function verifyChain(events: AuditEvent[], options?: VerifyChainOptions): Promise<VerifyReport>;
|
|
131
|
+
/**
|
|
132
|
+
* Check that every erased section is justified by a chained `audit_log.erased`
|
|
133
|
+
* event among `events` (ADR 0011).
|
|
134
|
+
*/
|
|
135
|
+
export declare function erasureIssues(erased: VerifyReport["erased"], events: Iterable<AuditEvent>): VerifyIssue[];
|
|
136
|
+
/** Signs checkpoints. Implement your own (KMS, HSM) or use the built-ins. */
|
|
137
|
+
export interface AuditSigner {
|
|
138
|
+
keyId: string;
|
|
139
|
+
alg: AuditCheckpoint["alg"];
|
|
140
|
+
sign(data: Uint8Array): Promise<Uint8Array>;
|
|
141
|
+
/** The public verification key as a JWK (asymmetric signers only), for the JWKS route. */
|
|
142
|
+
publicJwk?(): Promise<JsonWebKey | null>;
|
|
143
|
+
/** A verification key for this signer (used by `core.verify`). */
|
|
144
|
+
verificationKey(): Promise<AuditVerificationKey>;
|
|
145
|
+
}
|
|
146
|
+
/** The bytes a checkpoint signature covers: canonical JSON of everything but `signature`. */
|
|
147
|
+
export declare function checkpointSigningBytes(cp: Omit<AuditCheckpoint, "signature">): Uint8Array;
|
|
148
|
+
/** Sign an unsigned checkpoint. */
|
|
149
|
+
export declare function signCheckpoint(signer: AuditSigner, unsigned: Omit<AuditCheckpoint, "signature" | "keyId" | "alg">): Promise<AuditCheckpoint>;
|
|
150
|
+
/** Verify one checkpoint's signature with a key. */
|
|
151
|
+
export declare function verifyCheckpointSignature(cp: AuditCheckpoint, key: AuditVerificationKey): Promise<boolean>;
|
|
152
|
+
/** RFC 7638 JWK thumbprint (base64url SHA-256) of an Ed25519 public key. */
|
|
153
|
+
export declare function jwkThumbprint(jwk: JsonWebKey): Promise<string>;
|
|
154
|
+
/** A JWK with its key id. */
|
|
155
|
+
export type AuditJwk = JsonWebKey & {
|
|
156
|
+
kid?: string;
|
|
157
|
+
};
|
|
158
|
+
/** Generate an Ed25519 key pair as JWKs (store `privateJwk` as a secret). */
|
|
159
|
+
export declare function generateSigningKeyPair(): Promise<{
|
|
160
|
+
keyId: string;
|
|
161
|
+
privateJwk: AuditJwk;
|
|
162
|
+
publicJwk: AuditJwk;
|
|
163
|
+
}>;
|
|
164
|
+
/** A verification key from an Ed25519 public JWK. */
|
|
165
|
+
export declare function ed25519VerificationKey(jwk: AuditJwk, keyId?: string): Promise<AuditVerificationKey>;
|
|
166
|
+
/**
|
|
167
|
+
* An Ed25519 signer from a private JWK (from {@link generateSigningKeyPair} or
|
|
168
|
+
* `xtandard-audit keygen`). The public half is served as a JWKS so customers
|
|
169
|
+
* can verify checkpoints themselves.
|
|
170
|
+
*
|
|
171
|
+
* @example
|
|
172
|
+
* ```ts
|
|
173
|
+
* import { ed25519Signer } from "@xtandard/audit";
|
|
174
|
+
*
|
|
175
|
+
* const signer = await ed25519Signer(JSON.parse(process.env.AUDIT_SIGNING_KEY!));
|
|
176
|
+
* ```
|
|
177
|
+
*/
|
|
178
|
+
export declare function ed25519Signer(privateJwk: AuditJwk, options?: {
|
|
179
|
+
keyId?: string;
|
|
180
|
+
}): Promise<AuditSigner>;
|
|
181
|
+
/** A verification key for {@link hmacSigner} checkpoints (needs the secret). */
|
|
182
|
+
export declare function hmacVerificationKey(secret: string, keyId?: string): AuditVerificationKey;
|
|
183
|
+
/**
|
|
184
|
+
* A symmetric HMAC-SHA256 signer: simplest setup, but only holders of the
|
|
185
|
+
* secret can verify — prefer {@link ed25519Signer} when customers verify.
|
|
186
|
+
*/
|
|
187
|
+
export declare function hmacSigner(secret: string, options?: {
|
|
188
|
+
keyId?: string;
|
|
189
|
+
}): AuditSigner;
|
|
190
|
+
/** Verification keys from a JWKS document (`GET {basePath}/api/integrity/keys`). */
|
|
191
|
+
export declare function keysFromJwks(jwks: {
|
|
192
|
+
keys: AuditJwk[];
|
|
193
|
+
}): Promise<AuditVerificationKey[]>;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Storage key layout for `@xtandard/audit`.
|
|
3
|
+
*
|
|
4
|
+
* Control data always lives in these KV keys. Events live here too on drivers
|
|
5
|
+
* without the native {@link ./storage/contract.EventLogStorage} capability (the
|
|
6
|
+
* generic fallback, ADR 0005). Pure string helpers — no dependencies.
|
|
7
|
+
*
|
|
8
|
+
* ```txt
|
|
9
|
+
* aud/tenants -> string[] index
|
|
10
|
+
* aud/actions -> string[] index (catalog)
|
|
11
|
+
* aud/actions/{name} -> ActionDefinition
|
|
12
|
+
* aud/t/{tenant}/head -> ChainHead
|
|
13
|
+
* aud/t/{tenant}/checkpoints/{chk id} -> AuditCheckpoint (time-sortable id)
|
|
14
|
+
* aud/streams/{stream}/cursors/{tenant} -> StreamCursor
|
|
15
|
+
* aud/streams/{stream}/meta -> { startedAt }
|
|
16
|
+
* aud/streams/{stream}/lease -> StreamLease
|
|
17
|
+
*
|
|
18
|
+
* — generic event log (KV fallback only) —
|
|
19
|
+
* aud/t/{tenant}/events/{seq 12} -> AuditEvent
|
|
20
|
+
* aud/t/{tenant}/ids/{event id} -> seq
|
|
21
|
+
* aud/t/{tenant}/ix/time/{ms 13}~{id} -> seq
|
|
22
|
+
* aud/t/{tenant}/ix/actor/{actorId}/{ms 13}~{id} -> seq
|
|
23
|
+
* aud/t/{tenant}/ix/action/{action}/{ms 13}~{id} -> seq
|
|
24
|
+
* aud/t/{tenant}/ix/target/{type}/{id}/{ms 13}~{id} -> seq
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* Zero-padded numbers make lexicographic key order equal numeric order, so a
|
|
28
|
+
* sorted `getKeys` scan yields events by seq (or by occurredAt for the `ix/`
|
|
29
|
+
* indexes) on every backend. Free-form segments (tenant, actor id, action,
|
|
30
|
+
* target type/id) are `encodeURIComponent`-escaped so `/` and `~` cannot break
|
|
31
|
+
* the layout.
|
|
32
|
+
*
|
|
33
|
+
* @module
|
|
34
|
+
*/
|
|
35
|
+
/** Root namespace segment for all keys. */
|
|
36
|
+
export declare const ROOT = "aud";
|
|
37
|
+
/** Zero-pad a seq to 12 digits. */
|
|
38
|
+
export declare const padSeq: (seq: number) => string;
|
|
39
|
+
/** Zero-pad epoch millis to 13 digits. */
|
|
40
|
+
export declare const padMs: (ms: number) => string;
|
|
41
|
+
/** Index of all tenant keys. */
|
|
42
|
+
export declare const tenantsKey: () => string;
|
|
43
|
+
/** Action catalog index. */
|
|
44
|
+
export declare const actionsKey: () => string;
|
|
45
|
+
/** One action catalog entry. */
|
|
46
|
+
export declare const actionKey: (name: string) => string;
|
|
47
|
+
/** Prefix under which everything belonging to one tenant lives. */
|
|
48
|
+
export declare const tenantPrefix: (tenant: string) => string;
|
|
49
|
+
/** The tenant's chain head. */
|
|
50
|
+
export declare const headKey: (tenant: string) => string;
|
|
51
|
+
/** Prefix of the tenant's checkpoints. */
|
|
52
|
+
export declare const checkpointsPrefix: (tenant: string) => string;
|
|
53
|
+
/** One checkpoint. */
|
|
54
|
+
export declare const checkpointKey: (tenant: string, id: string) => string;
|
|
55
|
+
/** Prefix of a stream's per-tenant cursors. */
|
|
56
|
+
export declare const streamCursorsPrefix: (stream: string) => string;
|
|
57
|
+
/** One stream cursor. */
|
|
58
|
+
export declare const streamCursorKey: (stream: string, tenant: string) => string;
|
|
59
|
+
/** A stream's metadata (first-run marker). */
|
|
60
|
+
export declare const streamMetaKey: (stream: string) => string;
|
|
61
|
+
/** A stream's runner lease. */
|
|
62
|
+
export declare const streamLeaseKey: (stream: string) => string;
|
|
63
|
+
/** Prefix of the tenant's events (by seq). */
|
|
64
|
+
export declare const eventsPrefix: (tenant: string) => string;
|
|
65
|
+
/** One event, keyed by seq. */
|
|
66
|
+
export declare const eventKey: (tenant: string, seq: number) => string;
|
|
67
|
+
/** Event id → seq. */
|
|
68
|
+
export declare const eventIdKey: (tenant: string, id: string) => string;
|
|
69
|
+
/** Prefix of a tenant's secondary indexes. */
|
|
70
|
+
export declare const indexRoot: (tenant: string) => string;
|
|
71
|
+
/** Time index prefix. */
|
|
72
|
+
export declare const timeIndexPrefix: (tenant: string) => string;
|
|
73
|
+
/** Actor index prefix. */
|
|
74
|
+
export declare const actorIndexPrefix: (tenant: string, actorId: string) => string;
|
|
75
|
+
/** Action index prefix. */
|
|
76
|
+
export declare const actionIndexPrefix: (tenant: string, action: string) => string;
|
|
77
|
+
/** Target index prefix. */
|
|
78
|
+
export declare const targetIndexPrefix: (tenant: string, type: string, id: string) => string;
|
|
79
|
+
/** The `{ms}~{id}` leaf of every index key. */
|
|
80
|
+
export declare const indexLeaf: (occurredAtMs: number, id: string) => string;
|
|
81
|
+
/** Parse an index key's leaf back into `(occurredAtMs, id)`. */
|
|
82
|
+
export declare const parseIndexLeaf: (key: string) => {
|
|
83
|
+
ms: number;
|
|
84
|
+
id: string;
|
|
85
|
+
} | null;
|
|
86
|
+
/** Parse a seq from an event key. */
|
|
87
|
+
export declare const parseEventKey: (key: string) => number | null;
|
|
88
|
+
/** Extract the trailing segment from a key. */
|
|
89
|
+
export declare const lastSegment: (key: string) => string;
|
|
90
|
+
/** Decode an escaped key segment. */
|
|
91
|
+
export declare const decodeSegment: (segment: string) => string;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The query model's runtime half (ADR 0007): normalization, the opaque keyset
|
|
3
|
+
* cursor, and the in-memory matcher shared by the memory driver and the generic
|
|
4
|
+
* KV fallback. Native drivers compile a {@link NormalizedQuery} to their own
|
|
5
|
+
* query language and must agree with {@link matchesQuery} (the conformance
|
|
6
|
+
* suite checks that).
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import type { AuditEvent, AuditOutcome, AuditQuery } from "./schema.ts";
|
|
11
|
+
/** Default page size. */
|
|
12
|
+
export declare const DEFAULT_QUERY_LIMIT = 50;
|
|
13
|
+
/** Maximum page size. */
|
|
14
|
+
export declare const MAX_QUERY_LIMIT = 500;
|
|
15
|
+
/** A keyset position: the `(occurredAt, id)` of the last item of a page. */
|
|
16
|
+
export interface QueryPosition {
|
|
17
|
+
occurredAt: string;
|
|
18
|
+
id: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A validated, defaulted query — what storage drivers receive. List filters
|
|
22
|
+
* are split into exact names and `prefix.` families; `search` is lower-cased.
|
|
23
|
+
*/
|
|
24
|
+
export interface NormalizedQuery {
|
|
25
|
+
tenant?: string;
|
|
26
|
+
/** Exact action names to include (OR). Empty = no constraint unless `actionPrefixes` set. */
|
|
27
|
+
actions: string[];
|
|
28
|
+
/** Action families (`"invoice."` for `"invoice.*"`) to include (OR with `actions`). */
|
|
29
|
+
actionPrefixes: string[];
|
|
30
|
+
excludeActions: string[];
|
|
31
|
+
excludeActionPrefixes: string[];
|
|
32
|
+
actorId?: string;
|
|
33
|
+
actorType?: string;
|
|
34
|
+
targetType?: string;
|
|
35
|
+
targetId?: string;
|
|
36
|
+
outcome?: AuditOutcome;
|
|
37
|
+
from?: string;
|
|
38
|
+
to?: string;
|
|
39
|
+
/** Lower-cased search needle. */
|
|
40
|
+
search?: string;
|
|
41
|
+
order: "desc" | "asc";
|
|
42
|
+
limit: number;
|
|
43
|
+
/** Start strictly after this position (decoded cursor). */
|
|
44
|
+
after?: QueryPosition;
|
|
45
|
+
}
|
|
46
|
+
/** Thrown for a malformed cursor or an invalid query value. Maps to HTTP 400. */
|
|
47
|
+
export declare class QueryError extends Error {
|
|
48
|
+
constructor(message: string);
|
|
49
|
+
}
|
|
50
|
+
/** Encode a keyset position as an opaque cursor. */
|
|
51
|
+
export declare function encodeCursor(position: QueryPosition): string;
|
|
52
|
+
/** Decode an opaque cursor; throws {@link QueryError} when malformed. */
|
|
53
|
+
export declare function decodeCursor(cursor: string): QueryPosition;
|
|
54
|
+
/** Validate and default a query. */
|
|
55
|
+
export declare function normalizeQuery(query?: AuditQuery): NormalizedQuery;
|
|
56
|
+
/** Does an action name pass the include/exclude lists? */
|
|
57
|
+
export declare function actionMatches(action: string, q: NormalizedQuery): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* The lower-cased text `search` matches against: action, actor id/name/email,
|
|
60
|
+
* target types/ids/names, description, and the JSON of metadata. Native
|
|
61
|
+
* drivers store this as a denormalized column/field.
|
|
62
|
+
*/
|
|
63
|
+
export declare function searchText(event: AuditEvent): string;
|
|
64
|
+
/** Compare two events by `(occurredAt, id)` ascending. */
|
|
65
|
+
export declare function compareEvents(a: QueryPosition, b: QueryPosition): number;
|
|
66
|
+
/** Is `event` strictly after `position` in the query's order? */
|
|
67
|
+
export declare function isAfter(event: QueryPosition, position: QueryPosition, order: "desc" | "asc"): boolean;
|
|
68
|
+
/** Does `event` satisfy every filter of `q` (ignoring pagination)? */
|
|
69
|
+
export declare function matchesQuery(event: AuditEvent, q: NormalizedQuery): boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Apply a normalized query to an in-memory list: filter, sort, keyset, limit.
|
|
72
|
+
* Used by the memory driver and the KV fallback.
|
|
73
|
+
*/
|
|
74
|
+
export declare function applyQuery(events: Iterable<AuditEvent>, q: NormalizedQuery): {
|
|
75
|
+
items: AuditEvent[];
|
|
76
|
+
hasMore: boolean;
|
|
77
|
+
};
|
|
78
|
+
/** Build the page envelope from driver results. */
|
|
79
|
+
export declare function toPage(result: {
|
|
80
|
+
items: AuditEvent[];
|
|
81
|
+
hasMore: boolean;
|
|
82
|
+
}): {
|
|
83
|
+
items: AuditEvent[];
|
|
84
|
+
pageInfo: {
|
|
85
|
+
hasNextPage: boolean;
|
|
86
|
+
endCursor: string | null;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The admin dashboard and the customer portal as React components, to embed in
|
|
3
|
+
* your own app (advanced mode). Most users mount the bundled SPA via a framework
|
|
4
|
+
* adapter and never touch React; this is for teams that want the panel inside an
|
|
5
|
+
* existing React shell.
|
|
6
|
+
*
|
|
7
|
+
* Two components share the same SPA internals:
|
|
8
|
+
*
|
|
9
|
+
* ```tsx
|
|
10
|
+
* import { AuditDashboard, AuditPortal } from "@xtandard/audit/react";
|
|
11
|
+
* import "@xtandard/audit/react/styles.css";
|
|
12
|
+
*
|
|
13
|
+
* // Full admin — point it at wherever the panel API is mounted:
|
|
14
|
+
* <AuditDashboard apiBaseUrl="/audit" />
|
|
15
|
+
*
|
|
16
|
+
* // Customer-scoped portal — pass a portal token minted server-side:
|
|
17
|
+
* <AuditPortal apiBaseUrl="/audit" token={portalToken} />
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* `react` and `react-dom` are peer dependencies in this mode. The components are
|
|
21
|
+
* self-contained otherwise (TanStack Query and styles are bundled).
|
|
22
|
+
*
|
|
23
|
+
* Import from `@xtandard/audit/react`.
|
|
24
|
+
*
|
|
25
|
+
* @module react
|
|
26
|
+
*/
|
|
27
|
+
import React from "react";
|
|
28
|
+
import type { BaseLocationHook } from "wouter";
|
|
29
|
+
import { QueryClient } from "@tanstack/react-query";
|
|
30
|
+
import { type FetchLike } from "./ui/api.ts";
|
|
31
|
+
import "./ui/styles.css";
|
|
32
|
+
/** Theme modes for the embedded components (see {@link AuditDashboardProps.theme}). */
|
|
33
|
+
export type EmbedTheme = "auto" | "inherit" | "light" | "dark";
|
|
34
|
+
/** Props for {@link AuditDashboard}. */
|
|
35
|
+
export interface AuditDashboardProps {
|
|
36
|
+
/**
|
|
37
|
+
* Base URL where the panel API + `/config` are mounted (e.g. `"/audit"` or
|
|
38
|
+
* `"https://admin.example.com/audit"`). Defaults to `""` (same origin, relative).
|
|
39
|
+
*/
|
|
40
|
+
apiBaseUrl?: string;
|
|
41
|
+
/**
|
|
42
|
+
* `credentials` mode for API requests. Defaults to `"same-origin"`. For a
|
|
43
|
+
* **cross-origin** embed (panel served from a different origin than this app)
|
|
44
|
+
* with cookie-based auth, set `"include"` — and enable `cors` on the panel
|
|
45
|
+
* server so it returns `Access-Control-Allow-Credentials`.
|
|
46
|
+
*/
|
|
47
|
+
credentials?: RequestCredentials;
|
|
48
|
+
/**
|
|
49
|
+
* Custom `fetch` for API requests — inject a bearer token / extra headers, or
|
|
50
|
+
* instrument calls. Defaults to the global `fetch`.
|
|
51
|
+
*/
|
|
52
|
+
fetch?: FetchLike;
|
|
53
|
+
/** Bring your own QueryClient; one is created if omitted. */
|
|
54
|
+
queryClient?: QueryClient;
|
|
55
|
+
/**
|
|
56
|
+
* Theme handling. The embed never writes to the host document — it resolves a
|
|
57
|
+
* theme and applies it to its own wrapper (`data-theme`), so surfaces, text,
|
|
58
|
+
* borders and code views always come from one theme.
|
|
59
|
+
* - `"auto"` (default) — the panel's own system/light/dark switcher (preference
|
|
60
|
+
* persisted in localStorage).
|
|
61
|
+
* - `"inherit"` — follow the host page, live: a `dark`/`light` class or
|
|
62
|
+
* `data-theme` attribute on `<html>` (then `<body>`), falling back to the OS
|
|
63
|
+
* `prefers-color-scheme`. The switcher is hidden; the host owns the theme.
|
|
64
|
+
* - `"light"` / `"dark"` — force one theme (switcher hidden). Useful when the
|
|
65
|
+
* host tracks its theme some other way: pass its resolved value.
|
|
66
|
+
*/
|
|
67
|
+
theme?: EmbedTheme;
|
|
68
|
+
/** Extra className on the dashboard root wrapper. */
|
|
69
|
+
className?: string;
|
|
70
|
+
/**
|
|
71
|
+
* How the dashboard routes between views/records.
|
|
72
|
+
* - `"hash"` (default) — routes in `location.hash`; never touches the host app's
|
|
73
|
+
* router or pathname. Safest when mounted inside another app.
|
|
74
|
+
* - `"browser"` — real history paths (clean URLs). Requires the host to serve the
|
|
75
|
+
* panel's `index.html` as a catch-all under `routerBase`, else refresh 404s.
|
|
76
|
+
* - `"memory"` — in-memory only; no URL coupling at all.
|
|
77
|
+
* - a custom wouter location hook for full control.
|
|
78
|
+
*/
|
|
79
|
+
routing?: "hash" | "browser" | "memory" | BaseLocationHook;
|
|
80
|
+
/** Base path the panel is mounted at, used by `routing: "browser"` (e.g. `"/admin/audit"`). */
|
|
81
|
+
routerBase?: string;
|
|
82
|
+
/** Navbar logo image URL (replaces the title wordmark). Overrides server `/config`. */
|
|
83
|
+
logoUrl?: string;
|
|
84
|
+
/**
|
|
85
|
+
* Pre-select a tenant on first render, overriding the default ("All
|
|
86
|
+
* tenants") — e.g. an admin panel embedding one dashboard per customer. The
|
|
87
|
+
* URL still wins when it names one (`?tenant=`), so deep links and the in-app
|
|
88
|
+
* switcher behave normally afterwards.
|
|
89
|
+
*/
|
|
90
|
+
initialTenant?: string;
|
|
91
|
+
}
|
|
92
|
+
/** Props for {@link AuditPortal}. */
|
|
93
|
+
export interface AuditPortalProps extends Omit<AuditDashboardProps, "initialTenant"> {
|
|
94
|
+
/**
|
|
95
|
+
* Portal token (`audpt_…`) minted server-side via `createPortalToken()`. Sent as
|
|
96
|
+
* an `Authorization: Bearer` credential on every API request; `/config` then
|
|
97
|
+
* reports `portal: true` and the shell renders the reduced, tenant-pinned
|
|
98
|
+
* portal chrome (Events explorer, export, integrity verification).
|
|
99
|
+
*/
|
|
100
|
+
token: string;
|
|
101
|
+
}
|
|
102
|
+
/** The full audit-log admin dashboard as an embeddable React component. */
|
|
103
|
+
export declare function AuditDashboard({ apiBaseUrl, credentials, fetch: fetchImpl, queryClient, theme, className, routing, routerBase, logoUrl, initialTenant, }: AuditDashboardProps): React.ReactElement;
|
|
104
|
+
/**
|
|
105
|
+
* The customer-facing log viewer as an embeddable React component. Renders
|
|
106
|
+
* the same shell as {@link AuditDashboard} with the portal token attached as
|
|
107
|
+
* a Bearer credential; the server scopes every request to the token's tenant
|
|
108
|
+
* (and its optional view filter) and `/config` flips the shell into the
|
|
109
|
+
* reduced portal chrome.
|
|
110
|
+
*/
|
|
111
|
+
export declare function AuditPortal({ token, ...rest }: AuditPortalProps): React.ReactElement;
|
|
112
|
+
export { setApiBase, setApiToken, type FetchLike } from "./ui/api.ts";
|
|
113
|
+
export { setThemePref, getThemePref, detectHostTheme, type ThemePref, type ResolvedTheme, } from "./ui/theme.ts";
|
|
114
|
+
export default AuditDashboard;
|