@dforge-core/metadata 0.0.33 → 0.0.34

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/CHANGELOG.md CHANGED
@@ -7,6 +7,41 @@ and this package adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.0.34] — 2026-10-06
11
+
12
+ ### Added
13
+
14
+ - **`registers.schema.json`** for a module's `registers.json`: a register declared once —
15
+ `kind` (`balance`, `turnover`, `info`, `accounting`), dimensions, resources, journal, an
16
+ optional `totals` cache — that documents bind to. `entity.schema.json`: an `A` / `L` column
17
+ binds with `register`, `map`, `headerMap`, `dateField` and `skipPostingWhenEmpty` instead of
18
+ restating the register.
19
+ - **Register DSL built-ins** in `checkDsl`'s list: `getBalance`, `getTurnover`, `getSlice`,
20
+ `getAccountBalance`, `getAccountTurnover`, `getCorrespondence`.
21
+ - **`reports.schema.json`:** a report takes `label` (its name: page title, breadcrumb,
22
+ parameter dialog) beside `description` (what it shows, under the name). Without a label the
23
+ description is the name, as before; the platform warns about it at pack, validate and
24
+ install. `ReportDef` gains `label?`.
25
+ - **`reports.schema.json`:** dataset type `R` reads an accounting register over an interval
26
+ (`register`: `name`, `resource`, `interval`, `columns`, `filter`, `sort`, `rollup`).
27
+ - **Domain-backed module settings and trait fields:** `settings.schema.json` / `SettingDef`
28
+ and `traits.schema.json` accept `domain`; the domain supplies the type and control, and a
29
+ trait field naming one may not restate them.
30
+ - **`seed_data.schema.json`:** in `demo-data/`, a value may be a formula
31
+ (`{ "$f": "…" }`) and a file may `repeat` its records over `@var` `from`..`to`.
32
+ `SeedDataFile` gains `repeat?`; new `SeedDataRepeat` type.
33
+
34
+ ### Changed
35
+
36
+ - **`deps.schema.json`:** a contract against a system module (`admin`, `metadata`,
37
+ `workspace`, `sys-billing`) may declare `"entities": {}` — a pure platform-version gate for
38
+ a feature that introduced no entity. Against any other module at least one entity is still
39
+ required.
40
+ - **A bare `domain` code** resolves to the module's own domain, then a tenant-created one —
41
+ never another module's (`entity.schema.json`, `domains.schema.json` descriptions).
42
+
43
+ ## [0.0.33] — 2026-09-29
44
+
10
45
  ### Changed
11
46
 
12
47
  - **`translations.schema.json`:** `views.<code>` accepts `desc` (the view description) next
package/dist/dsl/index.js CHANGED
@@ -782,6 +782,45 @@ var BUILTINS = [
782
782
  returns: "object",
783
783
  doc: "Load the referenced record for a FK column. Read its fields with `ref.get('field')`."
784
784
  },
785
+ // Register reads. The first argument names a REGISTER (`module_cd.register_cd`,
786
+ // declared in that module's registers.json) and not an entity, so none of these
787
+ // carries `entityArg` — entity-code completion there would offer the wrong list.
788
+ {
789
+ name: "getBalance",
790
+ signature: "getBalance(register, dims?, asOf?)",
791
+ returns: "object",
792
+ doc: "Balance of an accumulation register per resource. A dimension left out of `dims` is summed over, so passing none gives the register's total. `asOf` reads as of a date instead of now."
793
+ },
794
+ {
795
+ name: "getTurnover",
796
+ signature: "getTurnover(register, dims, from, to)",
797
+ returns: "object",
798
+ doc: "What moved through a register over an interval: `{in, out, net}` per resource. `dims` may be `null` to sum over every dimension; `from` and `to` are both required."
799
+ },
800
+ {
801
+ name: "getSlice",
802
+ signature: "getSlice(register, dims, onDate?, mode?)",
803
+ returns: "object | null",
804
+ doc: "One record of an information register \u2014 the latest on or before `onDate`, or `null` when there is none. Returns the record plus `_period`. Unlike a balance, a dimension may NOT be omitted: a slice is one keyed record, not a sum."
805
+ },
806
+ {
807
+ name: "getAccountBalance",
808
+ signature: "getAccountBalance(register, account, filter?, asOf?)",
809
+ returns: "object",
810
+ doc: "Balance of one account of an accounting register: `{debit, credit, net}` per resource. `filter` narrows by a dimension, or by an analytic kind the ACCOUNT declares \u2014 an analytic takes the key alone, or `{ entity, value }` to name one entity of a kind that is a union of several."
811
+ },
812
+ {
813
+ name: "getAccountTurnover",
814
+ signature: "getAccountTurnover(register, account, filter, from, to)",
815
+ returns: "object",
816
+ doc: "What moved through one account over an interval: `{debit, credit, net}` per resource. `filter` narrows as in `getAccountBalance` and may be `null`; `from` and `to` are both required."
817
+ },
818
+ {
819
+ name: "getCorrespondence",
820
+ signature: "getCorrespondence(register, debitAccount, creditAccount, filter, from, to)",
821
+ returns: "object",
822
+ doc: 'What moved between two accounts over an interval. Needs `lineMode: "compound"` \u2014 a classic register records the other half of an entry as an untied second row and cannot answer this. `filter` narrows by dimensions the two sides share, never by an analytic (an analytic belongs to one account and this read names two).'
823
+ },
785
824
  // Messaging
786
825
  {
787
826
  name: "error",