@dforge-core/dforge-mcp 0.1.0-rc.1 → 0.1.0-rc.10

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.
@@ -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
+ }
@@ -0,0 +1,99 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://dforge.dev/schemas/traits.schema.json",
4
+ "title": "dForge Trait Definitions",
5
+ "description": "Defines entity traits that expand into fields, references, and constraints during module install. Shipped as traits.json at module root.",
6
+ "type": "object",
7
+ "additionalProperties": {
8
+ "$ref": "#/$defs/traitDefinition"
9
+ },
10
+ "$defs": {
11
+ "traitDefinition": {
12
+ "type": "object",
13
+ "description": "A single trait definition",
14
+ "properties": {
15
+ "description": {
16
+ "type": "string",
17
+ "description": "Human-readable description of the trait"
18
+ },
19
+ "includes": {
20
+ "type": "array",
21
+ "items": { "type": "string" },
22
+ "description": "Other trait names to include (inherit fields from). Expanded recursively with circular reference protection."
23
+ },
24
+ "fields": {
25
+ "type": "object",
26
+ "description": "Field definitions to add to entities using this trait. Keys support {entity}/{Entity} placeholders for parametric names.",
27
+ "additionalProperties": {
28
+ "$ref": "#/$defs/traitField"
29
+ }
30
+ },
31
+ "references": {
32
+ "type": "object",
33
+ "description": "FK reference definitions to add. Keys support {Entity} placeholder.",
34
+ "additionalProperties": {
35
+ "$ref": "#/$defs/traitReference"
36
+ }
37
+ },
38
+ "constraints": {
39
+ "type": "object",
40
+ "description": "Constraint definitions to add. Keys support {Entity} placeholder (e.g. 'UQ_{Entity}_period_key')."
41
+ }
42
+ },
43
+ "additionalProperties": false
44
+ },
45
+ "traitField": {
46
+ "type": "object",
47
+ "description": "Field definition within a trait. Same shape as entity field definitions.",
48
+ "properties": {
49
+ "dbDatatype": { "type": "string" },
50
+ "columnType": { "type": "string" },
51
+ "fieldTypeCd": { "type": "string" },
52
+ "flags": { "type": "string" },
53
+ "isPk": { "type": "boolean" },
54
+ "isIdentity": { "type": "boolean" },
55
+ "isNullable": { "type": "boolean" },
56
+ "formula": { "type": "string" },
57
+ "orderNum": { "type": "integer" },
58
+ "description": { "type": "string", "description": "Supports {entity}/{Entity} placeholders" },
59
+ "maxLen": { "type": "integer" },
60
+ "link": {
61
+ "type": "object",
62
+ "properties": {
63
+ "entity": { "type": "string" },
64
+ "thisKey": { "type": "string" },
65
+ "otherKey": { "type": "string" }
66
+ },
67
+ "required": ["entity", "thisKey", "otherKey"],
68
+ "additionalProperties": false
69
+ }
70
+ },
71
+ "additionalProperties": false
72
+ },
73
+ "traitReference": {
74
+ "type": "object",
75
+ "description": "FK reference definition within a trait",
76
+ "required": ["from", "to"],
77
+ "properties": {
78
+ "from": {
79
+ "type": "object",
80
+ "required": ["field"],
81
+ "properties": {
82
+ "field": { "type": "string" }
83
+ },
84
+ "additionalProperties": false
85
+ },
86
+ "to": {
87
+ "type": "object",
88
+ "required": ["entity", "field"],
89
+ "properties": {
90
+ "entity": { "type": "string" },
91
+ "field": { "type": "string" }
92
+ },
93
+ "additionalProperties": false
94
+ }
95
+ },
96
+ "additionalProperties": false
97
+ }
98
+ }
99
+ }
@@ -0,0 +1,73 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "dForge Module Webhooks",
4
+ "description": "Webhook subscription definitions for a dForge module package (webhooks.json)",
5
+ "type": "object",
6
+ "required": ["subscriptions"],
7
+ "properties": {
8
+ "subscriptions": {
9
+ "type": "array",
10
+ "items": {
11
+ "type": "object",
12
+ "required": ["code", "description", "entity", "event"],
13
+ "properties": {
14
+ "code": {
15
+ "type": "string",
16
+ "maxLength": 100,
17
+ "pattern": "^[a-z][a-z0-9_]*$",
18
+ "description": "Unique identifier within the module"
19
+ },
20
+ "description": {
21
+ "type": "string",
22
+ "description": "Human-readable description"
23
+ },
24
+ "entity": {
25
+ "type": "string",
26
+ "description": "Entity code that triggers this webhook"
27
+ },
28
+ "event": {
29
+ "type": "string",
30
+ "enum": ["insert", "update", "delete", "status_change", "any"],
31
+ "description": "Event type that fires this webhook"
32
+ },
33
+ "condition": {
34
+ "type": "string",
35
+ "description": "Formula evaluated against the record. Webhook fires only if true."
36
+ },
37
+ "endpointUrl": {
38
+ "type": "string",
39
+ "format": "uri",
40
+ "description": "Default endpoint URL. Integration modules ship with this pre-configured; admin can override."
41
+ },
42
+ "secretCd": {
43
+ "type": "string",
44
+ "description": "Secret code for API key (from dforge.secret table, admin-configured)"
45
+ },
46
+ "payload": {
47
+ "type": "object",
48
+ "properties": {
49
+ "include": {
50
+ "type": "array",
51
+ "items": { "type": "string" },
52
+ "description": "Field codes to include. If omitted, include all visible fields."
53
+ },
54
+ "includeOld": {
55
+ "type": "boolean",
56
+ "default": false,
57
+ "description": "Include previous field values on update/status_change events"
58
+ }
59
+ },
60
+ "additionalProperties": false
61
+ },
62
+ "enabled": {
63
+ "type": "boolean",
64
+ "default": true,
65
+ "description": "Can be set to false to disable without removing"
66
+ }
67
+ },
68
+ "additionalProperties": false
69
+ }
70
+ }
71
+ },
72
+ "additionalProperties": false
73
+ }