@alteriom/mqtt-schema 0.3.1 → 0.4.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alteriom/mqtt-schema",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "description": "Alteriom MQTT v1 schemas, TypeScript types, and validation helpers for web integration",
5
5
  "license": "MIT",
6
6
  "author": "Alteriom Development Team",
@@ -87,25 +87,31 @@
87
87
  "node": ">=16.0.0"
88
88
  },
89
89
  "scripts": {
90
+ "// Build Scripts": "====================",
90
91
  "prebuild": "npm run clean && node scripts/copy-schemas.cjs",
91
92
  "build:cjs": "tsc -p tsconfig.json",
92
93
  "build:esm": "tsc -p tsconfig.esm.json && node scripts/post-esm.cjs",
93
94
  "build": "npm run build:cjs && npm run build:esm && node scripts/copy-schemas.cjs",
94
95
  "clean": "rimraf dist schemas",
95
96
  "prepare": "npm run build",
96
- "lint": "echo 'No linter configured'",
97
+ "// Testing & Validation": "====================",
98
+ "lint": "echo 'No linter configured - consider adding ESLint for future releases'",
97
99
  "test": "node test/validate-fixtures.cjs",
100
+ "test:ota": "node scripts/validate-ota-manifest.js",
98
101
  "verify:schemas": "node scripts/check-schema-sync.cjs",
99
102
  "verify:release": "node scripts/check-release-integrity.cjs",
100
103
  "verify": "npm run verify:schemas && npm run verify:release && npm test",
101
104
  "verify:all": "node scripts/verify_all.cjs",
105
+ "// Release Management": "====================",
102
106
  "release:prepare": "node scripts/release-prepare.cjs",
103
107
  "wiki:generate": "node scripts/generate-wiki.cjs",
108
+ "// Repository Metadata": "====================",
104
109
  "metadata:report": "alteriom-metadata report --org-tag alteriom || echo 'metadata report failed'",
105
110
  "metadata:validate": "alteriom-metadata validate --org-tag alteriom || echo 'metadata validate failed'",
106
111
  "metadata:apply": "alteriom-metadata apply --org-tag alteriom",
107
112
  "metadata:apply:dry": "alteriom-metadata dry-run --org-tag alteriom",
108
- "validate:ota": "node scripts/validate-ota-manifest.js"
113
+ "// Legacy Aliases": "====================",
114
+ "validate:ota": "npm run test:ota"
109
115
  },
110
116
  "keywords": [
111
117
  "alteriom",
@@ -0,0 +1,66 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schemas.alteriom.io/mqtt/v1/mesh_alert.schema.json",
4
+ "title": "Mesh Network Alert v1",
5
+ "allOf": [{"$ref": "envelope.schema.json"}],
6
+ "type": "object",
7
+ "required": ["alerts"],
8
+ "properties": {
9
+ "alerts": {
10
+ "type": "array",
11
+ "items": {
12
+ "type": "object",
13
+ "required": ["alert_type", "severity", "message"],
14
+ "properties": {
15
+ "alert_type": {
16
+ "type": "string",
17
+ "enum": [
18
+ "low_memory",
19
+ "node_offline",
20
+ "connection_lost",
21
+ "high_latency",
22
+ "packet_loss",
23
+ "firmware_mismatch",
24
+ "configuration_error",
25
+ "security_warning",
26
+ "other"
27
+ ],
28
+ "description": "Type of alert"
29
+ },
30
+ "severity": {
31
+ "type": "string",
32
+ "enum": ["critical", "warning", "info"],
33
+ "description": "Alert severity level"
34
+ },
35
+ "message": {
36
+ "type": "string",
37
+ "description": "Human-readable alert message"
38
+ },
39
+ "node_id": {
40
+ "type": "string",
41
+ "description": "Related node ID (if applicable)"
42
+ },
43
+ "metric_value": {
44
+ "type": "number",
45
+ "description": "Related metric value (if applicable)"
46
+ },
47
+ "threshold": {
48
+ "type": "number",
49
+ "description": "Threshold that triggered alert"
50
+ },
51
+ "alert_id": {
52
+ "type": "string",
53
+ "description": "Unique alert identifier"
54
+ }
55
+ },
56
+ "additionalProperties": true
57
+ }
58
+ },
59
+ "alert_count": {
60
+ "type": "integer",
61
+ "minimum": 0,
62
+ "description": "Total number of active alerts"
63
+ }
64
+ },
65
+ "additionalProperties": true
66
+ }
@@ -0,0 +1,50 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schemas.alteriom.io/mqtt/v1/mesh_node_list.schema.json",
4
+ "title": "Mesh Node List v1",
5
+ "allOf": [{"$ref": "envelope.schema.json"}],
6
+ "type": "object",
7
+ "required": ["nodes"],
8
+ "properties": {
9
+ "nodes": {
10
+ "type": "array",
11
+ "items": {
12
+ "type": "object",
13
+ "required": ["node_id"],
14
+ "properties": {
15
+ "node_id": {
16
+ "type": "string",
17
+ "description": "Unique node identifier"
18
+ },
19
+ "status": {
20
+ "type": "string",
21
+ "enum": ["online", "offline", "unreachable"],
22
+ "description": "Current node status"
23
+ },
24
+ "last_seen": {
25
+ "type": "string",
26
+ "format": "date-time",
27
+ "description": "Last communication timestamp"
28
+ },
29
+ "signal_strength": {
30
+ "type": "integer",
31
+ "minimum": -200,
32
+ "maximum": 0,
33
+ "description": "Signal strength in dBm"
34
+ }
35
+ },
36
+ "additionalProperties": true
37
+ }
38
+ },
39
+ "node_count": {
40
+ "type": "integer",
41
+ "minimum": 0,
42
+ "description": "Total number of nodes"
43
+ },
44
+ "mesh_id": {
45
+ "type": "string",
46
+ "description": "Mesh network identifier"
47
+ }
48
+ },
49
+ "additionalProperties": true
50
+ }
@@ -0,0 +1,54 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schemas.alteriom.io/mqtt/v1/mesh_topology.schema.json",
4
+ "title": "Mesh Network Topology v1",
5
+ "allOf": [{"$ref": "envelope.schema.json"}],
6
+ "type": "object",
7
+ "required": ["connections"],
8
+ "properties": {
9
+ "connections": {
10
+ "type": "array",
11
+ "items": {
12
+ "type": "object",
13
+ "required": ["from_node", "to_node"],
14
+ "properties": {
15
+ "from_node": {
16
+ "type": "string",
17
+ "description": "Source node ID"
18
+ },
19
+ "to_node": {
20
+ "type": "string",
21
+ "description": "Destination node ID"
22
+ },
23
+ "link_quality": {
24
+ "type": "number",
25
+ "minimum": 0,
26
+ "maximum": 1,
27
+ "description": "Link quality score (0-1)"
28
+ },
29
+ "latency_ms": {
30
+ "type": "integer",
31
+ "minimum": 0,
32
+ "description": "Link latency in milliseconds"
33
+ },
34
+ "hop_count": {
35
+ "type": "integer",
36
+ "minimum": 1,
37
+ "description": "Number of hops in path"
38
+ }
39
+ },
40
+ "additionalProperties": true
41
+ }
42
+ },
43
+ "root_node": {
44
+ "type": "string",
45
+ "description": "Root node ID (gateway/bridge)"
46
+ },
47
+ "total_connections": {
48
+ "type": "integer",
49
+ "minimum": 0,
50
+ "description": "Total number of connections"
51
+ }
52
+ },
53
+ "additionalProperties": true
54
+ }
@@ -9,6 +9,9 @@
9
9
  "gateway_info": "gateway_info.schema.json",
10
10
  "gateway_metrics": "gateway_metrics.schema.json",
11
11
  "firmware_status": "firmware_status.schema.json",
12
- "control_response": "control_response.schema.json"
12
+ "control_response": "control_response.schema.json",
13
+ "mesh_node_list": "mesh_node_list.schema.json",
14
+ "mesh_topology": "mesh_topology.schema.json",
15
+ "mesh_alert": "mesh_alert.schema.json"
13
16
  }
14
17
  }