@geekmidas/audit 10.0.0-alpha.98 → 10.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/CHANGELOG.md +109 -0
  2. package/README.md +2 -2
  3. package/TECHNICAL.md +937 -0
  4. package/dist/{Auditor-BBXXCD0v.d.cts → Auditor-CW2NrfHS.d.mts} +7 -2
  5. package/dist/Auditor-CW2NrfHS.d.mts.map +1 -0
  6. package/dist/{Auditor-BBXXCD0v.d.mts → Auditor-DpBHXIJM.d.cts} +7 -2
  7. package/dist/Auditor-DpBHXIJM.d.cts.map +1 -0
  8. package/dist/Auditor.d.cts +1 -1
  9. package/dist/Auditor.d.mts +1 -1
  10. package/dist/Auditor.mjs +0 -1
  11. package/dist/DefaultAuditor-BAVnNmRh.mjs +96 -0
  12. package/dist/DefaultAuditor-BAVnNmRh.mjs.map +1 -0
  13. package/dist/DefaultAuditor-DlJ1ENfx.d.mts +59 -0
  14. package/dist/DefaultAuditor-DlJ1ENfx.d.mts.map +1 -0
  15. package/dist/DefaultAuditor-GRFI86N_.d.cts +59 -0
  16. package/dist/DefaultAuditor-GRFI86N_.d.cts.map +1 -0
  17. package/dist/DefaultAuditor-JbZ_BQfh.cjs +102 -0
  18. package/dist/DefaultAuditor-JbZ_BQfh.cjs.map +1 -0
  19. package/dist/DefaultAuditor.cjs +2 -95
  20. package/dist/DefaultAuditor.d.cts +3 -55
  21. package/dist/DefaultAuditor.d.mts +3 -55
  22. package/dist/DefaultAuditor.mjs +2 -94
  23. package/dist/cache-BbIl31RL.mjs +167 -0
  24. package/dist/cache-BbIl31RL.mjs.map +1 -0
  25. package/dist/cache-Bih6HxY6.d.cts +96 -0
  26. package/dist/cache-Bih6HxY6.d.cts.map +1 -0
  27. package/dist/cache-l7jAptBl.cjs +173 -0
  28. package/dist/cache-l7jAptBl.cjs.map +1 -0
  29. package/dist/cache-wET57t6d.d.mts +96 -0
  30. package/dist/cache-wET57t6d.d.mts.map +1 -0
  31. package/dist/cache.cjs +2 -166
  32. package/dist/cache.d.cts +3 -92
  33. package/dist/cache.d.mts +3 -92
  34. package/dist/cache.mjs +2 -165
  35. package/dist/chunk-CUT6urMc.cjs +30 -0
  36. package/dist/index.cjs +3 -3
  37. package/dist/index.d.cts +3 -3
  38. package/dist/index.d.mts +3 -3
  39. package/dist/index.mjs +3 -2
  40. package/dist/knex.cjs +9 -9
  41. package/dist/knex.cjs.map +1 -1
  42. package/dist/knex.d.cts +11 -9
  43. package/dist/knex.d.cts.map +1 -1
  44. package/dist/knex.d.mts +11 -9
  45. package/dist/knex.d.mts.map +1 -1
  46. package/dist/knex.mjs +7 -7
  47. package/dist/knex.mjs.map +1 -1
  48. package/dist/kysely.cjs +9 -9
  49. package/dist/kysely.cjs.map +1 -1
  50. package/dist/kysely.d.cts +11 -9
  51. package/dist/kysely.d.cts.map +1 -1
  52. package/dist/kysely.d.mts +11 -9
  53. package/dist/kysely.d.mts.map +1 -1
  54. package/dist/kysely.mjs +7 -7
  55. package/dist/kysely.mjs.map +1 -1
  56. package/dist/memory.cjs +7 -6
  57. package/dist/memory.cjs.map +1 -1
  58. package/dist/memory.d.cts +7 -3
  59. package/dist/memory.d.cts.map +1 -1
  60. package/dist/memory.d.mts +7 -3
  61. package/dist/memory.d.mts.map +1 -1
  62. package/dist/memory.mjs +4 -3
  63. package/dist/memory.mjs.map +1 -1
  64. package/dist/storage.d.cts +1 -1
  65. package/dist/storage.d.mts +1 -1
  66. package/dist/storage.mjs +0 -1
  67. package/dist/types.d.cts +1 -1
  68. package/dist/types.d.mts +1 -1
  69. package/dist/types.mjs +0 -1
  70. package/package.json +13 -19
  71. package/src/Auditor.ts +157 -0
  72. package/src/DefaultAuditor.ts +141 -0
  73. package/src/__tests__/CacheAuditStorage.spec.ts +382 -0
  74. package/src/__tests__/DefaultAuditor.spec.ts +529 -0
  75. package/src/__tests__/InMemoryAuditStorage.spec.ts +317 -0
  76. package/src/__tests__/KnexAuditStorage.integration.spec.ts +739 -0
  77. package/src/__tests__/KyselyAuditStorage.integration.spec.ts +518 -0
  78. package/src/__tests__/KyselyAuditStorage.spec.ts +443 -0
  79. package/src/cache.ts +263 -0
  80. package/src/index.ts +23 -0
  81. package/src/knex.ts +430 -0
  82. package/src/kysely.ts +424 -0
  83. package/src/memory.ts +50 -0
  84. package/src/storage.ts +203 -0
  85. package/src/types.ts +154 -0
  86. package/tsconfig.json +9 -0
  87. package/dist/Auditor-BBXXCD0v.d.cts.map +0 -1
  88. package/dist/Auditor-BBXXCD0v.d.mts.map +0 -1
  89. package/dist/DefaultAuditor.cjs.map +0 -1
  90. package/dist/DefaultAuditor.d.cts.map +0 -1
  91. package/dist/DefaultAuditor.d.mts.map +0 -1
  92. package/dist/DefaultAuditor.mjs.map +0 -1
  93. package/dist/cache.cjs.map +0 -1
  94. package/dist/cache.d.cts.map +0 -1
  95. package/dist/cache.d.mts.map +0 -1
  96. package/dist/cache.mjs.map +0 -1
package/CHANGELOG.md ADDED
@@ -0,0 +1,109 @@
1
+ # @geekmidas/audit
2
+
3
+ ## 10.0.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies []:
8
+ - @geekmidas/cache@10.0.0
9
+ - @geekmidas/schema@10.0.0
10
+
11
+ ## 9.0.2
12
+
13
+ ### Patch Changes
14
+
15
+ - [#12](https://github.com/geekmidas/toolbox/pull/12) [`d53863a`](https://github.com/geekmidas/toolbox/commit/d53863a84db2e4ab5420e08f79128b637043fc42) Thanks [@geekmidas](https://github.com/geekmidas)! - Align every published package on a single version and keep them in step.
16
+
17
+ All packages now share one version, enforced by a changesets `fixed` group. The
18
+ baseline is 9.0.1 — @geekmidas/client's published version — so nothing moves
19
+ backwards; this release takes the whole set to 9.0.2 together.
20
+
21
+ Independent versions made "which version of the docs applies to me"
22
+ unanswerable: a reader on constructs@7 and cli@2 was on no version at all. One
23
+ number per release makes versioned documentation possible, and lets 9 freeze as
24
+ the current paradigm while the constructs rework is developed against it.
25
+
26
+ Every release now publishes every package, and a major anywhere is a major
27
+ everywhere. Peer ranges get simpler in return.
28
+
29
+ - Updated dependencies [[`d53863a`](https://github.com/geekmidas/toolbox/commit/d53863a84db2e4ab5420e08f79128b637043fc42)]:
30
+ - @geekmidas/cache@9.0.2
31
+ - @geekmidas/schema@9.0.2
32
+
33
+ ## 2.2.1
34
+
35
+ ### Patch Changes
36
+
37
+ - 🐛 [#11](https://github.com/geekmidas/toolbox/pull/11) [`40f4dc0`](https://github.com/geekmidas/toolbox/commit/40f4dc095911b2223a255029d8f776caf7781309) Thanks [@geekmidas](https://github.com/geekmidas)! - Patch release across all packages to realign published versions with the
38
+ registry. The previous release only published the four packages that had
39
+ version bumps; the remaining packages failed with "cannot publish over the
40
+ previously published versions" because their versions were unchanged.
41
+ - Updated dependencies [[`40f4dc0`](https://github.com/geekmidas/toolbox/commit/40f4dc095911b2223a255029d8f776caf7781309)]:
42
+ - @geekmidas/cache@1.1.2
43
+ - @geekmidas/schema@1.0.4
44
+
45
+ ## 2.2.0
46
+
47
+ ### Minor Changes
48
+
49
+ - ✨ [#10](https://github.com/geekmidas/toolbox/pull/10) [`ae678fe`](https://github.com/geekmidas/toolbox/commit/ae678fe6fbc89307d052335468f1b955b306a604) Thanks [@geekmidas](https://github.com/geekmidas)! - Add Knex audit storage via a new `@geekmidas/audit/knex` entry point.
50
+
51
+ `KnexAuditStorage` mirrors `KyselyAuditStorage` — same config (`db`,
52
+ `tableName`, `databaseServiceName`, `autoId`), same `query()`/`count()`
53
+ filters, and the same transaction semantics. A `withAuditableTransaction`
54
+ helper is included; passing an existing transaction reuses it instead of
55
+ opening a savepoint, so audits roll back with the outer transaction.
56
+
57
+ Because it implements `withTransaction()`, `getDatabase()` and
58
+ `databaseServiceName`, endpoints wrap handlers and audit flushes in a single
59
+ transaction with Knex just as they do with Kysely.
60
+
61
+ `knex` is an optional peer dependency, so Kysely-only users are unaffected.
62
+
63
+ ## 2.1.0
64
+
65
+ ### Minor Changes
66
+
67
+ - [#9](https://github.com/geekmidas/toolbox/pull/9) [`e31a60a`](https://github.com/geekmidas/toolbox/commit/e31a60a971366180a0e7bec6e7da56d8f36aa21f) Thanks [@geekmidas](https://github.com/geekmidas)! - Support kysely 0.29.
68
+
69
+ kysely 0.29 moved `Migrator` and `FileMigrationProvider` from the root barrel
70
+ (`'kysely'`) to the `'kysely/migration'` subpath. `@geekmidas/testkit`'s
71
+ `PostgresKyselyMigrator` now imports `Migrator` from `'kysely/migration'` and
72
+ its kysely peer becomes `~0.29.4` — consumers must be on kysely 0.29+.
73
+
74
+ The library packages that only declare a kysely _peer_ (`db`, `audit`, `studio`,
75
+ `telescope`) don't touch the moved symbols, so their peer range is _widened_ to
76
+ `>=0.28.2 <0.30.0` — they now support both 0.28 and 0.29 (non-breaking).
77
+
78
+ `@geekmidas/cli`'s scaffolded `test/globalSetup.ts` template now imports
79
+ `FileMigrationProvider` from `'kysely/migration'` so generated projects work on
80
+ kysely 0.29.
81
+
82
+ ## 2.0.1
83
+
84
+ ### Patch Changes
85
+
86
+ - 🐛 [`d70c6c0`](https://github.com/geekmidas/toolbox/commit/d70c6c0aeb8a79da2473ac77dbd8255a4a2f5651) Thanks [@geekmidas](https://github.com/geekmidas)! - Fix `package.json` exports so TypeScript declarations resolve correctly under NodeNext/Bundler module resolution. Each subpath export now nests `types` inside its `import`/`require` condition, pointing at the `.d.mts` and `.d.cts` files that `tsdown` actually emits (previously the exports referenced non-existent `.d.ts` files, causing type-resolution failures for consumers). Both ESM (`.mjs`) and CJS (`.cjs`) runtime entry points are preserved. Additionally, `@geekmidas/ui` had `import` paths pointing at `.js` files that were never emitted — those are corrected to `.mjs`.
87
+
88
+ - Updated dependencies [[`d70c6c0`](https://github.com/geekmidas/toolbox/commit/d70c6c0aeb8a79da2473ac77dbd8255a4a2f5651)]:
89
+ - @geekmidas/cache@1.1.1
90
+ - @geekmidas/schema@1.0.2
91
+
92
+ ## 2.0.0
93
+
94
+ ### Patch Changes
95
+
96
+ - Updated dependencies [[`be4f7a9`](https://github.com/geekmidas/toolbox/commit/be4f7a9bd5de7f08adbca582916d6902e0c24de2)]:
97
+ - @geekmidas/cache@1.1.0
98
+
99
+ ## 1.0.0
100
+
101
+ ### Major Changes
102
+
103
+ - [`ff7b115`](https://github.com/geekmidas/toolbox/commit/ff7b11599f60f84ac6cdc73714c853ecf786b2e8) Thanks [@geekmidas](https://github.com/geekmidas)! - Version 1 Stable release
104
+
105
+ ### Patch Changes
106
+
107
+ - Updated dependencies [[`ff7b115`](https://github.com/geekmidas/toolbox/commit/ff7b11599f60f84ac6cdc73714c853ecf786b2e8)]:
108
+ - @geekmidas/cache@1.0.0
109
+ - @geekmidas/schema@1.0.0
package/README.md CHANGED
@@ -435,9 +435,9 @@ CREATE INDEX idx_audit_logs_entity_id ON audit_logs("entityId");
435
435
  The audit package integrates seamlessly with `@geekmidas/constructs` endpoints:
436
436
 
437
437
  ```typescript
438
- import { api } from '../constructs/api';
438
+ import { e } from '@geekmidas/constructs/endpoints';
439
439
 
440
- const endpoint = api
440
+ const endpoint = e
441
441
  .post('/users')
442
442
  .body(UserSchema)
443
443
  .output(UserResponseSchema)