@dforge-core/metadata 0.0.33 → 0.0.35

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,68 @@ and this package adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.0.35] — 2026-10-07
11
+
12
+ ### Added
13
+
14
+ - **Domain-backed stored-procedure result columns:** `stored_procedures.schema.json` and
15
+ `SpColumnDef` accept `domain`; the domain supplies `fieldTypeCd`, `baseDatatypeCd` and
16
+ `params`, so a status a report returns no longer repeats the entity's option list.
17
+ - **`entity.schema.json`:** an `A` column posting from lines takes `groupLinesBy` — line
18
+ columns whose distinct values each post one movement instead of one per line, with `map`
19
+ read over the grouped columns plus the document.
20
+ - **`entity.schema.json`:** a binding's `map`, `headerMap` and `dateField` value may be an
21
+ expression — a string starting with `=` holding an `F`-column formula over the row, with
22
+ one-hop `[ref].[column]` reads.
23
+ - **`entity.schema.json`:** an `A` binding takes `dateTrunc` (`day`, `month`, `year`), which
24
+ takes the `dateField` value back to the start of that period.
25
+ - **`registers.schema.json`:** a register takes `label`, translated under the new
26
+ `registers` section of `translations.schema.json`.
27
+ - **`registers.schema.json`:** an `info` register with a `recorder` takes
28
+ `recordChangesOnly`, and its resources take `absentAs` — what a resource compares as
29
+ before any record is in effect.
30
+
31
+ ### Changed
32
+
33
+ - **`entity.schema.json`:** an index is typed — `fields` (required) plus an optional `using`
34
+ (`btree`, `hash`, `gin`, `gist`, `brin`). Any other key, `columns` among them, is refused;
35
+ the installer used to skip such an index without a word.
36
+
37
+ ## [0.0.34] — 2026-10-06
38
+
39
+ ### Added
40
+
41
+ - **`registers.schema.json`** for a module's `registers.json`: a register declared once —
42
+ `kind` (`balance`, `turnover`, `info`, `accounting`), dimensions, resources, journal, an
43
+ optional `totals` cache — that documents bind to. `entity.schema.json`: an `A` / `L` column
44
+ binds with `register`, `map`, `headerMap`, `dateField` and `skipPostingWhenEmpty` instead of
45
+ restating the register.
46
+ - **Register DSL built-ins** in `checkDsl`'s list: `getBalance`, `getTurnover`, `getSlice`,
47
+ `getAccountBalance`, `getAccountTurnover`, `getCorrespondence`.
48
+ - **`reports.schema.json`:** a report takes `label` (its name: page title, breadcrumb,
49
+ parameter dialog) beside `description` (what it shows, under the name). Without a label the
50
+ description is the name, as before; the platform warns about it at pack, validate and
51
+ install. `ReportDef` gains `label?`.
52
+ - **`reports.schema.json`:** dataset type `R` reads an accounting register over an interval
53
+ (`register`: `name`, `resource`, `interval`, `columns`, `filter`, `sort`, `rollup`).
54
+ - **Domain-backed module settings and trait fields:** `settings.schema.json` / `SettingDef`
55
+ and `traits.schema.json` accept `domain`; the domain supplies the type and control, and a
56
+ trait field naming one may not restate them.
57
+ - **`seed_data.schema.json`:** in `demo-data/`, a value may be a formula
58
+ (`{ "$f": "…" }`) and a file may `repeat` its records over `@var` `from`..`to`.
59
+ `SeedDataFile` gains `repeat?`; new `SeedDataRepeat` type.
60
+
61
+ ### Changed
62
+
63
+ - **`deps.schema.json`:** a contract against a system module (`admin`, `metadata`,
64
+ `workspace`, `sys-billing`) may declare `"entities": {}` — a pure platform-version gate for
65
+ a feature that introduced no entity. Against any other module at least one entity is still
66
+ required.
67
+ - **A bare `domain` code** resolves to the module's own domain, then a tenant-created one —
68
+ never another module's (`entity.schema.json`, `domains.schema.json` descriptions).
69
+
70
+ ## [0.0.33] — 2026-09-29
71
+
10
72
  ### Changed
11
73
 
12
74
  - **`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",