diff --git a/openapi/machine-api.json b/openapi/machine-api.json index 8d8208923..0daaf887b 100644 --- a/openapi/machine-api.json +++ b/openapi/machine-api.json @@ -188,6 +188,67 @@ } ] }, + "LiveView": { + "description": "A liveview message.", + "oneOf": [ + { + "additionalProperties": true, + "description": "Initialize the live view.", + "properties": { + "command": { + "enum": [ + "init" + ], + "type": "string" + }, + "op_protocols": { + "description": "The op protocols.", + "items": { + "$ref": "#/components/schemas/OperationProtocol" + }, + "type": "array" + }, + "peer_host": { + "description": "The peer host.", + "type": "string" + }, + "reason": { + "allOf": [ + { + "$ref": "#/components/schemas/Reason" + } + ], + "description": "The reason for the message.", + "nullable": true + }, + "result": { + "allOf": [ + { + "$ref": "#/components/schemas/Result" + } + ], + "description": "The result of the command." + }, + "sequence_id": { + "allOf": [ + { + "$ref": "#/components/schemas/SequenceId" + } + ], + "description": "The sequence id." + } + }, + "required": [ + "command", + "op_protocols", + "peer_host", + "result", + "sequence_id" + ], + "type": "object" + } + ] + }, "Machine": { "description": "Details for a 3d printer connected over USB.", "oneOf": [ @@ -383,6 +444,32 @@ ], "type": "object" }, + { + "additionalProperties": false, + "description": "A security message.", + "properties": { + "security": { + "$ref": "#/components/schemas/Security" + } + }, + "required": [ + "security" + ], + "type": "object" + }, + { + "additionalProperties": false, + "description": "A liveview message.", + "properties": { + "live_view": { + "$ref": "#/components/schemas/LiveView" + } + }, + "required": [ + "live_view" + ], + "type": "object" + }, { "additionalProperties": false, "description": "An unknown Json message.", @@ -448,6 +535,25 @@ } ] }, + "OperationProtocol": { + "additionalProperties": true, + "description": "An operation protocol.", + "properties": { + "protocol": { + "description": "The protocol.", + "type": "string" + }, + "version": { + "description": "The version.", + "type": "string" + } + }, + "required": [ + "protocol", + "version" + ], + "type": "object" + }, "Pong": { "description": "The response from the `/ping` endpoint.", "properties": { @@ -512,6 +618,55 @@ ], "type": "object" }, + { + "additionalProperties": true, + "description": "Calibration.", + "properties": { + "command": { + "enum": [ + "calibration" + ], + "type": "string" + }, + "option": { + "description": "The option.", + "format": "int64", + "type": "integer" + }, + "reason": { + "allOf": [ + { + "$ref": "#/components/schemas/Reason" + } + ], + "description": "The reason for the message.", + "nullable": true + }, + "result": { + "allOf": [ + { + "$ref": "#/components/schemas/Result" + } + ], + "description": "The result of the command." + }, + "sequence_id": { + "allOf": [ + { + "$ref": "#/components/schemas/SequenceId" + } + ], + "description": "The sequence id." + } + }, + "required": [ + "command", + "option", + "result", + "sequence_id" + ], + "type": "object" + }, { "additionalProperties": true, "description": "The status of the print.", @@ -1610,6 +1765,83 @@ } ] }, + "Security": { + "description": "A security message.", + "oneOf": [ + { + "additionalProperties": true, + "description": "Get the serial number.", + "properties": { + "address": { + "description": "The address.", + "format": "int64", + "type": "integer" + }, + "chip_sn": { + "description": "The chip sn.", + "type": "string" + }, + "chipsn_len": { + "description": "The chip sn length.", + "format": "int64", + "type": "integer" + }, + "command": { + "enum": [ + "get_sn" + ], + "type": "string" + }, + "length": { + "description": "The length.", + "format": "int64", + "type": "integer" + }, + "module": { + "description": "The module.", + "type": "string" + }, + "reason": { + "allOf": [ + { + "$ref": "#/components/schemas/Reason" + } + ], + "description": "The reason for the message.", + "nullable": true + }, + "sequence_id": { + "allOf": [ + { + "$ref": "#/components/schemas/SequenceId" + } + ], + "description": "The sequence id." + }, + "sn": { + "description": "The serial number.", + "type": "string" + }, + "status": { + "description": "The status.", + "type": "string" + } + }, + "required": [ + "address", + "chip_sn", + "chipsn_len", + "command", + "length", + "module", + "sequence_id", + "sn", + "status" + ], + "type": "object" + } + ] + }, "SequenceId": { "anyOf": [ { diff --git a/src/lib/machine-api.d.ts b/src/lib/machine-api.d.ts index 6d26e238f..e5e4cb54d 100644 --- a/src/lib/machine-api.d.ts +++ b/src/lib/machine-api.d.ts @@ -137,6 +137,23 @@ export interface components { LedMode: 'on' | 'off' | 'flashing' /** @description The node for the led. */ LedNode: 'chamber_light' | 'work_light' + /** @description A liveview message. */ + LiveView: { + /** @enum {string} */ + command: 'init' + /** @description The op protocols. */ + op_protocols: components['schemas']['OperationProtocol'][] + /** @description The peer host. */ + peer_host: string + /** @description The reason for the message. */ + reason?: components['schemas']['Reason'] | null + /** @description The result of the command. */ + result: components['schemas']['Result'] + /** @description The sequence id. */ + sequence_id: components['schemas']['SequenceId'] + } & { + [key: string]: unknown + } /** @description Details for a 3d printer connected over USB. */ Machine: | { @@ -201,6 +218,12 @@ export interface components { | { system: components['schemas']['System'] } + | { + security: components['schemas']['Security'] + } + | { + live_view: components['schemas']['LiveView'] + } | { json: unknown } @@ -211,6 +234,15 @@ export interface components { NetworkPrinterManufacturer: 'Bambu' | 'Formlabs' /** @description A nozzle type. */ NozzleType: 'hardened_steel' | 'stainless_steel' + /** @description An operation protocol. */ + OperationProtocol: { + /** @description The protocol. */ + protocol: string + /** @description The version. */ + version: string + } & { + [key: string]: unknown + } /** @description The response from the `/ping` endpoint. */ Pong: { /** @description The pong response. */ @@ -232,6 +264,23 @@ export interface components { } & { [key: string]: unknown }) + | ({ + /** @enum {string} */ + command: 'calibration' + /** + * Format: int64 + * @description The option. + */ + option: number + /** @description The reason for the message. */ + reason?: components['schemas']['Reason'] | null + /** @description The result of the command. */ + result: components['schemas']['Result'] + /** @description The sequence id. */ + sequence_id: components['schemas']['SequenceId'] + } & { + [key: string]: unknown + }) | ({ /** @description The ams. */ ams?: components['schemas']['PrintAms'] | null @@ -721,6 +770,40 @@ export interface components { } /** @description The result of a message. */ Result: 'SUCCESS' | 'FAIL' + /** @description A security message. */ + Security: { + /** + * Format: int64 + * @description The address. + */ + address: number + /** @description The chip sn. */ + chip_sn: string + /** + * Format: int64 + * @description The chip sn length. + */ + chipsn_len: number + /** @enum {string} */ + command: 'get_sn' + /** + * Format: int64 + * @description The length. + */ + length: number + /** @description The module. */ + module: string + /** @description The reason for the message. */ + reason?: components['schemas']['Reason'] | null + /** @description The sequence id. */ + sequence_id: components['schemas']['SequenceId'] + /** @description The serial number. */ + sn: string + /** @description The status. */ + status: string + } & { + [key: string]: unknown + } /** @description The sequence id type. */ SequenceId: string | number /** @description A system command. */