From de5aa86a2b0a09e2ee32e8af3f135adc46de74e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iwo=20Strzebo=C5=84ski?= Date: Wed, 2 Sep 2026 15:08:27 +0000 Subject: [PATCH] feat: added `upgrade` schemas vor BambuMQTT v1 and v2 --- schemas/bambulab/common/url.schema.json | 8 ++++ schemas/bambulab/common/version.schema.json | 7 +++ .../v1/common/firmware_details.schema.json | 12 +++++ .../upgrade/consistency_confirm.schema.json | 14 ++++++ .../v1/report/upgrade/get_history.schema.json | 46 +++++++++++++++++++ .../v1/report/upgrade/start.schema.json | 30 ++++++++++++ .../upgrade/upgrade_confirm.schema.json | 14 ++++++ .../request/print/unload_filament.schema.json | 3 +- .../upgrade/consistency_confirm.schema.json | 14 ++++++ .../request/upgrade/get_history.schema.json | 14 ++++++ .../v1/request/upgrade/start.schema.json | 30 ++++++++++++ .../upgrade/upgrade_confirm.schema.json | 14 ++++++ .../v2/common/firmware_details.schema.json | 12 +++++ .../v2/common/upgrade_state.schema.json | 2 +- .../upgrade/consistency_confirm.schema.json | 14 ++++++ .../v2/report/upgrade/get_history.schema.json | 46 +++++++++++++++++++ .../v2/report/upgrade/start.schema.json | 30 ++++++++++++ .../upgrade/upgrade_confirm.schema.json | 14 ++++++ .../upgrade/consistency_confirm.schema.json | 14 ++++++ .../request/upgrade/get_history.schema.json | 14 ++++++ .../v2/request/upgrade/start.schema.json | 30 ++++++++++++ .../upgrade/upgrade_confirm.schema.json | 14 ++++++ 22 files changed, 393 insertions(+), 3 deletions(-) create mode 100644 schemas/bambulab/common/url.schema.json create mode 100644 schemas/bambulab/common/version.schema.json create mode 100644 schemas/bambulab/v1/common/firmware_details.schema.json create mode 100644 schemas/bambulab/v1/report/upgrade/consistency_confirm.schema.json create mode 100644 schemas/bambulab/v1/report/upgrade/get_history.schema.json create mode 100644 schemas/bambulab/v1/report/upgrade/start.schema.json create mode 100644 schemas/bambulab/v1/report/upgrade/upgrade_confirm.schema.json create mode 100644 schemas/bambulab/v1/request/upgrade/consistency_confirm.schema.json create mode 100644 schemas/bambulab/v1/request/upgrade/get_history.schema.json create mode 100644 schemas/bambulab/v1/request/upgrade/start.schema.json create mode 100644 schemas/bambulab/v1/request/upgrade/upgrade_confirm.schema.json create mode 100644 schemas/bambulab/v2/common/firmware_details.schema.json create mode 100644 schemas/bambulab/v2/report/upgrade/consistency_confirm.schema.json create mode 100644 schemas/bambulab/v2/report/upgrade/get_history.schema.json create mode 100644 schemas/bambulab/v2/report/upgrade/start.schema.json create mode 100644 schemas/bambulab/v2/report/upgrade/upgrade_confirm.schema.json create mode 100644 schemas/bambulab/v2/request/upgrade/consistency_confirm.schema.json create mode 100644 schemas/bambulab/v2/request/upgrade/get_history.schema.json create mode 100644 schemas/bambulab/v2/request/upgrade/start.schema.json create mode 100644 schemas/bambulab/v2/request/upgrade/upgrade_confirm.schema.json diff --git a/schemas/bambulab/common/url.schema.json b/schemas/bambulab/common/url.schema.json new file mode 100644 index 0000000..fe68793 --- /dev/null +++ b/schemas/bambulab/common/url.schema.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/common/url.schema.json", + "title": "CommonUrlSchema", + "type": "string", + "format": "uri", + "pattern": "^https?://" +} diff --git a/schemas/bambulab/common/version.schema.json b/schemas/bambulab/common/version.schema.json new file mode 100644 index 0000000..931a523 --- /dev/null +++ b/schemas/bambulab/common/version.schema.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/common/version.schema.json", + "title": "CommonVersionSchema", + "type": "string", + "pattern": "^(?:\\d{2}\\.){3}\\d{2}$" +} diff --git a/schemas/bambulab/v1/common/firmware_details.schema.json b/schemas/bambulab/v1/common/firmware_details.schema.json new file mode 100644 index 0000000..32e10f3 --- /dev/null +++ b/schemas/bambulab/v1/common/firmware_details.schema.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v1/common/firmware_details.schema.json", + "title": "FirmwareDetails", + "type": "object", + "properties": { + "description": { "type": "string" }, + "force_update": { "type": "boolean" }, + "url": { "$ref": "../../common/url.schema.json" }, + "version": { "$ref": "../../common/version.schema.json" } + } +} diff --git a/schemas/bambulab/v1/report/upgrade/consistency_confirm.schema.json b/schemas/bambulab/v1/report/upgrade/consistency_confirm.schema.json new file mode 100644 index 0000000..33f4290 --- /dev/null +++ b/schemas/bambulab/v1/report/upgrade/consistency_confirm.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/report/upgrade/upgrade_confirm.schema.json", + "title": "ConsistencyConfirmReport", + "allOf": [ + { "$ref": "../../../common/envelope.schema.json" }, + { + "type": "object", + "properties": { + "command": { "const": "consistency_confirm" } + } + } + ] +} diff --git a/schemas/bambulab/v1/report/upgrade/get_history.schema.json b/schemas/bambulab/v1/report/upgrade/get_history.schema.json new file mode 100644 index 0000000..52c4f06 --- /dev/null +++ b/schemas/bambulab/v1/report/upgrade/get_history.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/upgrade/get_history.schema.json", + "title": "GetUpgradeHistoryReport", + "allOf": [ + { "$ref": "../../../common/envelope.schema.json" }, + { + "type": "object", + "properties": { + "command": { "const": "get_history" }, + "firmware_optional": { + "type": "array", + "items": { + "type": "object", + "properties": { + "ams": { + "type": "array", + "items": { + "type": "object", + "properties": { + "address": { "type": "integer" }, + "dev_model_name": { "type": "string" }, + "device_id": { "type": "string" }, + "firmware": { + "type": ["null", "array"], + "items": { "$ref": "../../common/firmware_details.schema.json" } + }, + "firmware_current": { + "type": ["null", "array"], + "items": { "$ref": "../../common/firmware_details.schema.json" } + } + } + } + }, + "firmware": { + "type": ["null", "array"], + "items": { "$ref": "../../common/firmware_details.schema.json" } + } + } + } + } + }, + "required": ["firmware_optional"] + } + ] +} diff --git a/schemas/bambulab/v1/report/upgrade/start.schema.json b/schemas/bambulab/v1/report/upgrade/start.schema.json new file mode 100644 index 0000000..22da45f --- /dev/null +++ b/schemas/bambulab/v1/report/upgrade/start.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/upgrade/start.schema.json", + "title": "UpgradeStartReport", + "description": "TODO: Quite possibly incorrect - validate", + "allOf": [ + { "$ref": "../../../common/envelope.schema.json" }, + { + "type": "object", + "properties": { + "command": { "const": "start" }, + "url": { + "type": "string", + "description": "URL of a signed JSON with URLs to signed binaries", + "format": "uri", + "pattern": "^https?://" + }, + "module": { + "type": "string", + "enum": ["ota", "ams"] + }, + "version": { + "type": "string", + "description": "New version number that will get downloaded" + } + }, + "required": ["url", "module", "version"] + } + ] +} diff --git a/schemas/bambulab/v1/report/upgrade/upgrade_confirm.schema.json b/schemas/bambulab/v1/report/upgrade/upgrade_confirm.schema.json new file mode 100644 index 0000000..407f77f --- /dev/null +++ b/schemas/bambulab/v1/report/upgrade/upgrade_confirm.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/report/upgrade/upgrade_confirm.schema.json", + "title": "UpgradeConfirmReport", + "allOf": [ + { "$ref": "../../../common/envelope.schema.json" }, + { + "type": "object", + "properties": { + "command": { "const": "upgrade_confirm" } + } + } + ] +} diff --git a/schemas/bambulab/v1/request/print/unload_filament.schema.json b/schemas/bambulab/v1/request/print/unload_filament.schema.json index 72c673a..e4ef586 100644 --- a/schemas/bambulab/v1/request/print/unload_filament.schema.json +++ b/schemas/bambulab/v1/request/print/unload_filament.schema.json @@ -8,8 +8,7 @@ "type": "object", "properties": { "command": { "const": "unload_filament" } - }, - "required": ["param"] + } } ] } diff --git a/schemas/bambulab/v1/request/upgrade/consistency_confirm.schema.json b/schemas/bambulab/v1/request/upgrade/consistency_confirm.schema.json new file mode 100644 index 0000000..16f5606 --- /dev/null +++ b/schemas/bambulab/v1/request/upgrade/consistency_confirm.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/request/upgrade/upgrade_confirm.schema.json", + "title": "ConsistencyConfirmRequest", + "allOf": [ + { "$ref": "../../../common/envelope.schema.json" }, + { + "type": "object", + "properties": { + "command": { "const": "consistency_confirm" } + } + } + ] +} diff --git a/schemas/bambulab/v1/request/upgrade/get_history.schema.json b/schemas/bambulab/v1/request/upgrade/get_history.schema.json new file mode 100644 index 0000000..605064f --- /dev/null +++ b/schemas/bambulab/v1/request/upgrade/get_history.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/request/upgrade/get_history.schema.json", + "title": "GetUpgradeHistoryRequest", + "allOf": [ + { "$ref": "../../../common/envelope.schema.json" }, + { + "type": "object", + "properties": { + "command": { "const": "get_history" } + } + } + ] +} diff --git a/schemas/bambulab/v1/request/upgrade/start.schema.json b/schemas/bambulab/v1/request/upgrade/start.schema.json new file mode 100644 index 0000000..ae97e4f --- /dev/null +++ b/schemas/bambulab/v1/request/upgrade/start.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/request/upgrade/start.schema.json", + "title": "UpgradeStartRequest", + "allOf": [ + { "$ref": "../../../common/envelope.schema.json" }, + { + "type": "object", + "properties": { + "command": { "const": "start" }, + "url": { + "type": "string", + "description": "URL of a signed JSON with URLs to signed binaries", + "format": "uri", + "pattern": "^https?://" + }, + "module": { + "type": "string", + "enum": ["ota", "ams"] + }, + "version": { + "type": "string", + "description": "New version number that will get downloaded", + "pattern": "^(?:\\d{2}\\.){3}\\d{2}$" + } + }, + "required": ["url", "module", "version"] + } + ] +} diff --git a/schemas/bambulab/v1/request/upgrade/upgrade_confirm.schema.json b/schemas/bambulab/v1/request/upgrade/upgrade_confirm.schema.json new file mode 100644 index 0000000..4fffecd --- /dev/null +++ b/schemas/bambulab/v1/request/upgrade/upgrade_confirm.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/request/upgrade/upgrade_confirm.schema.json", + "title": "UpgradeConfirmRequest", + "allOf": [ + { "$ref": "../../../common/envelope.schema.json" }, + { + "type": "object", + "properties": { + "command": { "const": "upgrade_confirm" } + } + } + ] +} diff --git a/schemas/bambulab/v2/common/firmware_details.schema.json b/schemas/bambulab/v2/common/firmware_details.schema.json new file mode 100644 index 0000000..5f21629 --- /dev/null +++ b/schemas/bambulab/v2/common/firmware_details.schema.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v2/common/firmware_details.schema.json", + "title": "FirmwareDetails", + "type": "object", + "properties": { + "description": { "type": "string" }, + "force_update": { "type": "boolean" }, + "url": { "$ref": "../../common/url.schema.json" }, + "version": { "$ref": "../../common/version.schema.json" } + } +} diff --git a/schemas/bambulab/v2/common/upgrade_state.schema.json b/schemas/bambulab/v2/common/upgrade_state.schema.json index 131b318..b3a3881 100644 --- a/schemas/bambulab/v2/common/upgrade_state.schema.json +++ b/schemas/bambulab/v2/common/upgrade_state.schema.json @@ -13,7 +13,7 @@ "force_upgrade": { "type": "boolean" }, "idx": { "type": "integer" }, "idx2": { "type": "integer" }, - "lower_limit": { "type": "string", "pattern": "..\\...\\...\\..." }, + "lower_limit": { "type": "string", "pattern": "^(?:\\d{2}\\.){3}\\d{2}$" }, "message": { "type": "string" }, "module": { "type": "string" }, "new_version_state": { "type": "integer" }, diff --git a/schemas/bambulab/v2/report/upgrade/consistency_confirm.schema.json b/schemas/bambulab/v2/report/upgrade/consistency_confirm.schema.json new file mode 100644 index 0000000..e868168 --- /dev/null +++ b/schemas/bambulab/v2/report/upgrade/consistency_confirm.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/report/upgrade/upgrade_confirm.schema.json", + "title": "ConsistencyConfirmReport", + "allOf": [ + { "$ref": "../../../common/envelope.schema.json" }, + { + "type": "object", + "properties": { + "command": { "const": "consistency_confirm" } + } + } + ] +} diff --git a/schemas/bambulab/v2/report/upgrade/get_history.schema.json b/schemas/bambulab/v2/report/upgrade/get_history.schema.json new file mode 100644 index 0000000..4b6a59d --- /dev/null +++ b/schemas/bambulab/v2/report/upgrade/get_history.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/v2/report/upgrade/get_history.schema.json", + "title": "GetUpgradeHistoryReport", + "allOf": [ + { "$ref": "../../../common/envelope.schema.json" }, + { + "type": "object", + "properties": { + "command": { "const": "get_history" }, + "firmware_optional": { + "type": "array", + "items": { + "type": "object", + "properties": { + "ams": { + "type": "array", + "items": { + "type": "object", + "properties": { + "address": { "type": "integer" }, + "dev_model_name": { "type": "string" }, + "device_id": { "type": "string" }, + "firmware": { + "type": ["null", "array"], + "items": { "$ref": "../../common/firmware_details.schema.json" } + }, + "firmware_current": { + "type": ["null", "array"], + "items": { "$ref": "../../common/firmware_details.schema.json" } + } + } + } + }, + "firmware": { + "type": ["null", "array"], + "items": { "$ref": "../../common/firmware_details.schema.json" } + } + } + } + } + }, + "required": ["firmware_optional"] + } + ] +} diff --git a/schemas/bambulab/v2/report/upgrade/start.schema.json b/schemas/bambulab/v2/report/upgrade/start.schema.json new file mode 100644 index 0000000..b9c324a --- /dev/null +++ b/schemas/bambulab/v2/report/upgrade/start.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/v2/report/upgrade/start.schema.json", + "title": "UpgradeStartReport", + "description": "TODO: Quite possibly incorrect - validate", + "allOf": [ + { "$ref": "../../../common/envelope.schema.json" }, + { + "type": "object", + "properties": { + "command": { "const": "start" }, + "url": { + "type": "string", + "description": "URL of a signed JSON with URLs to signed binaries", + "format": "uri", + "pattern": "^https?://" + }, + "module": { + "type": "string", + "enum": ["ota", "ams"] + }, + "version": { + "type": "string", + "description": "New version number that will get downloaded" + } + }, + "required": ["url", "module", "version"] + } + ] +} diff --git a/schemas/bambulab/v2/report/upgrade/upgrade_confirm.schema.json b/schemas/bambulab/v2/report/upgrade/upgrade_confirm.schema.json new file mode 100644 index 0000000..7f87d42 --- /dev/null +++ b/schemas/bambulab/v2/report/upgrade/upgrade_confirm.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/report/upgrade/upgrade_confirm.schema.json", + "title": "UpgradeConfirmReport", + "allOf": [ + { "$ref": "../../../common/envelope.schema.json" }, + { + "type": "object", + "properties": { + "command": { "const": "upgrade_confirm" } + } + } + ] +} diff --git a/schemas/bambulab/v2/request/upgrade/consistency_confirm.schema.json b/schemas/bambulab/v2/request/upgrade/consistency_confirm.schema.json new file mode 100644 index 0000000..ac31935 --- /dev/null +++ b/schemas/bambulab/v2/request/upgrade/consistency_confirm.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/upgrade/upgrade_confirm.schema.json", + "title": "ConsistencyConfirmRequest", + "allOf": [ + { "$ref": "../../../common/envelope.schema.json" }, + { + "type": "object", + "properties": { + "command": { "const": "consistency_confirm" } + } + } + ] +} diff --git a/schemas/bambulab/v2/request/upgrade/get_history.schema.json b/schemas/bambulab/v2/request/upgrade/get_history.schema.json new file mode 100644 index 0000000..7987945 --- /dev/null +++ b/schemas/bambulab/v2/request/upgrade/get_history.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/upgrade/get_history.schema.json", + "title": "GetUpgradeHistoryRequest", + "allOf": [ + { "$ref": "../../../common/envelope.schema.json" }, + { + "type": "object", + "properties": { + "command": { "const": "get_history" } + } + } + ] +} diff --git a/schemas/bambulab/v2/request/upgrade/start.schema.json b/schemas/bambulab/v2/request/upgrade/start.schema.json new file mode 100644 index 0000000..9c3bb87 --- /dev/null +++ b/schemas/bambulab/v2/request/upgrade/start.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/v2/request/upgrade/start.schema.json", + "title": "UpgradeStartRequest", + "allOf": [ + { "$ref": "../../../common/envelope.schema.json" }, + { + "type": "object", + "properties": { + "command": { "const": "start" }, + "url": { + "type": "string", + "description": "URL of a signed JSON with URLs to signed binaries", + "format": "uri", + "pattern": "^https?://" + }, + "module": { + "type": "string", + "enum": ["ota", "ams"] + }, + "version": { + "type": "string", + "description": "New version number that will get downloaded", + "pattern": "^(?:\\d{2}\\.){3}\\d{2}$" + } + }, + "required": ["url", "module", "version"] + } + ] +} diff --git a/schemas/bambulab/v2/request/upgrade/upgrade_confirm.schema.json b/schemas/bambulab/v2/request/upgrade/upgrade_confirm.schema.json new file mode 100644 index 0000000..a176a0f --- /dev/null +++ b/schemas/bambulab/v2/request/upgrade/upgrade_confirm.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/upgrade/upgrade_confirm.schema.json", + "title": "UpgradeConfirmRequest", + "allOf": [ + { "$ref": "../../../common/envelope.schema.json" }, + { + "type": "object", + "properties": { + "command": { "const": "upgrade_confirm" } + } + } + ] +}