diff --git a/packages/ts-types/src/index.d.ts b/packages/ts-types/src/index.d.ts new file mode 100644 index 0000000..ada6fe7 --- /dev/null +++ b/packages/ts-types/src/index.d.ts @@ -0,0 +1,2 @@ +export * from "./schemas"; +export * as proto from "./generated"; diff --git a/packages/ts-types/src/index.js b/packages/ts-types/src/index.js new file mode 100644 index 0000000..e22f64b --- /dev/null +++ b/packages/ts-types/src/index.js @@ -0,0 +1,6 @@ +export * from "./schemas"; +// `src/generated/**` is produced by `npm run build:ts` (protoc + ts-proto) +// from the .proto sources in /proto and is not committed. Re-export it +// here once generated so consumers get both the TypeBox runtime schemas +// and the proto-derived TS types from a single package entry point. +export * as proto from "./generated"; diff --git a/packages/ts-types/src/schemas/index.d.ts b/packages/ts-types/src/schemas/index.d.ts new file mode 100644 index 0000000..2e3ff77 --- /dev/null +++ b/packages/ts-types/src/schemas/index.d.ts @@ -0,0 +1,4 @@ +export * from "./material"; +export * from "./print-params"; +export * from "./template"; +export * from "./print-job"; diff --git a/packages/ts-types/src/schemas/index.js b/packages/ts-types/src/schemas/index.js new file mode 100644 index 0000000..2e3ff77 --- /dev/null +++ b/packages/ts-types/src/schemas/index.js @@ -0,0 +1,4 @@ +export * from "./material"; +export * from "./print-params"; +export * from "./template"; +export * from "./print-job"; diff --git a/packages/ts-types/src/schemas/material.d.ts b/packages/ts-types/src/schemas/material.d.ts new file mode 100644 index 0000000..a13da1a --- /dev/null +++ b/packages/ts-types/src/schemas/material.d.ts @@ -0,0 +1,11 @@ +import { type Static } from "@sinclair/typebox"; +export declare const MaterialProfileSchema: import("@sinclair/typebox").TObject<{ + id: import("@sinclair/typebox").TString; + name: import("@sinclair/typebox").TString; + filamentType: import("@sinclair/typebox").TString; + nozzleTempC: import("@sinclair/typebox").TNumber; + bedTempC: import("@sinclair/typebox").TNumber; + densityGCm3: import("@sinclair/typebox").TNumber; + colorHex: import("@sinclair/typebox").TString; +}>; +export type MaterialProfile = Static; diff --git a/packages/ts-types/src/schemas/material.js b/packages/ts-types/src/schemas/material.js new file mode 100644 index 0000000..7eea3bc --- /dev/null +++ b/packages/ts-types/src/schemas/material.js @@ -0,0 +1,10 @@ +import { Type } from "@sinclair/typebox"; +export const MaterialProfileSchema = Type.Object({ + id: Type.String({ format: "uuid" }), + name: Type.String({ minLength: 1 }), + filamentType: Type.String({ minLength: 1 }), + nozzleTempC: Type.Number(), + bedTempC: Type.Number(), + densityGCm3: Type.Number(), + colorHex: Type.String({ pattern: "^#[0-9a-fA-F]{6}$" }), +}); diff --git a/packages/ts-types/src/schemas/print-job.d.ts b/packages/ts-types/src/schemas/print-job.d.ts new file mode 100644 index 0000000..eb3265c --- /dev/null +++ b/packages/ts-types/src/schemas/print-job.d.ts @@ -0,0 +1,15 @@ +import { type Static } from "@sinclair/typebox"; +export declare const PrintJobStatusSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"PRINT_JOB_STATUS_UNSPECIFIED">, import("@sinclair/typebox").TLiteral<"PRINT_JOB_STATUS_QUEUED">, import("@sinclair/typebox").TLiteral<"PRINT_JOB_STATUS_PRINTING">, import("@sinclair/typebox").TLiteral<"PRINT_JOB_STATUS_PAUSED">, import("@sinclair/typebox").TLiteral<"PRINT_JOB_STATUS_COMPLETED">, import("@sinclair/typebox").TLiteral<"PRINT_JOB_STATUS_FAILED">, import("@sinclair/typebox").TLiteral<"PRINT_JOB_STATUS_CANCELLED">]>; +export type PrintJobStatus = Static; +export declare const PrintJobSchema: import("@sinclair/typebox").TObject<{ + id: import("@sinclair/typebox").TString; + farmId: import("@sinclair/typebox").TString; + printerId: import("@sinclair/typebox").TString; + templateId: import("@sinclair/typebox").TString; + status: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"PRINT_JOB_STATUS_UNSPECIFIED">, import("@sinclair/typebox").TLiteral<"PRINT_JOB_STATUS_QUEUED">, import("@sinclair/typebox").TLiteral<"PRINT_JOB_STATUS_PRINTING">, import("@sinclair/typebox").TLiteral<"PRINT_JOB_STATUS_PAUSED">, import("@sinclair/typebox").TLiteral<"PRINT_JOB_STATUS_COMPLETED">, import("@sinclair/typebox").TLiteral<"PRINT_JOB_STATUS_FAILED">, import("@sinclair/typebox").TLiteral<"PRINT_JOB_STATUS_CANCELLED">]>; + progressPercent: import("@sinclair/typebox").TNumber; + startedAtUnix: import("@sinclair/typebox").TInteger; + completedAtUnix: import("@sinclair/typebox").TInteger; + gcodeFileKey: import("@sinclair/typebox").TString; +}>; +export type PrintJob = Static; diff --git a/packages/ts-types/src/schemas/print-job.js b/packages/ts-types/src/schemas/print-job.js new file mode 100644 index 0000000..5e38ce5 --- /dev/null +++ b/packages/ts-types/src/schemas/print-job.js @@ -0,0 +1,21 @@ +import { Type } from "@sinclair/typebox"; +export const PrintJobStatusSchema = Type.Union([ + Type.Literal("PRINT_JOB_STATUS_UNSPECIFIED"), + Type.Literal("PRINT_JOB_STATUS_QUEUED"), + Type.Literal("PRINT_JOB_STATUS_PRINTING"), + Type.Literal("PRINT_JOB_STATUS_PAUSED"), + Type.Literal("PRINT_JOB_STATUS_COMPLETED"), + Type.Literal("PRINT_JOB_STATUS_FAILED"), + Type.Literal("PRINT_JOB_STATUS_CANCELLED"), +]); +export const PrintJobSchema = Type.Object({ + id: Type.String({ format: "uuid" }), + farmId: Type.String({ format: "uuid" }), + printerId: Type.String({ format: "uuid" }), + templateId: Type.String({ format: "uuid" }), + status: PrintJobStatusSchema, + progressPercent: Type.Number({ minimum: 0, maximum: 100 }), + startedAtUnix: Type.Integer(), + completedAtUnix: Type.Integer(), + gcodeFileKey: Type.String({ minLength: 1 }), +}); diff --git a/packages/ts-types/src/schemas/print-params.d.ts b/packages/ts-types/src/schemas/print-params.d.ts new file mode 100644 index 0000000..bbb4d50 --- /dev/null +++ b/packages/ts-types/src/schemas/print-params.d.ts @@ -0,0 +1,10 @@ +import { type Static } from "@sinclair/typebox"; +export declare const PrintParametersSchema: import("@sinclair/typebox").TObject<{ + layerHeightMm: import("@sinclair/typebox").TNumber; + infillPercent: import("@sinclair/typebox").TInteger; + infillPattern: import("@sinclair/typebox").TString; + printSpeedMmS: import("@sinclair/typebox").TNumber; + supportsEnabled: import("@sinclair/typebox").TBoolean; + wallCount: import("@sinclair/typebox").TInteger; +}>; +export type PrintParameters = Static; diff --git a/packages/ts-types/src/schemas/print-params.js b/packages/ts-types/src/schemas/print-params.js new file mode 100644 index 0000000..55a43ec --- /dev/null +++ b/packages/ts-types/src/schemas/print-params.js @@ -0,0 +1,9 @@ +import { Type } from "@sinclair/typebox"; +export const PrintParametersSchema = Type.Object({ + layerHeightMm: Type.Number({ minimum: 0.04, maximum: 1.0 }), + infillPercent: Type.Integer({ minimum: 0, maximum: 100 }), + infillPattern: Type.String({ minLength: 1 }), + printSpeedMmS: Type.Number({ minimum: 0 }), + supportsEnabled: Type.Boolean(), + wallCount: Type.Integer({ minimum: 0 }), +}); diff --git a/packages/ts-types/src/schemas/template.d.ts b/packages/ts-types/src/schemas/template.d.ts new file mode 100644 index 0000000..19a87ae --- /dev/null +++ b/packages/ts-types/src/schemas/template.d.ts @@ -0,0 +1,29 @@ +import { type Static } from "@sinclair/typebox"; +export declare const TemplateSchema: import("@sinclair/typebox").TObject<{ + id: import("@sinclair/typebox").TString; + name: import("@sinclair/typebox").TString; + description: import("@sinclair/typebox").TString; + ownerId: import("@sinclair/typebox").TString; + modelFileKey: import("@sinclair/typebox").TString; + material: import("@sinclair/typebox").TObject<{ + id: import("@sinclair/typebox").TString; + name: import("@sinclair/typebox").TString; + filamentType: import("@sinclair/typebox").TString; + nozzleTempC: import("@sinclair/typebox").TNumber; + bedTempC: import("@sinclair/typebox").TNumber; + densityGCm3: import("@sinclair/typebox").TNumber; + colorHex: import("@sinclair/typebox").TString; + }>; + printParameters: import("@sinclair/typebox").TObject<{ + layerHeightMm: import("@sinclair/typebox").TNumber; + infillPercent: import("@sinclair/typebox").TInteger; + infillPattern: import("@sinclair/typebox").TString; + printSpeedMmS: import("@sinclair/typebox").TNumber; + supportsEnabled: import("@sinclair/typebox").TBoolean; + wallCount: import("@sinclair/typebox").TInteger; + }>; + createdAtUnix: import("@sinclair/typebox").TInteger; + updatedAtUnix: import("@sinclair/typebox").TInteger; + tags: import("@sinclair/typebox").TArray; +}>; +export type Template = Static; diff --git a/packages/ts-types/src/schemas/template.js b/packages/ts-types/src/schemas/template.js new file mode 100644 index 0000000..b0ab2a2 --- /dev/null +++ b/packages/ts-types/src/schemas/template.js @@ -0,0 +1,15 @@ +import { Type } from "@sinclair/typebox"; +import { MaterialProfileSchema } from "./material"; +import { PrintParametersSchema } from "./print-params"; +export const TemplateSchema = Type.Object({ + id: Type.String({ format: "uuid" }), + name: Type.String({ minLength: 1 }), + description: Type.String(), + ownerId: Type.String({ format: "uuid" }), + modelFileKey: Type.String({ minLength: 1 }), + material: MaterialProfileSchema, + printParameters: PrintParametersSchema, + createdAtUnix: Type.Integer(), + updatedAtUnix: Type.Integer(), + tags: Type.Array(Type.String()), +}); diff --git a/schemas/bambulab/schemas.config.json b/schemas/bambulab/schemas.config.json new file mode 100644 index 0000000..b3f8277 --- /dev/null +++ b/schemas/bambulab/schemas.config.json @@ -0,0 +1,52 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "name": "Bambu Lab MQTT Wire Schemas", + "version": "1.0.0", + "description": "JSON Schemas for Bambu Lab 3D Printers (X1/P1/A1 series)", + "default_topics": [ + { + "topic": "device/{{DEVICE_ID}}/report", + "qos": 1, + "color": "#22c55e", + "description": "Printer real-time telemetry report stream" + }, + { + "topic": "device/{{DEVICE_ID}}/request", + "qos": 1, + "color": "#6366f1", + "description": "Control requests sent to printer" + } + ], + "topic_groups": [ + { + "name": "Printer Telemetry (v1)", + "topic_pattern": "device/{{DEVICE_ID}}/report", + "schema": "v1/report.schema.json", + "description": "BambuReport dispatcher for push_status and print state pushes" + }, + { + "name": "Command Requests (v1)", + "topic_pattern": "device/{{DEVICE_ID}}/request", + "schema": "v1/request.schema.json", + "description": "BambuRequest dispatcher for info, pushing, etc." + }, + { + "name": "Printer Telemetry (v2)", + "topic_pattern": "device/{{DEVICE_ID}}/report", + "schema": "v2/report.schema.json", + "description": "BambuReport v2 dispatcher" + }, + { + "name": "Command Requests (v2)", + "topic_pattern": "device/{{DEVICE_ID}}/request", + "schema": "v2/request.schema.json", + "description": "BambuRequest v2 dispatcher" + } + ], + "hidden_schemas": [ + "common/**", + "v1/common/**", + "v2/common/**", + "**/_*.schema.json" + ] +} diff --git a/schemas/bambulab/v1/report.schema.json b/schemas/bambulab/v1/report.schema.json index 16077f1..d357f83 100644 --- a/schemas/bambulab/v1/report.schema.json +++ b/schemas/bambulab/v1/report.schema.json @@ -7,14 +7,59 @@ "minProperties": 1, "maxProperties": 1, "properties": { + "camera": { + "oneOf": [ + { "$ref": "report/camera/ipcam_record_set.schema.json" }, + { "$ref": "report/camera/ipcam_timelapse.schema.json" } + ] + }, "info": { "oneOf": [ { "$ref": "report/info/get_version.schema.json" } ] }, + "mc_print": { + "oneOf": [ + { "$ref": "report/mc_print/push_info.schema.json" } + ] + }, "print": { "oneOf": [ - { "$ref": "report/print/push_status.schema.json" } + { "$ref": "report/print/ams_change_filament.schema.json" }, + { "$ref": "report/print/ams_control.schema.json" }, + { "$ref": "report/print/ams_filament_setting.schema.json" }, + { "$ref": "report/print/ams_get_rfid.schema.json" }, + { "$ref": "report/print/ams_user_setting.schema.json" }, + { "$ref": "report/print/gcode_file.schema.json" }, + { "$ref": "report/print/gcode_line.schema.json" }, + { "$ref": "report/print/pause.schema.json" }, + { "$ref": "report/print/print_option.schema.json" }, + { "$ref": "report/print/print_speed.schema.json" }, + { "$ref": "report/print/project_file.schema.json" }, + { "$ref": "report/print/push_status.schema.json" }, + { "$ref": "report/print/resume.schema.json" }, + { "$ref": "report/print/stop.schema.json" }, + { "$ref": "report/print/unload_filament.schema.json" } + ] + }, + "system": { + "oneOf": [ + { "$ref": "report/system/get_access_code.schema.json" }, + { "$ref": "report/system/ledctrl.schema.json" }, + { "$ref": "report/system/set_accessories.schema.json" } + ] + }, + "upgrade": { + "oneOf": [ + { "$ref": "report/upgrade/consistency_confirm.schema.json" }, + { "$ref": "report/upgrade/get_history.schema.json" }, + { "$ref": "report/upgrade/start.schema.json" }, + { "$ref": "report/upgrade/upgrade_confirm.schema.json" } + ] + }, + "xcam": { + "oneOf": [ + { "$ref": "report/xcam/xcam_control_set.json" } ] } }, diff --git a/schemas/bambulab/v1/report/mc_print/push_info.schema.json b/schemas/bambulab/v1/report/mc_print/push_info.schema.json new file mode 100644 index 0000000..d06de3d --- /dev/null +++ b/schemas/bambulab/v1/report/mc_print/push_info.schema.json @@ -0,0 +1,24 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v1/report/mc_print/push_info.schema.json", + "title": "McPrintPushInfoReport", + "description": "This message can't be requested - it's set automatically by the printer. [LINK] is for logs, [BMC] is for reported pressure advance calculated by lidar and [AMS][TASK] is per-AMS raw humidity", + "allOf": [ + { "$ref": "../../../common/envelope.schema.json" }, + { + "type": "object", + "properties": { + "command": { "const": "push_info" }, + "param": { + "type": "string", + "anyOf": [ + { "pattern": "^\\[LINK\\] ?(?.+)$" }, + { "pattern": "^\\[BMC\\] ?M900 K(?\\d+\\.\\d+), L(?\\d+\\.\\d+), M(?\\d+\\.\\d+)$" }, + { "pattern": "^\\[AMS\\]\\[TASK\\] ?ams(?\\d+) temp:(?\\d+\\.\\d+);humidity:(?\\d+)%;humidity_idx:(?[0-4]+)$" } + ] + } + }, + "required": ["param"] + } + ] +} diff --git a/schemas/bambulab/v1/report/xcam/xcam_control_set.json b/schemas/bambulab/v1/report/xcam/xcam_control_set.json new file mode 100644 index 0000000..76f1837 --- /dev/null +++ b/schemas/bambulab/v1/report/xcam/xcam_control_set.json @@ -0,0 +1,24 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v1/report/system/xcam_control_set.schema.json", + "title": "XcamControlSetReport", + "allOf": [ + { "$ref": "../../../common/envelope.schema.json" }, + { + "type": "object", + "properties": { + "command": { "const": "xcam_control_set" }, + "control": { "type": "boolean" }, + "print_halt": { "type": "boolean" }, + "module_name": { + "type": "string", + "enum": [ + "first_layer_inspector", "buildplate_marker_detector", "printing_monitor", + "pileup_detector", "airprint_detector", "clump_detector", "spaghetti_detector" + ] + } + }, + "required": ["module_name", "control", "print_halt"] + } + ] +} diff --git a/schemas/bambulab/v1/request.schema.json b/schemas/bambulab/v1/request.schema.json index 6517d5b..1757a44 100644 --- a/schemas/bambulab/v1/request.schema.json +++ b/schemas/bambulab/v1/request.schema.json @@ -7,14 +7,55 @@ "minProperties": 1, "maxProperties": 1, "properties": { + "camera": { + "oneOf": [ + { "$ref": "request/camera/ipcam_record_set.schema.json" }, + { "$ref": "request/camera/ipcam_timelapse.schema.json" } + ] + }, "info": { "oneOf": [ { "$ref": "request/info/get_version.schema.json" } ] }, - "pushing": { + "print": { "oneOf": [ - { "$ref": "request/pushing/pushall.schema.json" } + { "$ref": "request/print/ams_change_filament.schema.json" }, + { "$ref": "request/print/ams_control.schema.json" }, + { "$ref": "request/print/ams_filament_setting.schema.json" }, + { "$ref": "request/print/ams_get_rfid.schema.json" }, + { "$ref": "request/print/ams_user_setting.schema.json" }, + { "$ref": "request/print/calibration.schema.json" }, + { "$ref": "request/print/gcode_file.schema.json" }, + { "$ref": "request/print/gcode_line.schema.json" }, + { "$ref": "request/print/pause.schema.json" }, + { "$ref": "request/print/print_option.schema.json" }, + { "$ref": "request/print/print_speed.schema.json" }, + { "$ref": "request/print/project_file.schema.json" }, + { "$ref": "request/print/resume.schema.json" }, + { "$ref": "request/print/skip_objects.schema.json" }, + { "$ref": "request/print/stop.schema.json" }, + { "$ref": "request/print/unload_filament.schema.json" } + ] + }, + "system": { + "oneOf": [ + { "$ref": "request/system/get_access_code.schema.json" }, + { "$ref": "request/system/ledctrl.schema.json" }, + { "$ref": "request/system/set_accessories.schema.json" } + ] + }, + "upgrade": { + "oneOf": [ + { "$ref": "request/upgrade/consistency_confirm.schema.json" }, + { "$ref": "request/upgrade/get_history.schema.json" }, + { "$ref": "request/upgrade/start.schema.json" }, + { "$ref": "request/upgrade/upgrade_confirm.schema.json" } + ] + }, + "xcam": { + "oneOf": [ + { "$ref": "request/xcam/xcam_control_set.json" } ] } }, diff --git a/schemas/bambulab/v1/request/xcam/xcam_control_set.json b/schemas/bambulab/v1/request/xcam/xcam_control_set.json new file mode 100644 index 0000000..8e89005 --- /dev/null +++ b/schemas/bambulab/v1/request/xcam/xcam_control_set.json @@ -0,0 +1,24 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v1/request/system/xcam_control_set.schema.json", + "title": "XcamControlSetRequest", + "allOf": [ + { "$ref": "../../../common/envelope.schema.json" }, + { + "type": "object", + "properties": { + "command": { "const": "xcam_control_set" }, + "control": { "type": "boolean" }, + "print_halt": { "type": "boolean" }, + "module_name": { + "type": "string", + "enum": [ + "first_layer_inspector", "buildplate_marker_detector", "printing_monitor", + "pileup_detector", "airprint_detector", "clump_detector", "spaghetti_detector" + ] + } + }, + "required": ["module_name", "control", "print_halt"] + } + ] +} diff --git a/schemas/bambulab/v2/report.schema.json b/schemas/bambulab/v2/report.schema.json index f1d8968..8b510a0 100644 --- a/schemas/bambulab/v2/report.schema.json +++ b/schemas/bambulab/v2/report.schema.json @@ -7,14 +7,60 @@ "minProperties": 1, "maxProperties": 1, "properties": { + "camera": { + "oneOf": [ + { "$ref": "report/camera/ipcam_record_set.schema.json" }, + { "$ref": "report/camera/ipcam_timelapse.schema.json" } + ] + }, "info": { "oneOf": [ { "$ref": "report/info/get_version.schema.json" } ] }, + "mc_print": { + "oneOf": [ + { "$ref": "report/mc_print/push_info.schema.json" } + ] + }, "print": { "oneOf": [ - { "$ref": "report/print/push_status.schema.json" } + { "$ref": "report/print/ams_change_filament.schema.json" }, + { "$ref": "report/print/ams_control.schema.json" }, + { "$ref": "report/print/ams_filament_setting.schema.json" }, + { "$ref": "report/print/ams_get_rfid.schema.json" }, + { "$ref": "report/print/ams_user_setting.schema.json" }, + { "$ref": "report/print/calibration.schema.json" }, + { "$ref": "report/print/gcode_file.schema.json" }, + { "$ref": "report/print/gcode_line.schema.json" }, + { "$ref": "report/print/pause.schema.json" }, + { "$ref": "report/print/print_option.schema.json" }, + { "$ref": "report/print/print_speed.schema.json" }, + { "$ref": "report/print/project_file.schema.json" }, + { "$ref": "report/print/push_status.schema.json" }, + { "$ref": "report/print/resume.schema.json" }, + { "$ref": "report/print/stop.schema.json" }, + { "$ref": "report/print/unload_filament.schema.json" } + ] + }, + "system": { + "oneOf": [ + { "$ref": "report/system/get_access_code.schema.json" }, + { "$ref": "report/system/ledctrl.schema.json" }, + { "$ref": "report/system/set_accessories.schema.json" } + ] + }, + "upgrade": { + "oneOf": [ + { "$ref": "report/upgrade/consistency_confirm.schema.json" }, + { "$ref": "report/upgrade/get_history.schema.json" }, + { "$ref": "report/upgrade/start.schema.json" }, + { "$ref": "report/upgrade/upgrade_confirm.schema.json" } + ] + }, + "xcam": { + "oneOf": [ + { "$ref": "report/xcam/xcam_control_set.json" } ] } }, diff --git a/schemas/bambulab/v2/report/mc_print/push_info.schema.json b/schemas/bambulab/v2/report/mc_print/push_info.schema.json new file mode 100644 index 0000000..b42f565 --- /dev/null +++ b/schemas/bambulab/v2/report/mc_print/push_info.schema.json @@ -0,0 +1,24 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v2/report/mc_print/push_info.schema.json", + "title": "McPrintPushInfoReport", + "description": "This message can't be requested - it's set automatically by the printer. [LINK] is for logs, [BMC] is for reported pressure advance calculated by lidar and [AMS][TASK] is per-AMS raw humidity", + "allOf": [ + { "$ref": "../../../common/envelope.schema.json" }, + { + "type": "object", + "properties": { + "command": { "const": "push_info" }, + "param": { + "type": "string", + "anyOf": [ + { "pattern": "^\\[LINK\\] ?(?.+)$" }, + { "pattern": "^\\[BMC\\] ?M900 K(?\\d+\\.\\d+), L(?\\d+\\.\\d+), M(?\\d+\\.\\d+)$" }, + { "pattern": "^\\[AMS\\]\\[TASK\\] ?ams(?\\d+) temp:(?\\d+\\.\\d+);humidity:(?\\d+)%;humidity_idx:(?[0-4]+)$" } + ] + } + }, + "required": ["param"] + } + ] +} diff --git a/schemas/bambulab/v2/report/xcam/xcam_control_set.json b/schemas/bambulab/v2/report/xcam/xcam_control_set.json new file mode 100644 index 0000000..05bd49b --- /dev/null +++ b/schemas/bambulab/v2/report/xcam/xcam_control_set.json @@ -0,0 +1,24 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v2/report/system/xcam_control_set.schema.json", + "title": "XcamControlSetReport", + "allOf": [ + { "$ref": "../../../common/envelope.schema.json" }, + { + "type": "object", + "properties": { + "command": { "const": "xcam_control_set" }, + "control": { "type": "boolean" }, + "print_halt": { "type": "boolean" }, + "module_name": { + "type": "string", + "enum": [ + "first_layer_inspector", "buildplate_marker_detector", "printing_monitor", + "pileup_detector", "airprint_detector", "clump_detector", "spaghetti_detector" + ] + } + }, + "required": ["module_name", "control", "print_halt"] + } + ] +} diff --git a/schemas/bambulab/v2/request.schema.json b/schemas/bambulab/v2/request.schema.json index 75e7873..e86f325 100644 --- a/schemas/bambulab/v2/request.schema.json +++ b/schemas/bambulab/v2/request.schema.json @@ -7,10 +7,56 @@ "minProperties": 1, "maxProperties": 1, "properties": { + "camera": { + "oneOf": [ + { "$ref": "request/camera/ipcam_record_set.schema.json" }, + { "$ref": "request/camera/ipcam_timelapse.schema.json" } + ] + }, "info": { "oneOf": [ { "$ref": "request/info/get_version.schema.json" } ] + }, + "print": { + "oneOf": [ + { "$ref": "request/print/ams_change_filament.schema.json" }, + { "$ref": "request/print/ams_control.schema.json" }, + { "$ref": "request/print/ams_filament_setting.schema.json" }, + { "$ref": "request/print/ams_get_rfid.schema.json" }, + { "$ref": "request/print/ams_user_setting.schema.json" }, + { "$ref": "request/print/calibration.schema.json" }, + { "$ref": "request/print/gcode_file.schema.json" }, + { "$ref": "request/print/gcode_line.schema.json" }, + { "$ref": "request/print/pause.schema.json" }, + { "$ref": "request/print/print_option.schema.json" }, + { "$ref": "request/print/print_speed.schema.json" }, + { "$ref": "request/print/project_file.schema.json" }, + { "$ref": "request/print/resume.schema.json" }, + { "$ref": "request/print/skip_objects.schema.json" }, + { "$ref": "request/print/stop.schema.json" }, + { "$ref": "request/print/unload_filament.schema.json" } + ] + }, + "system": { + "oneOf": [ + { "$ref": "request/system/get_access_code.schema.json" }, + { "$ref": "request/system/ledctrl.schema.json" }, + { "$ref": "request/system/set_accessories.schema.json" } + ] + }, + "upgrade": { + "oneOf": [ + { "$ref": "request/upgrade/consistency_confirm.schema.json" }, + { "$ref": "request/upgrade/get_history.schema.json" }, + { "$ref": "request/upgrade/start.schema.json" }, + { "$ref": "request/upgrade/upgrade_confirm.schema.json" } + ] + }, + "xcam": { + "oneOf": [ + { "$ref": "request/xcam/xcam_control_set.json" } + ] } }, "additionalProperties": false diff --git a/schemas/bambulab/v2/request/xcam/xcam_control_set.json b/schemas/bambulab/v2/request/xcam/xcam_control_set.json new file mode 100644 index 0000000..ca9e312 --- /dev/null +++ b/schemas/bambulab/v2/request/xcam/xcam_control_set.json @@ -0,0 +1,24 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://git.octoturge.com/Continuum/continuum-schemas/raw/branch/main/schemas/bambulab/v2/request/system/xcam_control_set.schema.json", + "title": "XcamControlSetRequest", + "allOf": [ + { "$ref": "../../../common/envelope.schema.json" }, + { + "type": "object", + "properties": { + "command": { "const": "xcam_control_set" }, + "control": { "type": "boolean" }, + "print_halt": { "type": "boolean" }, + "module_name": { + "type": "string", + "enum": [ + "first_layer_inspector", "buildplate_marker_detector", "printing_monitor", + "pileup_detector", "airprint_detector", "clump_detector", "spaghetti_detector" + ] + } + }, + "required": ["module_name", "control", "print_halt"] + } + ] +} diff --git a/tsconfig.json b/tsconfig.json index 07f894f..00d2583 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,5 +11,6 @@ "skipLibCheck": true, "forceConsistentCasingInFileNames": true, "resolveJsonModule": true - } + }, + "exclude": ["examples", "node_modules"] }