diff --git a/schemas/bambulab/README.md b/schemas/bambulab/README.md index 4896ea1..a28b700 100644 --- a/schemas/bambulab/README.md +++ b/schemas/bambulab/README.md @@ -60,7 +60,7 @@ Every command/response schema *extends* `envelope.schema.json` with ```json { "allOf": [ - { "$ref": "../../../envelope.schema.json" }, + { "$ref": "../../../common/envelope.schema.json" }, { "type": "object", "properties": { "command": { "const": "get_version" } } } ] } diff --git a/schemas/bambulab/envelope.schema.json b/schemas/bambulab/common/envelope.schema.json similarity index 65% rename from schemas/bambulab/envelope.schema.json rename to schemas/bambulab/common/envelope.schema.json index 05a13f8..c929844 100644 --- a/schemas/bambulab/envelope.schema.json +++ b/schemas/bambulab/common/envelope.schema.json @@ -1,12 +1,27 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/envelope.schema.json", + "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/common/envelope.schema.json", "title": "CommandEnvelope", "description": "Fields every Bambu MQTT command/response shares, across both protocol generations - unversioned, at the bambulab/ root, not duplicated under v1/ or v2/. This is the 'base class' - other schemas extend it via allOf + $ref. JSON Schema doesn't have inheritance either, strictly speaking (no 'extends' keyword) - allOf is composition: it says the instance must satisfy THIS schema AND whatever else is listed alongside it. It's the closest thing to real inheritance ergonomics of anything used across this project's schema stack (proto, Rust), because $ref + allOf lets you name and reuse a shape without re-declaring its fields, which proto/Rust composition can't quite do (there you still write `common: PrinterReportCommon` by hand on every struct).", "type": "object", "properties": { - "sequence_id": { "type": "string" }, - "command": { "type": "string" } + "sequence_id": { + "type": "string", + "description": "Sequence ID matching the original request" + }, + "command": { + "type": "string", + "description": "Command being reported on" + }, + "result": { + "type": "string", + "enum": ["success", "fail", "SUCCESS", "FAIL"], + "description": "Result status (case-insensitive)" + }, + "reason": { + "type": "string", + "description": "Optional reason or error message" + } }, "required": ["sequence_id", "command"] } diff --git a/schemas/bambulab/v1/common/nozzle_diameter.schema.json b/schemas/bambulab/v1/common/nozzle_diameter.schema.json new file mode 100644 index 0000000..668a923 --- /dev/null +++ b/schemas/bambulab/v1/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/v1/common/nozzle_diameter.schema.json", + "title": "NozzleDiameter", + "description": "Common schema for nozzle diameter", + "type": "string", + "enum": [ + "0.2", + "0.4", + "0.6", + "0.8" + ] +} diff --git a/schemas/bambulab/v1/common/nozzle_type.schema.json b/schemas/bambulab/v1/common/nozzle_type.schema.json new file mode 100644 index 0000000..1cc4599 --- /dev/null +++ b/schemas/bambulab/v1/common/nozzle_type.schema.json @@ -0,0 +1,11 @@ +{ + "$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", + "type": "string", + "enum": [ + "stainless_steel", + "hardened_steel" + ] +} diff --git a/schemas/bambulab/v1/report/info/get_version.schema.json b/schemas/bambulab/v1/report/info/get_version.schema.json index 68022ef..9035499 100644 --- a/schemas/bambulab/v1/report/info/get_version.schema.json +++ b/schemas/bambulab/v1/report/info/get_version.schema.json @@ -1,15 +1,13 @@ { "$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/get_version.schema.json", - "title": "GetVersionResponse", + "title": "GetVersionReport", "allOf": [ - { "$ref": "../../../envelope.schema.json" }, + { "$ref": "../../../common/envelope.schema.json" }, { "type": "object", "properties": { "command": { "const": "get_version" }, - "result": { "type": "string" }, - "reason": { "type": "string" }, "module": { "type": "array", "items": { "$ref": "_module_info.schema.json" } diff --git a/schemas/bambulab/v1/report/print/_hms.schema.json b/schemas/bambulab/v1/report/print/_hms.schema.json new file mode 100644 index 0000000..54f44ca --- /dev/null +++ b/schemas/bambulab/v1/report/print/_hms.schema.json @@ -0,0 +1,10 @@ +{ + "$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", + "title": "Online", + "description": "Printer online/offline status", + "type": "array", + "items": { + "type": "object" + } +} diff --git a/schemas/bambulab/v1/report/print/_ipcam.schema.json b/schemas/bambulab/v1/report/print/_ipcam.schema.json new file mode 100644 index 0000000..3d22b5a --- /dev/null +++ b/schemas/bambulab/v1/report/print/_ipcam.schema.json @@ -0,0 +1,46 @@ +{ + "$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", + "title": "Ipcam", + "description": "Report about the in-built IP camera", + "type": "object", + "properties": { + "ipcam_dev": { + "type": "string" + }, + "ipcam_record": { + "type": "string", + "enum": [ + "enable", + "disable", + "ENABLE", + "DISABLE" + ] + }, + "timelapse": { + "type": "string", + "enum": [ + "enable", + "disable", + "ENABLE", + "DISABLE" + ] + }, + "resolution": { + "type": "string" + }, + "tutk_server": { + "type": "string", + "enum": [ + "enable", + "disable", + "ENABLE", + "DISABLE" + ] + }, + "mode_bits": { + "type": "integer", + "minimum": 0 + } + } +} diff --git a/schemas/bambulab/v1/report/print/_lights_report.schema.json b/schemas/bambulab/v1/report/print/_lights_report.schema.json new file mode 100644 index 0000000..3882f06 --- /dev/null +++ b/schemas/bambulab/v1/report/print/_lights_report.schema.json @@ -0,0 +1,29 @@ +{ + "$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", + "title": "LightsReport", + "description": "Report status of printer lights", + "type": "array", + "items": { + "type": "object", + "properties": { + "mode": { + "type": "string", + "enum": [ + "on", + "off", + "ON", + "OFF" + ] + }, + "node": { + "type": "string", + "enum": [ + "chamber_light", + "work_light", + "chamber_light2" + ] + } + } + } +} diff --git a/schemas/bambulab/v1/report/print/_net.schema.json b/schemas/bambulab/v1/report/print/_net.schema.json new file mode 100644 index 0000000..0858802 --- /dev/null +++ b/schemas/bambulab/v1/report/print/_net.schema.json @@ -0,0 +1,30 @@ +{ + "$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", + "title": "Net", + "description": "Network status", + "type": "object", + "properties": { + "conf": { + "type": "integer" + }, + "info": { + "type": "array", + "items": { + "type": "object", + "properties": { + "ip": { + "type": "integer" + }, + "mask": { + "type": "integer" + } + }, + "required": [ + "ip", + "mask" + ] + } + } + } +} diff --git a/schemas/bambulab/v1/report/print/_online.schema.json b/schemas/bambulab/v1/report/print/_online.schema.json new file mode 100644 index 0000000..4ce16d9 --- /dev/null +++ b/schemas/bambulab/v1/report/print/_online.schema.json @@ -0,0 +1,18 @@ +{ + "$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", + "title": "Online", + "description": "Printer online/offline status", + "type": "object", + "properties": { + "ahb": { + "type": "boolean" + }, + "rfid": { + "type": "boolean" + }, + "version": { + "type": "integer" + } + } +} diff --git a/schemas/bambulab/v1/report/print/_upload.schema.json b/schemas/bambulab/v1/report/print/_upload.schema.json new file mode 100644 index 0000000..1419da5 --- /dev/null +++ b/schemas/bambulab/v1/report/print/_upload.schema.json @@ -0,0 +1,65 @@ +{ + "$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/_upload.schema.json", + "title": "Upload", + "description": "File upload progress", + "oneOf": [ + { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "idle", + "IDLE" + ] + }, + "progress": { + "type": "integer" + }, + "message": { + "type": "string" + } + } + }, + { + "type": "object", + "properties": { + "file_size": { + "type": "integer" + }, + "finish_size": { + "type": "integer" + }, + "message": { + "type": "string" + }, + "oss_url": { + "type": "string" + }, + "progress": { + "type": "integer" + }, + "speed": { + "type": "integer" + }, + "status": { + "type": "string", + "enum": [ + "idle", + "IDLE" + ] + }, + "task_id": { + "type": "string" + }, + "time_remaining": { + "type": "integer" + }, + "trouble_id": { + "type": "string" + } + } + } + ] +} diff --git a/schemas/bambulab/v1/report/print/print.schema.json b/schemas/bambulab/v1/report/print/print.schema.json index cb0d480..8ef85c1 100644 --- a/schemas/bambulab/v1/report/print/print.schema.json +++ b/schemas/bambulab/v1/report/print/print.schema.json @@ -4,19 +4,78 @@ "title": "PrintReport", "description": "The ongoing print-state push (root key \"print\") - NOT a direct reply to the pushall request (that goes to \"pushing\", see request/pushing/pushall.schema.json). Sending pushall makes the printer start/refresh this stream; it isn't itself request/response, which is also why this is its own category folder rather than sitting under pushing/ - a category here is 'what root key does this arrive under', not 'what triggered it'.", "allOf": [ - { "$ref": "../../../envelope.schema.json" }, + { "$ref": "../../../common/envelope.schema.json" }, { "type": "object", "properties": { - "ams": { "$ref": "_ams.schema.json" }, - "ams_exist_bits": { "type": "string" }, - "insert_flag": { "type": "boolean" }, - "power_on_flag": { "type": "boolean" }, - "tray_exist_bits": { "type": "string" }, - "tray_is_bbl_bits": { "type": "string" }, + "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" }, - "xcam_status": { "type": "string" } + + "nozzle_diameter": { "$ref": "../../common/nozzle_diameter.schema.json" }, + "nozzle_type": { "$ref": "../../common/nozzle_type.schema.json" }, + "nozzle_temper": { "type": "number" }, + "nozzle_target_temper": { "type": "number" }, + "bed_temper": { "type": "number" }, + "bed_target_temper": { "type": "number" }, + "chamber_temper": { "type": "number" }, + "chamber_target_temper": { "type": "number" }, + "fan_gear": { "type": "integer" }, + "heatbreak_fan_speed": { "type": "string" }, + "cooling_fan_speed": { "type": "string" }, + "big_fan1_speed": { "type": "string" }, + "big_fan2_speed": { "type": "string" }, + + "s_obj": { "type": "array", "items": {} }, + "filam_bak": { "type": "array", "items": {} }, + "stg": { "type": "array", "items": {} }, + + "mc_print_stage": { "type": "string" }, + "mc_percent": { "type": "integer" }, + "mc_remaining_time": { "type": "integer" }, + + "ams_status": { "type": "integer" }, + "ams_rfid_status": { "type": "integer" }, + "hw_switch_state": { "type": "integer" }, + "spd_mag": { "type": "integer", "minimum": 0, "maximum": 100 }, + "spd_lvl": { "type": "integer", "minimum": 1, "maximum": 4 }, + "print_error": { "type": "integer" }, + "lifecycle": { "type": "string", "enum": ["product"] }, + "wifi_signal": { "type": "string", "pattern": "^-([0-9]{1,2}|100)dBm$" }, + "gcode_state": { "type": "string", "enum": [ "idle", "IDLE" ] }, + "gcode_file_prepare_percent": { "type": "string" }, + "queue_number": { "type": "integer" }, + "queue_total": { "type": "integer" }, + "queue_est": { "type": "integer" }, + "queue_sts": { "type": "integer" }, + "project_id": { "type": "string" }, + "profile_id": { "type": "string" }, + "task_id": { "type": "string" }, + "subtask_id": { "type": "string" }, + "subtask_name": { "type": "string" }, + "gcode_file": { "type": "string" }, + "stg_cur": { "type": "integer" }, + "print_type": { "type": "string", "enum": [ "idle", "IDLE" ] }, + "home_flag": { "type": "integer" }, + "mc_print_line_number": { "type": "string" }, + "mc_print_sub_stage": { "type": "integer" }, + "sdcard": { "type": "boolean" }, + "force_upgrade": { "type": "boolean" }, + "mess_production_state": { "type": "string", "enum": [ "active", "inactive", "ACTIVE", "INACTIVE" ] }, + "layer_num": { "type": "integer" }, + "total_layer_num": { "type": "integer" }, + "cali_version": { "type": "integer" }, + "k": { "type": "string" }, + "flag3": { "type": "integer" } } } ] diff --git a/schemas/bambulab/v1/request/info/get_version.schema.json b/schemas/bambulab/v1/request/info/get_version.schema.json index fa0963e..7536130 100644 --- a/schemas/bambulab/v1/request/info/get_version.schema.json +++ b/schemas/bambulab/v1/request/info/get_version.schema.json @@ -3,7 +3,7 @@ "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v1/request/info/get_version.schema.json", "title": "GetVersionRequest", "allOf": [ - { "$ref": "../../../envelope.schema.json" }, + { "$ref": "../../../common/envelope.schema.json" }, { "type": "object", "properties": { diff --git a/schemas/bambulab/v1/request/pushing/pushall.schema.json b/schemas/bambulab/v1/request/pushing/pushall.schema.json index 366182e..4abb01f 100644 --- a/schemas/bambulab/v1/request/pushing/pushall.schema.json +++ b/schemas/bambulab/v1/request/pushing/pushall.schema.json @@ -3,7 +3,7 @@ "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v1/request/pushing/pushall.schema.json", "title": "PushallRequest", "allOf": [ - { "$ref": "../../../envelope.schema.json" }, + { "$ref": "../../../common/envelope.schema.json" }, { "type": "object", "properties": {