@akanjs/cli 3.0.0-alpha.2 → 3.0.0-alpha.3
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
|
-
|
|
1
|
+
5f4cb4962f5027c269281e372337f2349defcfca97ac7c862b17e452e9749c5d
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akanjs/cli",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.3",
|
|
4
4
|
"sourceType": "module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@langchain/openai": "^1.4.6",
|
|
35
35
|
"@tailwindcss/node": "^4.3.0",
|
|
36
36
|
"@trapezedev/project": "^7.1.4",
|
|
37
|
-
"akanjs": "3.0.0-alpha.
|
|
37
|
+
"akanjs": "3.0.0-alpha.3",
|
|
38
38
|
"chalk": "^5.6.2",
|
|
39
39
|
"commander": "^14.0.3",
|
|
40
40
|
"dayjs": "^1.11.20",
|
|
@@ -881,6 +881,10 @@ A short list of things the type system does not always catch:
|
|
|
881
881
|
fires no hooks and therefore no cascade.
|
|
882
882
|
- **Removal is always soft, and `delete` is reserved.** `remove(id)`, the facade's `removeMany(query)`, and the
|
|
883
883
|
store's `removeManyByQuery` all stamp `removedAt`; the framework has no hard delete for a model table.
|
|
884
|
+
- **The model facade spells out `Many`/`One` on its writes** — `updateOne`, `updateMany`, `removeOne`, `removeMany`
|
|
885
|
+
— because a bare `update`/`remove` would read like the document-path `update(id)` / `doc.remove()` while hitting
|
|
886
|
+
every match. Reads keep the short `find`/`findOne` pair, and counting is `count(query)` (`countDocuments` is
|
|
887
|
+
`@deprecated`).
|
|
884
888
|
- **`q.search()` is a filter node, not a slice requirement.** Prefer
|
|
885
889
|
`bySearch: filter().arg("text", String).query((text, q) => q.search(text, { prefix: true }))` — the generated
|
|
886
890
|
`listBySearch` / `countBySearch` / `queryBySearch` / `insightBySearch` come for free. Only add a search slice when
|
|
@@ -958,8 +962,12 @@ akan sync automatically generates APIs across all layers. Only write custom logi
|
|
|
958
962
|
| `pick[Query](args)`, `pickId[Query](args)` | Find one (throw if not found) |
|
|
959
963
|
| `exists[Query](args)`, `count[Query](args)` | Existence check and count |
|
|
960
964
|
| `insight[Query](args)`, `query[Query](args)` | Insight and raw query |
|
|
965
|
+
| `remove[Query](args)`, `removeOne[Query](args)` | Query-level soft remove — all matches, or the newest one (`createdAt` desc, not caller-chosen) |
|
|
966
|
+
| `update[Query](args).set(patch)`, `updateOne[Query](args).set(patch)` | Query-level update — the patch lands on a terminal `.set()`, because a filter's trailing args may be optional |
|
|
961
967
|
|
|
962
|
-
**Rule**: Define `Filter` with `.query()` conditions in `document.ts`. akan sync auto-generates all
|
|
968
|
+
**Rule**: Define `Filter` with `.query()` conditions in `document.ts`. akan sync auto-generates all 14 query helper methods per filter. Write `Document` chain methods only for state transitions with validation.
|
|
969
|
+
|
|
970
|
+
**The four query-level writes fire no hooks**, so no `_pre`/`_postRemove` and no cascade run — same as `updateManyByQuery`. Reach for them when the model carries no removal side effect; otherwise remove documents one at a time. A filter keyed after its own model (filter `chat` on model `chat`) is rejected at boot, because `removeChat`/`updateChat` would otherwise shadow the generated single-document CRUD.
|
|
963
971
|
|
|
964
972
|
## Generated Context
|
|
965
973
|
|