@akanjs/cli 3.1.0-rc.24 → 3.1.0-rc.26

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/.build-stamp CHANGED
@@ -1 +1 @@
1
- bf09952cfa342516d477d043aa7edae07aa3a15412cc50590fcadb0d1d6c0083
1
+ 97f9c99b37757e29b66df933d826193b592050f9934def1cb9b2f50d0679aeef
@@ -324,9 +324,10 @@ orchestration in `service`, client state in `store`; `Template` is forms, `Unit`
324
324
  `sort: {}` always present. Chain methods validate → mutate → `return this`, never `save()` (the caller saves, so
325
325
  `org.removeUser(id).removeInvite(id).save()` composes), with a one-line transition comment above each. Atomic
326
326
  counters live on the Model class with the updater callback, returning `!!modifiedCount`; indexes and derived
327
- totals go in `static override _onSchema`. **Removal is always soft** and reads see live rows unless
328
- `{ withRemoved: true }`. `updateById` / `removeById` fire no hooks — a cascading or `_postRemove` model removes
329
- through `remove<Model>(id)`, and `pickAndWrite` writes through the save hooks (`queryRule`).
327
+ totals go in `static override _onSchema`. **Removal is soft** and reads see live rows unless
328
+ `{ withRemoved: true }`; the one hard delete is `purge<Filter>` / `purgeMany`, for data past retention.
329
+ `updateById` / `removeById` fire no hooks — a cascading or `_postRemove` model removes through
330
+ `remove<Model>(id)`, and `pickAndWrite` writes through the save hooks (`queryRule`).
330
331
  - **`<model>.service.ts`** — a few lines: load → chain → `return await ….save()` (keep the `return await`). Side
331
332
  effects go in `override async _preUpdate` / `_postCreate`; fire-and-forget is `void`-ed. Load every referenced
332
333
  document, then save, then notify. Return `null` / `false` for not allowed or not found; the signal decides
@@ -88,8 +88,12 @@ this is the full contract behind them.
88
88
 
89
89
  ## Soft Removal And The Facade's Writes
90
90
 
91
- - **Removal is always soft** — the framework has no hard delete for a model table, and `delete` is deliberately
92
- left unused so it can mean one later. Every read and query-level write sees live rows only (`removedAt IS NULL`).
91
+ - **Removal is soft** — every remove stamps `removedAt`, and every read and query-level write sees live rows only
92
+ (`removedAt IS NULL`).
93
+ - **`purge<Filter>(...)` / `purgeMany(query)` is the one hard delete**, for data you mean to lose, such as logs past
94
+ their retention. It deletes every row the query matches, removed rows too (`{ removedAt: q.lt(cutoff) }` clears old
95
+ removals), and returns the count. The search mirror's rows go with each row, and it runs no hook, cascade or live
96
+ event and has no undo. It deletes 1,000 rows per statement, and it refuses a query that matches every row.
93
97
  - **`{ withRemoved: true }` reaches removed rows**: the third argument of `find` / `findOne` / `findById`
94
98
  (projection second, `null` when none), the last of `count` / `exists` / `updateMany`, or inside `updateOne` /
95
99
  `updateById`'s options. Without it, a `removedAt` condition only a removed row can meet (`q.exists("removedAt")`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akanjs/cli",
3
- "version": "3.1.0-rc.24",
3
+ "version": "3.1.0-rc.26",
4
4
  "sourceType": "module",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -39,7 +39,7 @@
39
39
  "@earendil-works/pi-tui": "1.3.0",
40
40
  "@inquirer/prompts": "^8.7.3",
41
41
  "@tailwindcss/node": "^4.3.3",
42
- "akanjs": "3.1.0-rc.24",
42
+ "akanjs": "3.1.0-rc.26",
43
43
  "chalk": "^6.0.1",
44
44
  "commander": "^15.0.0",
45
45
  "dayjs": "^1.11.23",