@alteriom/mqtt-schema 0.3.2 → 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/README.md +7 -1
- package/dist/cjs/generated/types.d.ts +46 -1
- package/dist/cjs/generated/types.js +18 -0
- package/dist/cjs/schema_data.d.ts +169 -0
- package/dist/cjs/schema_data.js +210 -2
- package/dist/cjs/schemas/mesh_alert.schema.json +66 -0
- package/dist/cjs/schemas/mesh_node_list.schema.json +50 -0
- package/dist/cjs/schemas/mesh_topology.schema.json +54 -0
- package/dist/cjs/schemas/mqtt_v1_bundle.json +4 -1
- package/dist/cjs/validators.d.ts +3 -0
- package/dist/cjs/validators.js +16 -1
- package/dist/esm/generated/types.js +15 -0
- package/dist/esm/schema_data.js +209 -1
- package/dist/esm/schemas/mesh_alert.schema.json +66 -0
- package/dist/esm/schemas/mesh_node_list.schema.json +50 -0
- package/dist/esm/schemas/mesh_topology.schema.json +54 -0
- package/dist/esm/schemas/mqtt_v1_bundle.json +4 -1
- package/dist/esm/validators.js +17 -2
- package/package.json +1 -5
- package/schemas/mesh_alert.schema.json +66 -0
- package/schemas/mesh_node_list.schema.json +50 -0
- package/schemas/mesh_topology.schema.json +54 -0
- package/schemas/mqtt_v1_bundle.json +4 -1
@@ -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
|
}
|