@dforge-core/metadata 0.0.30 → 0.0.32
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 +100 -1
- package/dist/dsl/index.d.ts +25 -3
- package/dist/dsl/index.js +249 -23
- package/dist/dsl/index.js.map +1 -1
- package/dist/index.d.ts +84 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/schemas/diagram.schema.json +8 -5
- package/schemas/entity.schema.json +14 -1
- package/schemas/manifest.schema.json +2 -2
- package/schemas/traits.schema.json +5 -0
- package/schemas/translations.schema.json +267 -0
- package/src/dsl/builtins.ts +12 -7
- package/src/dsl/check.ts +42 -1
- package/src/dsl/index.ts +3 -0
- package/src/dsl/lexer.ts +39 -14
- package/src/dsl/messages.ts +196 -0
- package/src/dsl/types.ts +7 -0
- package/src/entity.ts +5 -0
- package/src/index.ts +11 -1
- package/src/manifest.ts +4 -2
- package/src/translations.ts +61 -0
package/src/index.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
// from a friendly field-type choice;
|
|
7
7
|
// • structural types — the authoring shape of every module-package file
|
|
8
8
|
// (manifest, entities, data views, reports, stored procedures, menus, folders,
|
|
9
|
-
// roles, settings, jobs, triggers, webhooks, print templates, seed data,
|
|
9
|
+
// roles, settings, jobs, triggers, webhooks, print templates, seed data, translations,
|
|
10
10
|
// actions, diagrams), mirrored from the JSON schemas under docs/schemas/.
|
|
11
11
|
//
|
|
12
12
|
// No runtime dependencies; safe to import from editors, the web app, the CLI,
|
|
@@ -69,6 +69,7 @@ export type {
|
|
|
69
69
|
SignConfig,
|
|
70
70
|
LedgerRegistryEntry,
|
|
71
71
|
TraitCd,
|
|
72
|
+
AuditHistoryLevel,
|
|
72
73
|
} from "./entity";
|
|
73
74
|
|
|
74
75
|
// Entity introspection helpers (primary keys, identity keys, reference links).
|
|
@@ -120,6 +121,15 @@ export type { MenusFile, MenuDef, MenuItemDef, MenuItemType } from "./menus";
|
|
|
120
121
|
export type { FoldersFile, FolderDef, FolderEntityBinding } from "./folders";
|
|
121
122
|
export type { DiagramFile, DiagramDef, DiagramEntity, DiagramDetail, DiagramRelation } from "./diagrams";
|
|
122
123
|
export type { RolesFile, RoleDef } from "./roles";
|
|
124
|
+
export type {
|
|
125
|
+
TranslationsFile,
|
|
126
|
+
TranslatedAction,
|
|
127
|
+
TranslatedEntity,
|
|
128
|
+
TranslatedMenu,
|
|
129
|
+
TranslatedOption,
|
|
130
|
+
TranslatedReport,
|
|
131
|
+
TranslatedWithOptions,
|
|
132
|
+
} from "./translations";
|
|
123
133
|
export type { SettingsFile, SettingDef, SettingBaseDatatype } from "./settings";
|
|
124
134
|
export type { JobsFile, JobDef } from "./jobs";
|
|
125
135
|
export type { TriggersFile, TriggerDef, EntityEvent } from "./triggers";
|
package/src/manifest.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// Module manifest — authoring shape of `manifest.json`.
|
|
2
2
|
// Mirror of manifest.schema.json.
|
|
3
3
|
|
|
4
|
+
import type { AuditHistoryLevel } from "./entity";
|
|
5
|
+
|
|
4
6
|
/** Author block on a manifest. */
|
|
5
7
|
export interface ManifestAuthor {
|
|
6
8
|
name: string;
|
|
@@ -42,8 +44,8 @@ export interface ManifestDef {
|
|
|
42
44
|
license?: string;
|
|
43
45
|
/** Module code → semver range or partial-dep object. */
|
|
44
46
|
dependencies?: Record<string, ModuleDependency>;
|
|
45
|
-
/** Default audit history
|
|
46
|
-
auditHistory?:
|
|
47
|
+
/** Default audit history level for this module's entities; each entity may override. */
|
|
48
|
+
auditHistory?: AuditHistoryLevel;
|
|
47
49
|
/** Default for `comments` on this module's entities; each entity may override. */
|
|
48
50
|
comments?: boolean;
|
|
49
51
|
/** Entity code → relative path of its JSON file (dotted keys = extensions). */
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// Translations — authoring shape of `translations/<locale>.json`. Mirror of translations.schema.json.
|
|
2
|
+
|
|
3
|
+
/** A translated option: the label alone, or label with icon / color overrides. */
|
|
4
|
+
export type TranslatedOption = string | { label?: string; icon?: string; color?: string };
|
|
5
|
+
|
|
6
|
+
/** A label with optional option translations (fields, domains, params). */
|
|
7
|
+
export interface TranslatedWithOptions {
|
|
8
|
+
label?: string;
|
|
9
|
+
/** Option value (stored code) → translation. */
|
|
10
|
+
options?: Record<string, TranslatedOption>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface TranslatedEntity {
|
|
14
|
+
label?: string;
|
|
15
|
+
desc?: string;
|
|
16
|
+
/** Column code → label and option labels. */
|
|
17
|
+
fields?: Record<string, TranslatedWithOptions>;
|
|
18
|
+
/** Card-layout section code → heading. */
|
|
19
|
+
columnGroups?: Record<string, { label?: string }>;
|
|
20
|
+
/** Constraint name → violation message. */
|
|
21
|
+
constraints?: Record<string, { message?: string }>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface TranslatedMenu {
|
|
25
|
+
label?: string;
|
|
26
|
+
/** Item code → label. Flat, even when ui/menus.json nests the items. */
|
|
27
|
+
items?: Record<string, { label?: string }>;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface TranslatedReport {
|
|
31
|
+
label?: string;
|
|
32
|
+
/** Dataset code → caption. */
|
|
33
|
+
datasets?: Record<string, { caption?: string }>;
|
|
34
|
+
params?: Record<string, TranslatedWithOptions>;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface TranslatedAction {
|
|
38
|
+
label?: string;
|
|
39
|
+
/** Tooltip. */
|
|
40
|
+
desc?: string;
|
|
41
|
+
params?: Record<string, TranslatedWithOptions>;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** A `translations/<locale>.json` file. Every key is optional; a gap falls back to the base text. */
|
|
45
|
+
export interface TranslationsFile {
|
|
46
|
+
entities?: Record<string, TranslatedEntity>;
|
|
47
|
+
domains?: Record<string, TranslatedWithOptions>;
|
|
48
|
+
/** Folder code (flat, not the path) → label. */
|
|
49
|
+
folders?: Record<string, { label?: string }>;
|
|
50
|
+
views?: Record<string, { label?: string }>;
|
|
51
|
+
menus?: Record<string, TranslatedMenu>;
|
|
52
|
+
settings?: Record<string, { label?: string; desc?: string }>;
|
|
53
|
+
/** Module-qualified role code → label. */
|
|
54
|
+
roles?: Record<string, { label?: string }>;
|
|
55
|
+
reports?: Record<string, TranslatedReport>;
|
|
56
|
+
actions?: Record<string, TranslatedAction>;
|
|
57
|
+
/** Accepted, not applied at install yet. */
|
|
58
|
+
print_templates?: Record<string, { label?: string }>;
|
|
59
|
+
/** Exact text of a DSL info / warn / error / exit call → translation. */
|
|
60
|
+
messages?: Record<string, string>;
|
|
61
|
+
}
|