@dforge-core/metadata 0.0.1 → 0.0.3
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 +48 -0
- package/README.md +144 -0
- package/dist/entity-meta.d.ts +18 -0
- package/dist/entity-meta.d.ts.map +1 -0
- package/dist/entity-meta.js +45 -0
- package/dist/entity-meta.js.map +1 -0
- package/dist/field-types.d.ts +9 -0
- package/dist/field-types.d.ts.map +1 -1
- package/dist/field-types.js +1 -0
- package/dist/field-types.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +9 -4
- package/schemas/data_views.schema.json +350 -0
- package/schemas/entity.schema.json +450 -0
- package/schemas/folders.schema.json +108 -0
- package/schemas/jobs.schema.json +83 -0
- package/schemas/manifest.schema.json +146 -0
- package/schemas/menus.schema.json +86 -0
- package/schemas/print_templates.schema.json +82 -0
- package/schemas/reports.schema.json +225 -0
- package/schemas/roles.schema.json +32 -0
- package/schemas/seed_data.schema.json +23 -0
- package/schemas/settings.schema.json +55 -0
- package/schemas/traits.schema.json +99 -0
- package/schemas/triggers.schema.json +59 -0
- package/schemas/webhooks.schema.json +73 -0
- package/src/entity-meta.ts +48 -0
- package/src/field-types.ts +1 -0
- package/src/index.ts +3 -0
- package/src/types.ts +1 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://dforge.dev/schemas/manifest.schema.json",
|
|
4
|
+
"title": "dForge Module Manifest",
|
|
5
|
+
"description": "Module package manifest defining metadata, dependencies, and entity references",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["packageFormat", "moduleId", "code", "version", "dbSchemaVersion", "displayName"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"packageFormat": {
|
|
10
|
+
"type": "integer",
|
|
11
|
+
"minimum": 1,
|
|
12
|
+
"description": "Package format version (currently 1)"
|
|
13
|
+
},
|
|
14
|
+
"moduleId": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
|
|
17
|
+
"description": "Globally unique module UUID"
|
|
18
|
+
},
|
|
19
|
+
"code": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"pattern": "^[a-z][a-z0-9_-]*$",
|
|
22
|
+
"description": "Human-readable module code (becomes schema name and module_cd in DB)"
|
|
23
|
+
},
|
|
24
|
+
"kind": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"enum": ["module", "pack"],
|
|
27
|
+
"default": "module",
|
|
28
|
+
"description": "Package kind. 'module' (default) — a regular module with its own entities/views/actions. 'pack' — a dependency bundle: installs a curated set of other modules via `dependencies` in order, owns no entities itself."
|
|
29
|
+
},
|
|
30
|
+
"version": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"pattern": "^\\d+\\.\\d+\\.\\d+",
|
|
33
|
+
"description": "Module version (semver)"
|
|
34
|
+
},
|
|
35
|
+
"dbSchemaVersion": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"pattern": "^\\d+\\.\\d+\\.\\d+",
|
|
38
|
+
"description": "Database schema version (semver)"
|
|
39
|
+
},
|
|
40
|
+
"displayName": {
|
|
41
|
+
"type": "string",
|
|
42
|
+
"description": "Human-readable module name"
|
|
43
|
+
},
|
|
44
|
+
"description": {
|
|
45
|
+
"type": "string",
|
|
46
|
+
"description": "Module description"
|
|
47
|
+
},
|
|
48
|
+
"schemaName": {
|
|
49
|
+
"type": "string",
|
|
50
|
+
"description": "Database schema name override (defaults to module code, system modules use 'dForge')"
|
|
51
|
+
},
|
|
52
|
+
"system": {
|
|
53
|
+
"type": "boolean",
|
|
54
|
+
"description": "System module flag (cannot be uninstalled, admin-only). Omit for regular modules."
|
|
55
|
+
},
|
|
56
|
+
"author": {
|
|
57
|
+
"type": "object",
|
|
58
|
+
"properties": {
|
|
59
|
+
"name": {
|
|
60
|
+
"type": "string",
|
|
61
|
+
"description": "Author name"
|
|
62
|
+
},
|
|
63
|
+
"url": {
|
|
64
|
+
"type": "string",
|
|
65
|
+
"description": "Author URL"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"required": ["name"],
|
|
69
|
+
"additionalProperties": false
|
|
70
|
+
},
|
|
71
|
+
"license": {
|
|
72
|
+
"type": "string",
|
|
73
|
+
"description": "License identifier (e.g. 'proprietary', 'MIT')"
|
|
74
|
+
},
|
|
75
|
+
"dependencies": {
|
|
76
|
+
"type": "object",
|
|
77
|
+
"description": "Module dependencies: module code → semver range OR { version, entities? } object for partial deps that only import specific entities from the dependency.",
|
|
78
|
+
"additionalProperties": {
|
|
79
|
+
"oneOf": [
|
|
80
|
+
{
|
|
81
|
+
"type": "string",
|
|
82
|
+
"description": "Semver version range (e.g. '>=1.0.0')"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"type": "object",
|
|
86
|
+
"required": ["version"],
|
|
87
|
+
"properties": {
|
|
88
|
+
"version": {
|
|
89
|
+
"type": "string",
|
|
90
|
+
"description": "Semver version range"
|
|
91
|
+
},
|
|
92
|
+
"entities": {
|
|
93
|
+
"type": "array",
|
|
94
|
+
"items": { "type": "string" },
|
|
95
|
+
"description": "Entity codes from the dependency that this module needs. If omitted, all entities are accessible."
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
"additionalProperties": false
|
|
99
|
+
}
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"auditHistory": {
|
|
104
|
+
"type": "string",
|
|
105
|
+
"enum": ["none", "minimal", "full"],
|
|
106
|
+
"description": "Default audit history mode for entities in this module ('full' captures every field change; 'minimal' captures only inserts/deletes; 'none' disables). Individual entities can override."
|
|
107
|
+
},
|
|
108
|
+
"entities": {
|
|
109
|
+
"type": "object",
|
|
110
|
+
"description": "Entity definitions and extensions: entity code → relative path to entity JSON file. Dotted keys (e.g. 'fin.invoice') indicate extensions of other modules' entities (the entity file must have an 'extends' property).",
|
|
111
|
+
"additionalProperties": {
|
|
112
|
+
"type": "string",
|
|
113
|
+
"pattern": "^(\\./)?entities/.+\\.json$"
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
"category": {
|
|
117
|
+
"type": "string",
|
|
118
|
+
"description": "Module category for display (e.g. 'Integration', 'Finance')"
|
|
119
|
+
},
|
|
120
|
+
"tags": {
|
|
121
|
+
"type": "array",
|
|
122
|
+
"items": { "type": "string" },
|
|
123
|
+
"description": "Free-form tags for search and discovery (e.g. ['crm', 'sales', 'leads']). Convention: lowercase, hyphen-separated."
|
|
124
|
+
},
|
|
125
|
+
"icon": {
|
|
126
|
+
"type": "string",
|
|
127
|
+
"description": "Bootstrap icon class (e.g. 'bi-link-45deg')"
|
|
128
|
+
},
|
|
129
|
+
"supportedLocales": {
|
|
130
|
+
"type": "array",
|
|
131
|
+
"items": { "type": "string", "pattern": "^[a-z]{2,3}(-[A-Z]{2})?$" },
|
|
132
|
+
"description": "Non-English locales the package promises to translate. Each entry MUST match a translations/<locale>.json file, and every translatable resource (entity/field labels, folders, views, menus + items, actions + params, reports + datasets + params, settings) MUST have a label in that file. English is the default — don't list 'en' or 'en-US'."
|
|
133
|
+
},
|
|
134
|
+
"created": {
|
|
135
|
+
"type": "string",
|
|
136
|
+
"format": "date",
|
|
137
|
+
"description": "Initial creation date of the module package (YYYY-MM-DD). Informational only; not enforced by the installer."
|
|
138
|
+
},
|
|
139
|
+
"updated": {
|
|
140
|
+
"type": "string",
|
|
141
|
+
"format": "date",
|
|
142
|
+
"description": "Last edit date of the manifest (YYYY-MM-DD). Informational; bump when shipping a new version."
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
"additionalProperties": false
|
|
146
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://dforge.dev/schemas/menus.schema.json",
|
|
4
|
+
"title": "dForge Menus",
|
|
5
|
+
"description": "Menu definitions for a dForge module",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": {
|
|
8
|
+
"$ref": "#/$defs/menu"
|
|
9
|
+
},
|
|
10
|
+
"$defs": {
|
|
11
|
+
"menu": {
|
|
12
|
+
"type": "object",
|
|
13
|
+
"required": ["label", "items"],
|
|
14
|
+
"properties": {
|
|
15
|
+
"label": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "Menu display name"
|
|
18
|
+
},
|
|
19
|
+
"description": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"description": "Optional description text (tooltip, subtitle)"
|
|
22
|
+
},
|
|
23
|
+
"folders": {
|
|
24
|
+
"type": "array",
|
|
25
|
+
"items": { "type": "string" },
|
|
26
|
+
"description": "Folder codes where this menu is available"
|
|
27
|
+
},
|
|
28
|
+
"items": {
|
|
29
|
+
"type": "object",
|
|
30
|
+
"description": "Menu items keyed by item code",
|
|
31
|
+
"additionalProperties": {
|
|
32
|
+
"$ref": "#/$defs/menuItem"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"additionalProperties": false
|
|
37
|
+
},
|
|
38
|
+
"menuItem": {
|
|
39
|
+
"type": "object",
|
|
40
|
+
"required": ["label"],
|
|
41
|
+
"properties": {
|
|
42
|
+
"itemType": {
|
|
43
|
+
"type": ["string", "null"],
|
|
44
|
+
"enum": ["V", "D", "R", null],
|
|
45
|
+
"description": "Item type: V=Data View, D=Document, R=Report, null=folder/section"
|
|
46
|
+
},
|
|
47
|
+
"dataViewCode": {
|
|
48
|
+
"type": "string",
|
|
49
|
+
"description": "Data view code (when itemType is 'V')"
|
|
50
|
+
},
|
|
51
|
+
"documentCode": {
|
|
52
|
+
"type": "string",
|
|
53
|
+
"description": "Document code (when itemType is 'D')"
|
|
54
|
+
},
|
|
55
|
+
"reportCode": {
|
|
56
|
+
"type": "string",
|
|
57
|
+
"description": "Report code (when itemType is 'R')"
|
|
58
|
+
},
|
|
59
|
+
"orderNum": {
|
|
60
|
+
"type": "integer",
|
|
61
|
+
"description": "Display order"
|
|
62
|
+
},
|
|
63
|
+
"label": {
|
|
64
|
+
"type": "string",
|
|
65
|
+
"description": "Menu item display text"
|
|
66
|
+
},
|
|
67
|
+
"description": {
|
|
68
|
+
"type": "string",
|
|
69
|
+
"description": "Optional description text (tooltip, subtitle)"
|
|
70
|
+
},
|
|
71
|
+
"icon": {
|
|
72
|
+
"type": "string",
|
|
73
|
+
"description": "Bootstrap icon name"
|
|
74
|
+
},
|
|
75
|
+
"children": {
|
|
76
|
+
"type": "object",
|
|
77
|
+
"description": "Child menu items (for folder/section items)",
|
|
78
|
+
"additionalProperties": {
|
|
79
|
+
"$ref": "#/$defs/menuItem"
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"additionalProperties": false
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "dForge Module Print Templates",
|
|
4
|
+
"description": "Print template declarations for a dForge module package (ui/print_templates.json). Each key is the template_cd; the value declares either a printable template (default) or a reusable snippet pulled into other templates via {% include 'module_cd.snippet_cd' %}.",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": {
|
|
7
|
+
"type": "object",
|
|
8
|
+
"properties": {
|
|
9
|
+
"type": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"enum": ["template", "snippet"],
|
|
12
|
+
"default": "template",
|
|
13
|
+
"description": "'template' (default) — a full printable form bound to an entity. 'snippet' — a reusable Liquid partial, module-scoped, no entity binding, included from other templates."
|
|
14
|
+
},
|
|
15
|
+
"entityCd": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "Entity code this template renders. Required when type='template'; ignored when type='snippet'. Cross-module form 'module.entity' is supported (e.g. fin-ch ships a template for fin.invoice)."
|
|
18
|
+
},
|
|
19
|
+
"description": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"description": "Human-readable label shown in the print menu."
|
|
22
|
+
},
|
|
23
|
+
"template": {
|
|
24
|
+
"type": "string",
|
|
25
|
+
"description": "Inline Liquid HTML. Either 'template' or 'file' must be set; 'file' takes precedence when both are present."
|
|
26
|
+
},
|
|
27
|
+
"file": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"description": "Relative path under the module's print_templates/ directory (e.g. 'invoice.html'). Loaded at install time."
|
|
30
|
+
},
|
|
31
|
+
"css": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"description": "Inline CSS, or a filename ending in .css (resolved relative to print_templates/). Snippets typically inherit CSS from the host template and omit this."
|
|
34
|
+
},
|
|
35
|
+
"pageSettings": {
|
|
36
|
+
"type": "object",
|
|
37
|
+
"description": "Default page geometry applied when the user prints from the UI. Stored as jsonb on the row; the editor lets users tweak per-template.",
|
|
38
|
+
"properties": {
|
|
39
|
+
"size": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"enum": ["A4", "letter", "legal"],
|
|
42
|
+
"default": "A4"
|
|
43
|
+
},
|
|
44
|
+
"orientation": {
|
|
45
|
+
"type": "string",
|
|
46
|
+
"enum": ["portrait", "landscape"],
|
|
47
|
+
"default": "portrait"
|
|
48
|
+
},
|
|
49
|
+
"margins": {
|
|
50
|
+
"type": "object",
|
|
51
|
+
"properties": {
|
|
52
|
+
"top": { "type": "string", "description": "CSS length, e.g. '15mm'." },
|
|
53
|
+
"right": { "type": "string" },
|
|
54
|
+
"bottom": { "type": "string" },
|
|
55
|
+
"left": { "type": "string" }
|
|
56
|
+
},
|
|
57
|
+
"additionalProperties": false
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"additionalProperties": false
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"additionalProperties": false,
|
|
64
|
+
"allOf": [
|
|
65
|
+
{
|
|
66
|
+
"if": { "properties": { "type": { "const": "snippet" } }, "required": ["type"] },
|
|
67
|
+
"then": {
|
|
68
|
+
"description": "Snippets must not declare entityCd and their template_cd must not contain '.' (collides with {% include 'module_cd.snippet_cd' %})."
|
|
69
|
+
},
|
|
70
|
+
"else": {
|
|
71
|
+
"required": ["entityCd"]
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"anyOf": [
|
|
76
|
+
{ "required": ["file"] },
|
|
77
|
+
{ "required": ["template"] }
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://dforge.dev/schemas/reports.schema.json",
|
|
4
|
+
"title": "dForge Module Reports",
|
|
5
|
+
"description": "Report definitions for a dForge module: a map of report code → report definition. Reports are not listed in manifest.json; the install pipeline picks up ui/reports.json automatically.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": {
|
|
8
|
+
"$ref": "#/$defs/report"
|
|
9
|
+
},
|
|
10
|
+
"$defs": {
|
|
11
|
+
"report": {
|
|
12
|
+
"type": "object",
|
|
13
|
+
"required": ["description", "layout", "datasets"],
|
|
14
|
+
"properties": {
|
|
15
|
+
"description": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "Human-readable report title"
|
|
18
|
+
},
|
|
19
|
+
"layout": {
|
|
20
|
+
"$ref": "#/$defs/layout"
|
|
21
|
+
},
|
|
22
|
+
"datasets": {
|
|
23
|
+
"type": "object",
|
|
24
|
+
"description": "Map of dataset code → dataset definition. Panels reference datasets by code via `datasetCd`.",
|
|
25
|
+
"additionalProperties": { "$ref": "#/$defs/dataset" }
|
|
26
|
+
},
|
|
27
|
+
"parameters": {
|
|
28
|
+
"type": "object",
|
|
29
|
+
"description": "Report-level parameters (alternative to per-dataset `params`). Map of param code → param definition.",
|
|
30
|
+
"additionalProperties": { "$ref": "#/$defs/paramDef" }
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"additionalProperties": false
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
"layout": {
|
|
37
|
+
"type": "object",
|
|
38
|
+
"required": ["panels"],
|
|
39
|
+
"properties": {
|
|
40
|
+
"panels": {
|
|
41
|
+
"type": "array",
|
|
42
|
+
"items": { "$ref": "#/$defs/panel" }
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"additionalProperties": false
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
"panel": {
|
|
49
|
+
"type": "object",
|
|
50
|
+
"required": ["vizType", "datasetCd"],
|
|
51
|
+
"properties": {
|
|
52
|
+
"vizType": {
|
|
53
|
+
"type": "string",
|
|
54
|
+
"enum": ["table", "chart", "metric", "pivot"],
|
|
55
|
+
"description": "Visualization type"
|
|
56
|
+
},
|
|
57
|
+
"datasetCd": {
|
|
58
|
+
"type": "string",
|
|
59
|
+
"description": "Dataset code (key in the parent `datasets` map)"
|
|
60
|
+
},
|
|
61
|
+
"title": { "type": "string" },
|
|
62
|
+
"config": {
|
|
63
|
+
"type": "object",
|
|
64
|
+
"description": "Viz-type-specific configuration. For chart: { chartType, categoryCol, valueCol, agg, chartSize }. For table: { groupRules, aggregations }."
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"additionalProperties": false
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
"dataset": {
|
|
71
|
+
"type": "object",
|
|
72
|
+
"required": ["datasetType"],
|
|
73
|
+
"properties": {
|
|
74
|
+
"caption": {
|
|
75
|
+
"type": "string",
|
|
76
|
+
"description": "Display label for the dataset (used in panel headings if no `title`)"
|
|
77
|
+
},
|
|
78
|
+
"datasetType": {
|
|
79
|
+
"type": "string",
|
|
80
|
+
"enum": ["Q", "S"],
|
|
81
|
+
"description": "Q = SQL/entity query, S = stored procedure"
|
|
82
|
+
},
|
|
83
|
+
"query": {
|
|
84
|
+
"$ref": "#/$defs/query",
|
|
85
|
+
"description": "Used when datasetType is 'Q'"
|
|
86
|
+
},
|
|
87
|
+
"procedureName": {
|
|
88
|
+
"type": "string",
|
|
89
|
+
"description": "Used when datasetType is 'S'"
|
|
90
|
+
},
|
|
91
|
+
"columnsDef": {
|
|
92
|
+
"type": "object",
|
|
93
|
+
"description": "Optional column metadata overrides: field code → { label, visible, ... }",
|
|
94
|
+
"additionalProperties": { "$ref": "#/$defs/columnDef" }
|
|
95
|
+
},
|
|
96
|
+
"params": {
|
|
97
|
+
"type": "object",
|
|
98
|
+
"description": "Dataset-level parameters (alternative to top-level `parameters`)",
|
|
99
|
+
"additionalProperties": { "$ref": "#/$defs/paramDef" }
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"additionalProperties": false
|
|
103
|
+
},
|
|
104
|
+
|
|
105
|
+
"query": {
|
|
106
|
+
"type": "object",
|
|
107
|
+
"required": ["entityCd"],
|
|
108
|
+
"properties": {
|
|
109
|
+
"entityCd": {
|
|
110
|
+
"type": "string",
|
|
111
|
+
"description": "Source entity code"
|
|
112
|
+
},
|
|
113
|
+
"columns": {
|
|
114
|
+
"type": "array",
|
|
115
|
+
"items": { "type": "string" },
|
|
116
|
+
"description": "Column codes to select (supports dot navigation: 'customer.name')"
|
|
117
|
+
},
|
|
118
|
+
"filter": {
|
|
119
|
+
"$ref": "#/$defs/filter"
|
|
120
|
+
},
|
|
121
|
+
"sort": {
|
|
122
|
+
"type": "array",
|
|
123
|
+
"items": { "$ref": "#/$defs/sortClause" }
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
"additionalProperties": false
|
|
127
|
+
},
|
|
128
|
+
|
|
129
|
+
"sortClause": {
|
|
130
|
+
"type": "object",
|
|
131
|
+
"required": ["c"],
|
|
132
|
+
"properties": {
|
|
133
|
+
"c": { "type": "string", "description": "Column code" },
|
|
134
|
+
"d": {
|
|
135
|
+
"type": "string",
|
|
136
|
+
"enum": ["asc", "desc"],
|
|
137
|
+
"description": "Sort direction (default: asc)"
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
"additionalProperties": false
|
|
141
|
+
},
|
|
142
|
+
|
|
143
|
+
"columnDef": {
|
|
144
|
+
"type": "object",
|
|
145
|
+
"properties": {
|
|
146
|
+
"label": { "type": "string" },
|
|
147
|
+
"visible": { "type": "boolean" },
|
|
148
|
+
"width": { "type": "integer", "minimum": 1 }
|
|
149
|
+
},
|
|
150
|
+
"additionalProperties": false
|
|
151
|
+
},
|
|
152
|
+
|
|
153
|
+
"paramDef": {
|
|
154
|
+
"type": "object",
|
|
155
|
+
"required": ["fieldTypeCd"],
|
|
156
|
+
"properties": {
|
|
157
|
+
"fieldTypeCd": {
|
|
158
|
+
"type": "string",
|
|
159
|
+
"description": "Field type code (see settings.schema.json for the common list)"
|
|
160
|
+
},
|
|
161
|
+
"label": { "type": "string" },
|
|
162
|
+
"orderNum": {
|
|
163
|
+
"type": "integer",
|
|
164
|
+
"description": "Display order of the parameter in the report's parameter form. Read by ReportRegistrar (paramDef.OrderNum); falls back to declaration order when omitted."
|
|
165
|
+
},
|
|
166
|
+
"required": {
|
|
167
|
+
"type": "boolean",
|
|
168
|
+
"default": false,
|
|
169
|
+
"description": "Whether the user must provide a value (older modules also use `isRequired`)"
|
|
170
|
+
},
|
|
171
|
+
"isRequired": {
|
|
172
|
+
"type": "boolean",
|
|
173
|
+
"description": "Alternate spelling of `required` used by some modules. Prefer `required` for new code."
|
|
174
|
+
},
|
|
175
|
+
"default": {
|
|
176
|
+
"description": "Default value applied if the user doesn't provide one"
|
|
177
|
+
},
|
|
178
|
+
"link": {
|
|
179
|
+
"type": "object",
|
|
180
|
+
"description": "Entity link for lookup-type params (alternative to nesting under `params.link`). Shape: { entity: '<code>', otherKey?: '<column>' }.",
|
|
181
|
+
"properties": {
|
|
182
|
+
"entity": { "type": "string" },
|
|
183
|
+
"otherKey": { "type": "string" }
|
|
184
|
+
},
|
|
185
|
+
"additionalProperties": false
|
|
186
|
+
},
|
|
187
|
+
"params": {
|
|
188
|
+
"type": "object",
|
|
189
|
+
"description": "Field-type-specific params (e.g. lookup → { link: { entity, otherKey } })"
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
"additionalProperties": false
|
|
193
|
+
},
|
|
194
|
+
|
|
195
|
+
"filter": {
|
|
196
|
+
"description": "Canonical dForge filter expression — same shape as data_views.json filter. Either `{c, o, v}` or `{g, i: [...]}`.",
|
|
197
|
+
"oneOf": [
|
|
198
|
+
{ "$ref": "#/$defs/filterCondition" },
|
|
199
|
+
{ "$ref": "#/$defs/filterGroup" }
|
|
200
|
+
]
|
|
201
|
+
},
|
|
202
|
+
"filterCondition": {
|
|
203
|
+
"type": "object",
|
|
204
|
+
"required": ["c", "o"],
|
|
205
|
+
"properties": {
|
|
206
|
+
"c": { "type": "string" },
|
|
207
|
+
"o": { "type": "string" },
|
|
208
|
+
"v": {}
|
|
209
|
+
},
|
|
210
|
+
"additionalProperties": false
|
|
211
|
+
},
|
|
212
|
+
"filterGroup": {
|
|
213
|
+
"type": "object",
|
|
214
|
+
"required": ["g", "i"],
|
|
215
|
+
"properties": {
|
|
216
|
+
"g": { "type": "string", "enum": ["and", "or"] },
|
|
217
|
+
"i": {
|
|
218
|
+
"type": "array",
|
|
219
|
+
"items": { "$ref": "#/$defs/filter" }
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
"additionalProperties": false
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://dforge.dev/schemas/roles.schema.json",
|
|
4
|
+
"title": "dForge Roles",
|
|
5
|
+
"description": "Role definitions with entity rights for a dForge module",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": {
|
|
8
|
+
"$ref": "#/$defs/role"
|
|
9
|
+
},
|
|
10
|
+
"$defs": {
|
|
11
|
+
"role": {
|
|
12
|
+
"type": "object",
|
|
13
|
+
"required": ["description", "rights"],
|
|
14
|
+
"properties": {
|
|
15
|
+
"description": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "Role display name"
|
|
18
|
+
},
|
|
19
|
+
"rights": {
|
|
20
|
+
"type": "object",
|
|
21
|
+
"description": "Entity rights: entity code → rights string",
|
|
22
|
+
"additionalProperties": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"pattern": "^[SIUDCE]*$",
|
|
25
|
+
"description": "Rights: S=Select, I=Insert, U=Update, D=Delete, C=Clone, E=Execute"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"additionalProperties": false
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://dforge.dev/schemas/seed_data.schema.json",
|
|
4
|
+
"title": "dForge Seed Data",
|
|
5
|
+
"description": "Seed data records for a dForge entity",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["entityCode", "records"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"entityCode": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"description": "Target entity code to insert records into"
|
|
12
|
+
},
|
|
13
|
+
"records": {
|
|
14
|
+
"type": "array",
|
|
15
|
+
"description": "Array of records, each record is an object with column_code → value",
|
|
16
|
+
"items": {
|
|
17
|
+
"type": "object",
|
|
18
|
+
"additionalProperties": true
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"additionalProperties": false
|
|
23
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://dforge.dev/schemas/settings.schema.json",
|
|
4
|
+
"title": "dForge Module Settings",
|
|
5
|
+
"description": "Module-level settings definitions: a flat map of setting code → setting definition. Settings are folder-scoped at runtime (values inherit through the folder tree) and surface in the Module Settings UI.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": {
|
|
8
|
+
"$ref": "#/$defs/setting"
|
|
9
|
+
},
|
|
10
|
+
"$defs": {
|
|
11
|
+
"setting": {
|
|
12
|
+
"type": "object",
|
|
13
|
+
"required": ["fieldTypeCd"],
|
|
14
|
+
"properties": {
|
|
15
|
+
"fieldTypeCd": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "Field type code (must match one in dforge.field_type). Common values: text, number, integer, decimal, boolean, checkbox, dropdown, multiSelect, date, dateTime, time, image, file, fileList, lookup, color, currency, percent, html, markdown, password, email, phone, url, textarea, json."
|
|
18
|
+
},
|
|
19
|
+
"baseDatatypeCd": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"enum": ["string", "number", "bool", "date", "dateTime", "time", "json"],
|
|
22
|
+
"description": "Underlying primitive datatype. Older settings declare this explicitly; newer settings (using `formula`) often omit it."
|
|
23
|
+
},
|
|
24
|
+
"label": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"description": "Display label (newer style). Prefer this over `description`/`desc` for new settings."
|
|
27
|
+
},
|
|
28
|
+
"description": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"description": "Display label (older style). Use `label` for new settings."
|
|
31
|
+
},
|
|
32
|
+
"desc": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"description": "Alternative label key used by some older modules. Prefer `label`."
|
|
35
|
+
},
|
|
36
|
+
"defaultValue": {
|
|
37
|
+
"description": "Default value before the user sets one. Type matches `baseDatatypeCd`."
|
|
38
|
+
},
|
|
39
|
+
"formula": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"description": "Formula expression to evaluate the default (e.g. \"'USD'\"). Alternative to `defaultValue`."
|
|
42
|
+
},
|
|
43
|
+
"required": {
|
|
44
|
+
"type": "boolean",
|
|
45
|
+
"description": "If true, the setting must be set somewhere in the folder chain for installation to proceed."
|
|
46
|
+
},
|
|
47
|
+
"params": {
|
|
48
|
+
"type": "object",
|
|
49
|
+
"description": "Field-type-specific parameters. Examples: dropdown → { options: [...] }; number → { min, max }; lookup → { link: { entity, otherKey } }."
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"additionalProperties": false
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|