diff --git a/schemas/bambulab/v1/report/print/_ams.schema.json b/schemas/bambulab/v1/common/ams.schema.json similarity index 93% rename from schemas/bambulab/v1/report/print/_ams.schema.json rename to schemas/bambulab/v1/common/ams.schema.json index 2935ff8..6b0ed2d 100644 --- a/schemas/bambulab/v1/report/print/_ams.schema.json +++ b/schemas/bambulab/v1/common/ams.schema.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v1/report/print/_ams.schema.json", + "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v1/common/ams.schema.json", "title": "AmsState", "description": "Bambu's own naming has the outer container and the inner array both called `ams` - print.ams.ams, not a typo here, just what the printer actually sends.", "type": "object", diff --git a/schemas/bambulab/v1/report/print/_ams_tray.schema.json b/schemas/bambulab/v1/common/ams_tray.schema.json similarity index 96% rename from schemas/bambulab/v1/report/print/_ams_tray.schema.json rename to schemas/bambulab/v1/common/ams_tray.schema.json index d4a0291..6061064 100644 --- a/schemas/bambulab/v1/report/print/_ams_tray.schema.json +++ b/schemas/bambulab/v1/common/ams_tray.schema.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v1/report/print/_ams_tray.schema.json", + "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v1/common/ams_tray.schema.json", "title": "AmsTray", "description": "A tray slot is either empty (just `id`) or loaded (the full field set) - two genuinely different shapes for the same slot, not one shape with optional fields. oneOf says the instance must match EXACTLY one of these. Note LoadedTray requires every field it lists, not just `id` - with only `id` required, a bare {\"id\":\"0\"} would validate against BOTH branches at once (it trivially satisfies Loaded's single requirement too) and oneOf would fail, since oneOf demands exactly one match. Verified this the hard way - see git history. The Rust equivalent is an untagged enum with #[serde(deny_unknown_fields)] on the Empty variant, for the same reason in reverse: without it, a loaded tray's extra fields wouldn't be rejected by Empty, and untagged enums try variants in order - see bambu_commands/print.rs. `drying_time` and `drying_temp` fields are only available for AMS 2 and AMS HT - AMS 1 doesn't have the drying option.", "oneOf": [ diff --git a/schemas/bambulab/v1/report/print/_ams_unit.schema.json b/schemas/bambulab/v1/common/ams_unit.schema.json similarity index 91% rename from schemas/bambulab/v1/report/print/_ams_unit.schema.json rename to schemas/bambulab/v1/common/ams_unit.schema.json index b027fe1..66e16dc 100644 --- a/schemas/bambulab/v1/report/print/_ams_unit.schema.json +++ b/schemas/bambulab/v1/common/ams_unit.schema.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v1/report/print/_ams_unit.schema.json", + "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v1/common/ams_unit.schema.json", "title": "AmsUnit", "description": "One physical AMS unit (Bambu's numbering starts at 0 via `id`).", "type": "object", diff --git a/schemas/bambulab/v1/report/print/_hms.schema.json b/schemas/bambulab/v1/common/hms.schema.json similarity index 56% rename from schemas/bambulab/v1/report/print/_hms.schema.json rename to schemas/bambulab/v1/common/hms.schema.json index 54f44ca..4b5d56a 100644 --- a/schemas/bambulab/v1/report/print/_hms.schema.json +++ b/schemas/bambulab/v1/common/hms.schema.json @@ -1,10 +1,14 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v1/report/print/_online.schema.json", + "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v1/common/online.schema.json", "title": "Online", "description": "Printer online/offline status", "type": "array", "items": { - "type": "object" + "type": "object", + "properties": { + "attr": { "type": "integer" }, + "code": { "type": "integer" } + } } } diff --git a/schemas/bambulab/v1/report/print/_ipcam.schema.json b/schemas/bambulab/v1/common/ipcam.schema.json similarity index 92% rename from schemas/bambulab/v1/report/print/_ipcam.schema.json rename to schemas/bambulab/v1/common/ipcam.schema.json index 3d22b5a..0c3d0ec 100644 --- a/schemas/bambulab/v1/report/print/_ipcam.schema.json +++ b/schemas/bambulab/v1/common/ipcam.schema.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v1/report/print/_ipcam.schema.json", + "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v1/common/ipcam.schema.json", "title": "Ipcam", "description": "Report about the in-built IP camera", "type": "object", diff --git a/schemas/bambulab/v1/report/print/_lights_report.schema.json b/schemas/bambulab/v1/common/lights_report.schema.json similarity index 88% rename from schemas/bambulab/v1/report/print/_lights_report.schema.json rename to schemas/bambulab/v1/common/lights_report.schema.json index 3882f06..dcd5d59 100644 --- a/schemas/bambulab/v1/report/print/_lights_report.schema.json +++ b/schemas/bambulab/v1/common/lights_report.schema.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v1/report/print/_lights_report.schema.json", + "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v1/common/lights_report.schema.json", "title": "LightsReport", "description": "Report status of printer lights", "type": "array", diff --git a/schemas/bambulab/v1/common/module_info.schema.json b/schemas/bambulab/v1/common/module_info.schema.json new file mode 100644 index 0000000..c5b7595 --- /dev/null +++ b/schemas/bambulab/v1/common/module_info.schema.json @@ -0,0 +1,26 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v1/common/module_info.schema.json", + "title": "ModuleInfo", + "type": "object", + "properties": { + "name": { "type": "string" }, + "sw_ver": { "type": "string" }, + "hw_ver": { "type": "string" }, + "loader_ver": { "type": "string" }, + "product_name": { "type": "string" }, + "sn": { "type": "string" }, + "visible": { "type": "boolean" }, + "flag": { "type": "integer" } + }, + "required": [ + "name", + "sw_ver", + "hw_ver", + "loader_ver", + "sn", + "product_name", + "visible", + "flag" + ] +} diff --git a/schemas/bambulab/v1/report/print/_net.schema.json b/schemas/bambulab/v1/common/net.schema.json similarity index 89% rename from schemas/bambulab/v1/report/print/_net.schema.json rename to schemas/bambulab/v1/common/net.schema.json index 0858802..e37a05f 100644 --- a/schemas/bambulab/v1/report/print/_net.schema.json +++ b/schemas/bambulab/v1/common/net.schema.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v1/report/print/_net.schema.json", + "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v1/common/net.schema.json", "title": "Net", "description": "Network status", "type": "object", diff --git a/schemas/bambulab/v1/report/print/_online.schema.json b/schemas/bambulab/v1/common/online.schema.json similarity index 84% rename from schemas/bambulab/v1/report/print/_online.schema.json rename to schemas/bambulab/v1/common/online.schema.json index 4ce16d9..6d837b3 100644 --- a/schemas/bambulab/v1/report/print/_online.schema.json +++ b/schemas/bambulab/v1/common/online.schema.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v1/report/print/_online.schema.json", + "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v1/common/online.schema.json", "title": "Online", "description": "Printer online/offline status", "type": "object", diff --git a/schemas/bambulab/v1/report/print/_upgrade_state.schema.json b/schemas/bambulab/v1/common/upgrade_state.schema.json similarity index 92% rename from schemas/bambulab/v1/report/print/_upgrade_state.schema.json rename to schemas/bambulab/v1/common/upgrade_state.schema.json index 6a79f9a..5e3e1f2 100644 --- a/schemas/bambulab/v1/report/print/_upgrade_state.schema.json +++ b/schemas/bambulab/v1/common/upgrade_state.schema.json @@ -6,7 +6,7 @@ "properties": { "sequence": { "type": "string" }, "progress": { "type": "string" }, - "status": { "type": "string", "enum": ["IDLE"]}, + "status": { "type": "string", "enum": ["idle", "IDLE"]}, "consistency_request": { "type": "boolean" }, "dis_state": { "type": "integer" }, "err_code": { "type": "integer" }, diff --git a/schemas/bambulab/v1/report/print/_upload.schema.json b/schemas/bambulab/v1/common/upload.schema.json similarity index 100% rename from schemas/bambulab/v1/report/print/_upload.schema.json rename to schemas/bambulab/v1/common/upload.schema.json diff --git a/schemas/bambulab/v1/report/print/_vt_tray.schema.json b/schemas/bambulab/v1/common/vt_tray.schema.json similarity index 100% rename from schemas/bambulab/v1/report/print/_vt_tray.schema.json rename to schemas/bambulab/v1/common/vt_tray.schema.json diff --git a/schemas/bambulab/v1/report/print/_xcam.schema.json b/schemas/bambulab/v1/common/xcam.schema.json similarity index 100% rename from schemas/bambulab/v1/report/print/_xcam.schema.json rename to schemas/bambulab/v1/common/xcam.schema.json diff --git a/schemas/bambulab/v1/report/info/get_version.schema.json b/schemas/bambulab/v1/report/info/get_version.schema.json index 9035499..2ffd485 100644 --- a/schemas/bambulab/v1/report/info/get_version.schema.json +++ b/schemas/bambulab/v1/report/info/get_version.schema.json @@ -10,7 +10,7 @@ "command": { "const": "get_version" }, "module": { "type": "array", - "items": { "$ref": "_module_info.schema.json" } + "items": { "$ref": "../../common/module_info.schema.json" } } }, "required": ["module"] diff --git a/schemas/bambulab/v1/report/print/print.schema.json b/schemas/bambulab/v1/report/print/print.schema.json index 8ef85c1..bc9eab4 100644 --- a/schemas/bambulab/v1/report/print/print.schema.json +++ b/schemas/bambulab/v1/report/print/print.schema.json @@ -10,16 +10,16 @@ "properties": { "command": { "const": "push_status" }, - "upgrade_state": { "$ref": "_upgrade_state.schema.json" }, - "ipcam": { "$ref": "_ipcam.schema.json" }, - "upload": { "$ref": "_upload.schema.json" }, - "net": { "$ref": "_net.schema.json" }, - "hms": { "$ref": "_hms.schema.json" }, - "online": { "$ref": "_online.schema.json" }, - "ams": { "$ref": "_ams.schema.json" }, - "vt_tray": { "$ref": "_vt_tray.schema.json" }, - "lights_report": { "$ref": "_lights_report.schema.json" }, - "xcam": { "$ref": "_xcam.schema.json" }, + "upgrade_state": { "$ref": "../../common/upgrade_state.schema.json" }, + "ipcam": { "$ref": "../../common/ipcam.schema.json" }, + "upload": { "$ref": "../../common/upload.schema.json" }, + "net": { "$ref": "../../common/net.schema.json" }, + "hms": { "$ref": "../../common/hms.schema.json" }, + "online": { "$ref": "../../common/online.schema.json" }, + "ams": { "$ref": "../../common/ams.schema.json" }, + "vt_tray": { "$ref": "../../common/vt_tray.schema.json" }, + "lights_report": { "$ref": "../../common/lights_report.schema.json" }, + "xcam": { "$ref": "../../common/xcam.schema.json" }, "nozzle_diameter": { "$ref": "../../common/nozzle_diameter.schema.json" }, "nozzle_type": { "$ref": "../../common/nozzle_type.schema.json" }, diff --git a/schemas/bambulab/v2/common/nozzle_diameter.schema.json b/schemas/bambulab/v2/common/nozzle_diameter.schema.json new file mode 100644 index 0000000..cd9bcb8 --- /dev/null +++ b/schemas/bambulab/v2/common/nozzle_diameter.schema.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v2/common/nozzle_diameter.schema.json", + "title": "NozzleDiameter", + "description": "Common schema for nozzle diameter", + "type": "number", + "enum": [ + 0.2, + 0.4, + 0.6, + 0.8 + ] +} diff --git a/schemas/bambulab/v2/common/nozzle_type.schema.json b/schemas/bambulab/v2/common/nozzle_type.schema.json new file mode 100644 index 0000000..7463b46 --- /dev/null +++ b/schemas/bambulab/v2/common/nozzle_type.schema.json @@ -0,0 +1,14 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v1/common/nozzle_type.schema.json", + "title": "NozzleType", + "description": "Common schema for nozzle type. HS00 - stainless steel, HS01 - hardened steel, HS05 - tungsten carbide, HH01 - high-flow hardened steel, HH05 - high-flow tungsten carbide", + "type": "string", + "enum": [ + "HS00", + "HS01", + "HS05", + "HH01", + "HH05" + ] +} diff --git a/schemas/bambulab/v1/report/info/_module_info.schema.json b/schemas/bambulab/v2/report/info/_module_info.schema.json similarity index 90% rename from schemas/bambulab/v1/report/info/_module_info.schema.json rename to schemas/bambulab/v2/report/info/_module_info.schema.json index 3576fe9..985e56e 100644 --- a/schemas/bambulab/v1/report/info/_module_info.schema.json +++ b/schemas/bambulab/v2/report/info/_module_info.schema.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v1/report/info/_module_info.schema.json", + "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v2/report/info/_module_info.schema.json", "title": "ModuleInfo", "type": "object", "properties": { diff --git a/schemas/bambulab/v2/report/info/get_version.schema.json b/schemas/bambulab/v2/report/info/get_version.schema.json new file mode 100644 index 0000000..6fb7a2c --- /dev/null +++ b/schemas/bambulab/v2/report/info/get_version.schema.json @@ -0,0 +1,19 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v2/report/info/get_version.schema.json", + "title": "GetVersionReport", + "allOf": [ + { "$ref": "../../../common/envelope.schema.json" }, + { + "type": "object", + "properties": { + "command": { "const": "get_version" }, + "module": { + "type": "array", + "items": { "$ref": "_module_info.schema.json" } + } + }, + "required": ["module"] + } + ] +} diff --git a/schemas/bambulab/v2/request/info/get_version.schema.json b/schemas/bambulab/v2/request/info/get_version.schema.json new file mode 100644 index 0000000..bd23222 --- /dev/null +++ b/schemas/bambulab/v2/request/info/get_version.schema.json @@ -0,0 +1,14 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v2/request/info/get_version.schema.json", + "title": "GetVersionRequest", + "allOf": [ + { "$ref": "../../../common/envelope.schema.json" }, + { + "type": "object", + "properties": { + "command": { "const": "get_version" } + } + } + ] +}