@dforge-core/metadata 0.0.32 → 0.0.33

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,17 @@ and this package adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ### Changed
11
+
12
+ - **`translations.schema.json`:** `views.<code>` accepts `desc` (the view description) next
13
+ to `label` (#1301). `TranslationsFile.views` gains `desc?`.
14
+
15
+ ### Removed
16
+
17
+ - **`isView` / `viewSql` on an entity** (#1312). SQL-view entities were never implemented:
18
+ the server dropped both keys and installed an empty table. `entity.schema.json` now
19
+ rejects them, and pack and install refuse them. `EntityDef` loses both fields.
20
+
10
21
  ## [0.0.32] — 2026-09-28
11
22
 
12
23
  ### Added
package/dist/index.d.ts CHANGED
@@ -712,12 +712,8 @@ interface EntityDef {
712
712
  description?: string;
713
713
  /** Database schema name override (defaults to module schema). */
714
714
  schema?: string;
715
- /** Database table/view name (defaults to entity code). */
715
+ /** Database table name (defaults to entity code). */
716
716
  dbObject?: string;
717
- /** When true, maps to a SQL view (read-only, no DDL). */
718
- isView?: boolean;
719
- /** SELECT statement for view-backed entities (`isView=true`). */
720
- viewSql?: string;
721
717
  /** Display pattern using column placeholders, e.g. "{first_name} {last_name}". */
722
718
  toString?: string;
723
719
  /** Audit trail level; overrides the manifest's `auditHistory`. */
@@ -743,9 +739,8 @@ interface EntityDef {
743
739
  } & Record<string, unknown>;
744
740
  /**
745
741
  * Entity views keyed by view name — the platform's column-level security.
746
- * Unrelated to `isView`/`viewSql` above (a SQL-view-backed entity) and to
747
- * `ui/data_views.json` (grids, kanban, calendars), both of which the word
748
- * "view" also names in this platform. A
742
+ * Unrelated to `ui/data_views.json` (grids, kanban, calendars), which the
743
+ * word "view" also names in this platform. A
749
744
  * folder binds one view per entity through `ui/folders.json`
750
745
  * (`entities.<code>.viewName`); users working in that folder see ONLY the
751
746
  * columns the view lists. An entity without views (or a folder naming the
@@ -1462,6 +1457,7 @@ interface TranslationsFile {
1462
1457
  }>;
1463
1458
  views?: Record<string, {
1464
1459
  label?: string;
1460
+ desc?: string;
1465
1461
  }>;
1466
1462
  menus?: Record<string, TranslatedMenu>;
1467
1463
  settings?: Record<string, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dforge-core/metadata",
3
- "version": "0.0.32",
3
+ "version": "0.0.33",
4
4
  "description": "Canonical dForge authoring registries — field types, base datatypes, column types, traits, data-view kinds and chart types — 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",
@@ -2,7 +2,7 @@
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
3
  "$id": "https://dforge.dev/schemas/entity.schema.json",
4
4
  "title": "dForge Entity Definition",
5
- "description": "Defines an entity (table/view mapping) for a dForge module",
5
+ "description": "Defines an entity (a table) for a dForge module",
6
6
  "type": "object",
7
7
  "anyOf": [
8
8
  { "required": ["fields"] },
@@ -24,16 +24,7 @@
24
24
  },
25
25
  "dbObject": {
26
26
  "type": "string",
27
- "description": "Database table or view name (defaults to entity code)"
28
- },
29
- "isView": {
30
- "type": "boolean",
31
- "description": "When true, entity maps to a SQL view (read-only, no DDL generation). Default: false (table-backed).",
32
- "default": false
33
- },
34
- "viewSql": {
35
- "type": "string",
36
- "description": "SQL SELECT statement for view-backed entities (isView=true). Executed as CREATE OR REPLACE VIEW during module install."
27
+ "description": "Database table name (defaults to entity code)"
37
28
  },
38
29
  "toString": {
39
30
  "description": "Display pattern using column placeholders, e.g. \"{first_name} {last_name}\" — the caption of a record wherever it is referenced. Every `{placeholder}` must name a field of the entity (trait columns included) and not a set; pack and install fail otherwise. Omitted, the install generates one from the fields and warns. Not declared on extension entities (with `extends`). No `type` constraint here because `toString` collides with Object.prototype.toString in JSON validators — they read the inherited function and reject it, even when the property is absent from the JSON."
@@ -151,7 +142,7 @@
151
142
  },
152
143
  "views": {
153
144
  "type": "object",
154
- "description": "Entity views keyed by view name — column-level security. Unrelated to 'isView'/'viewSql' (a SQL-view-backed entity) and to ui/data_views.json (grids, kanban, calendars). A folder binds one view per entity via ui/folders.json (entities.<code>.viewName); users working in that folder see ONLY the columns the view lists. Entities without views show the entity's full column set; a folder naming a view that isn't declared here FAILS the install, since resolving it to nothing would show every column \u2014 the opposite of what naming a view asks for. A view can only be declared by the entity's own module: an extension ('extends') declaring 'views' is rejected, because a view lists the complete column set and an extension knows only the columns it adds.",
145
+ "description": "Entity views keyed by view name — column-level security. Unrelated to ui/data_views.json (grids, kanban, calendars). A folder binds one view per entity via ui/folders.json (entities.<code>.viewName); users working in that folder see ONLY the columns the view lists. Entities without views show the entity's full column set; a folder naming a view that isn't declared here FAILS the install, since resolving it to nothing would show every column \u2014 the opposite of what naming a view asks for. A view can only be declared by the entity's own module: an extension ('extends') declaring 'views' is rejected, because a view lists the complete column set and an extension knows only the columns it adds.",
155
146
  "propertyNames": {
156
147
  "pattern": "^[a-zA-Z_][a-zA-Z0-9_-]*$",
157
148
  "maxLength": 100
@@ -32,9 +32,9 @@
32
32
  },
33
33
  "views": {
34
34
  "type": "object",
35
- "description": "Data view code → label.",
35
+ "description": "Data view code → label and description (the subtitle under the view title).",
36
36
  "additionalProperties": {
37
- "$ref": "#/$defs/labelOnly"
37
+ "$ref": "#/$defs/labelDesc"
38
38
  }
39
39
  },
40
40
  "menus": {
package/src/entity.ts CHANGED
@@ -162,12 +162,8 @@ export interface EntityDef {
162
162
  description?: string;
163
163
  /** Database schema name override (defaults to module schema). */
164
164
  schema?: string;
165
- /** Database table/view name (defaults to entity code). */
165
+ /** Database table name (defaults to entity code). */
166
166
  dbObject?: string;
167
- /** When true, maps to a SQL view (read-only, no DDL). */
168
- isView?: boolean;
169
- /** SELECT statement for view-backed entities (`isView=true`). */
170
- viewSql?: string;
171
167
  /** Display pattern using column placeholders, e.g. "{first_name} {last_name}". */
172
168
  toString?: string;
173
169
  /** Audit trail level; overrides the manifest's `auditHistory`. */
@@ -191,9 +187,8 @@ export interface EntityDef {
191
187
  params?: { restricted?: boolean } & Record<string, unknown>;
192
188
  /**
193
189
  * Entity views keyed by view name — the platform's column-level security.
194
- * Unrelated to `isView`/`viewSql` above (a SQL-view-backed entity) and to
195
- * `ui/data_views.json` (grids, kanban, calendars), both of which the word
196
- * "view" also names in this platform. A
190
+ * Unrelated to `ui/data_views.json` (grids, kanban, calendars), which the
191
+ * word "view" also names in this platform. A
197
192
  * folder binds one view per entity through `ui/folders.json`
198
193
  * (`entities.<code>.viewName`); users working in that folder see ONLY the
199
194
  * columns the view lists. An entity without views (or a folder naming the
@@ -47,7 +47,7 @@ export interface TranslationsFile {
47
47
  domains?: Record<string, TranslatedWithOptions>;
48
48
  /** Folder code (flat, not the path) → label. */
49
49
  folders?: Record<string, { label?: string }>;
50
- views?: Record<string, { label?: string }>;
50
+ views?: Record<string, { label?: string; desc?: string }>;
51
51
  menus?: Record<string, TranslatedMenu>;
52
52
  settings?: Record<string, { label?: string; desc?: string }>;
53
53
  /** Module-qualified role code → label. */