@dforge-core/metadata 0.0.10 → 0.0.12

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
@@ -5,6 +5,33 @@ All notable changes to `@dforge-core/metadata` are documented here.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this package adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.0.12] — 2026-08-04
9
+
10
+ ### Changed
11
+
12
+ - **`schemas/entity.schema.json` — `flags` and `isNullable` now describe what they
13
+ actually do.** Both are re-vendored from `docs/schemas`; the change is to their
14
+ `description` text only. No constraint moved, so nothing that validated before
15
+ validates differently now — but these strings are what an editor shows on hover,
16
+ and both were misleading after `M` became load-bearing:
17
+ - `flags` — records that `M` is resolved into `isNullable: false` at install (so it
18
+ makes the column `NOT NULL`), that it is inert on virtual (`R`/`S`/`F`) and identity
19
+ columns, and that declaring it alongside `"isNullable": true` is rejected at pack
20
+ time. Previously it read only "M=Mandatory", which was true of the flag's name and
21
+ of nothing else — the flag was inert platform-wide until this release's server change.
22
+ - `isNullable` — records that omitting it means `true` (nullable), that only an
23
+ explicit `false` (or `M`, which resolves to it) makes a column `NOT NULL`, and that
24
+ adding it to a column existing tenant rows leave empty aborts the upgrade. The
25
+ previous text ("Whether the column allows NULL values") said nothing about the
26
+ default, which is the thing authors get wrong.
27
+
28
+ Both correspond to the platform-side change that made an upgrade reconcile column
29
+ nullability in both directions; see `docs/CHANGELOG.md` in `dForge-core`.
30
+
31
+ ## [0.0.11] — 2026-07-30
32
+
33
+ Version-only republish; no content change from `0.0.10`.
34
+
8
35
  ## [0.0.10] — 2026-07-24
9
36
 
10
37
  ### Added
package/dist/traits.js CHANGED
@@ -47,7 +47,7 @@ export const traits = [
47
47
  cd: "sorting",
48
48
  description: "Display order",
49
49
  fields: {
50
- order_num: { dbDatatype: "int4", fieldTypeCd: "number", flags: "VEM", orderNum: 9920, description: "Order" },
50
+ order_num: { dbDatatype: "int4", fieldTypeCd: "number", flags: "VE", orderNum: 9920, description: "Order" },
51
51
  },
52
52
  },
53
53
  { cd: "postable", description: "Document posting support (marker trait — actual state managed by A/L columns)", fields: {} },
@@ -57,11 +57,11 @@ export const traits = [
57
57
  cd: "period",
58
58
  description: "Period entity with key format, closed flag, date range",
59
59
  fields: {
60
- period_key: { dbDatatype: "varchar", fieldTypeCd: "text", flags: "VEM", isPk: true, isNullable: false, maxLen: 20, orderNum: 1, description: "Period Key" },
61
- description: { dbDatatype: "varchar", fieldTypeCd: "text", flags: "VEM", maxLen: 100, orderNum: 30, description: "Description" },
62
- closed: { dbDatatype: "bool", fieldTypeCd: "checkbox", flags: "VEM", isNullable: false, formula: "false", orderNum: 40, description: "Closed" },
63
- start_date: { dbDatatype: "date", fieldTypeCd: "date", flags: "VEM", orderNum: 50, description: "Start Date" },
64
- end_date: { dbDatatype: "date", fieldTypeCd: "date", flags: "VEM", orderNum: 60, description: "End Date" },
60
+ period_key: { dbDatatype: "varchar", fieldTypeCd: "text", flags: "VE", isPk: true, isNullable: false, maxLen: 20, orderNum: 1, description: "Period Key" },
61
+ description: { dbDatatype: "varchar", fieldTypeCd: "text", flags: "VE", maxLen: 100, orderNum: 30, description: "Description" },
62
+ closed: { dbDatatype: "bool", fieldTypeCd: "checkbox", flags: "VE", isNullable: false, formula: "false", orderNum: 40, description: "Closed" },
63
+ start_date: { dbDatatype: "date", fieldTypeCd: "date", flags: "VE", orderNum: 50, description: "Start Date" },
64
+ end_date: { dbDatatype: "date", fieldTypeCd: "date", flags: "VE", orderNum: 60, description: "End Date" },
65
65
  },
66
66
  },
67
67
  ];
@@ -1 +1 @@
1
- {"version":3,"file":"traits.js","sourceRoot":"","sources":["../src/traits.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,wDAAwD;AACxD,EAAE;AACF,iFAAiF;AACjF,8EAA8E;AAC9E,yEAAyE;AACzE,iDAAiD;AAIj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E,OAAO,EAAE,CAAC;IACtB,MAAM,MAAM,GAA6B,EAAE,CAAC;IAC5C,KAAK,MAAM,QAAQ,IAAI,KAAK,CAAC,QAAQ,IAAI,EAAE,EAAE,CAAC;QAC7C,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC;IAC1D,CAAC;IACD,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,KAAK,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;IAChE,OAAO,MAAM,CAAC;AACf,CAAC;AAED,gEAAgE;AAChE,MAAM,UAAU,YAAY,CAAC,QAA2B,EAAE,UAAkB;IAC3E,MAAM,MAAM,GAA6B,EAAE,CAAC;IAC5C,KAAK,MAAM,EAAE,IAAI,QAAQ;QAAE,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC,CAAC;IAC9E,OAAO,MAAM,CAAC;AACf,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dforge-core/metadata",
3
- "version": "0.0.10",
3
+ "version": "0.0.12",
4
4
  "description": "Canonical dForge authoring registries \u2014 field types, base datatypes, column types, traits, data-view kinds and chart types \u2014 with derivation helpers. Runtime-dependency-free; the single source of truth shared by editors, the web app and the CLI.",
5
5
  "license": "MIT",
6
6
  "author": "dForge",
@@ -130,7 +130,7 @@
130
130
  "flags": {
131
131
  "type": "string",
132
132
  "pattern": "^[VIEMH]*$",
133
- "description": "Display flags: V=Visible, I=Identity, E=Editable, M=Mandatory, H=Hidden"
133
+ "description": "Display flags: V=Visible, I=Identity, E=Editable, M=Mandatory, H=Hidden. M is resolved into isNullable:false at install, so it makes the column NOT NULL; it is inert on virtual (R/S/F) and identity columns. Declaring M together with isNullable:true is rejected at pack time."
134
134
  },
135
135
  "isPk": {
136
136
  "type": "boolean",
@@ -138,7 +138,7 @@
138
138
  },
139
139
  "isNullable": {
140
140
  "type": "boolean",
141
- "description": "Whether the column allows NULL values"
141
+ "description": "Whether the column allows NULL values. Omitted means true (nullable) — only an explicit false, or the M flag which resolves to it, makes the column NOT NULL. Adding it to a column that existing tenant rows leave empty aborts the upgrade."
142
142
  },
143
143
  "isIdentity": {
144
144
  "type": "boolean",
@@ -33,24 +33,24 @@
33
33
  "event": {
34
34
  "type": "string",
35
35
  "enum": ["insert", "update", "delete", "status_change", "any"],
36
- "description": "DB event that fires this trigger. 'status_change' only fires when the entity's status field actually changes value. 'any' fires for all insert/update/delete."
36
+ "description": "DB event that fires this trigger. 'status_change' only fires when the entity's status field actually changes value. 'any' fires for all insert/update/delete. Events are raised by the row change itself, whichever path wrote it \u2014 a user edit and an action's `[field] = value` both count \u2014 except for the DSL's insert()/update()/delete()/query() builtins writing OTHER records, which raise nothing."
37
37
  },
38
38
  "condition": {
39
39
  "type": "string",
40
- "description": "Optional formula expression — same shape as canExecute in action DSL. Uses `[field]` syntax to reference the affected record. Single-line, evaluates to boolean. If omitted, trigger fires for every matching event."
40
+ "description": "Optional formula expression — same shape as canExecute in action DSL. Uses `[field]` syntax to reference the affected record. Single-line, evaluates to boolean. If omitted, trigger fires for every matching event. Reference navigation (`[ref].[target]`) is REJECTED here: the event-time evaluator only reads columns of the changed row, so a nav path would resolve to null and the trigger would misfire. Navigate inside the action instead, or denormalise the value onto the watched entity."
41
41
  },
42
42
  "action": {
43
43
  "type": "string",
44
- "description": "Action code to invoke. The action must NOT use record-context (`[field]`) syntax in a way that requires the original triggering record — the trigger passes the record id via params. Cross-module form 'module.action' is supported."
44
+ "description": "Action code to invoke. The trigger binds the affected record to the action as RECORD CONTEXT, so the action reads its columns with `[field]` (and its PK with `[pk_column]`) exactly like a UI-invoked action — no lookup needed. The action's `entityCode` MUST equal this trigger's `entity`, and its `executionMode` must not be `batch`; both are enforced at pack time. Cross-module references use the qualified form 'module.action'."
45
45
  },
46
46
  "params": {
47
47
  "type": "object",
48
- "description": "Optional static parameters passed to the action at invocation time. Merged with the runtime-injected `record_id` / `record_old` (if event uses old-record diff)."
48
+ "description": "Optional STATIC parameters passed to the action at invocation time — the literal values written here, nothing else. Nothing is injected at runtime: there is no `record_id` param. The affected record arrives as record context (`[field]`), and its pre-change values as `old[field]` on update/delete/status_change events."
49
49
  },
50
50
  "async": {
51
51
  "type": "boolean",
52
- "default": false,
53
- "description": "When true, the action runs in the background — the triggering transaction commits before the action starts. Recommended for slow actions (emails, external API calls); background failures are logged, not surfaced to the caller. When false, the action runs synchronously inside the same transaction as the triggering insert/update/delete: if the action fails (e.g. calls error()), the whole mutation rolls back and the error is returned to the caller. Keep async:false actions fast — they run on the request's transaction."
52
+ "default": true,
53
+ "description": "When true (the default), the action runs in the background — the triggering transaction commits before the action starts. Recommended for slow actions (emails, external API calls); background failures are logged, not surfaced to the caller. When false, the action runs synchronously inside the same transaction as the triggering insert/update/delete: if the action fails (e.g. calls error()), the whole mutation rolls back and the error is returned to the caller — so an async:false trigger can undo the user's write. Keep async:false actions fast; they run on the request's transaction."
54
54
  }
55
55
  },
56
56
  "additionalProperties": false
package/src/traits.ts CHANGED
@@ -50,7 +50,7 @@ export const traits: readonly TraitDef[] = [
50
50
  cd: "sorting",
51
51
  description: "Display order",
52
52
  fields: {
53
- order_num: { dbDatatype: "int4", fieldTypeCd: "number", flags: "VEM", orderNum: 9920, description: "Order" },
53
+ order_num: { dbDatatype: "int4", fieldTypeCd: "number", flags: "VE", orderNum: 9920, description: "Order" },
54
54
  },
55
55
  },
56
56
  { cd: "postable", description: "Document posting support (marker trait — actual state managed by A/L columns)", fields: {} },
@@ -60,11 +60,11 @@ export const traits: readonly TraitDef[] = [
60
60
  cd: "period",
61
61
  description: "Period entity with key format, closed flag, date range",
62
62
  fields: {
63
- period_key: { dbDatatype: "varchar", fieldTypeCd: "text", flags: "VEM", isPk: true, isNullable: false, maxLen: 20, orderNum: 1, description: "Period Key" },
64
- description: { dbDatatype: "varchar", fieldTypeCd: "text", flags: "VEM", maxLen: 100, orderNum: 30, description: "Description" },
65
- closed: { dbDatatype: "bool", fieldTypeCd: "checkbox", flags: "VEM", isNullable: false, formula: "false", orderNum: 40, description: "Closed" },
66
- start_date: { dbDatatype: "date", fieldTypeCd: "date", flags: "VEM", orderNum: 50, description: "Start Date" },
67
- end_date: { dbDatatype: "date", fieldTypeCd: "date", flags: "VEM", orderNum: 60, description: "End Date" },
63
+ period_key: { dbDatatype: "varchar", fieldTypeCd: "text", flags: "VE", isPk: true, isNullable: false, maxLen: 20, orderNum: 1, description: "Period Key" },
64
+ description: { dbDatatype: "varchar", fieldTypeCd: "text", flags: "VE", maxLen: 100, orderNum: 30, description: "Description" },
65
+ closed: { dbDatatype: "bool", fieldTypeCd: "checkbox", flags: "VE", isNullable: false, formula: "false", orderNum: 40, description: "Closed" },
66
+ start_date: { dbDatatype: "date", fieldTypeCd: "date", flags: "VE", orderNum: 50, description: "Start Date" },
67
+ end_date: { dbDatatype: "date", fieldTypeCd: "date", flags: "VE", orderNum: 60, description: "End Date" },
68
68
  },
69
69
  },
70
70
  ] as const;