Skip to content

API Data Types and Models

This page documents all model and type definitions used by the Wizard REST backend.

  • Model groups: 3
  • Literal aliases: 3
  • TypedDict models: 1
  • Pydantic models: 25
  • SQLAlchemy models: 18

Model Groups

  • Command Payload Models
  • Core API Models
  • Database Models

Literal Aliases

Direction

  • Group: Core API Models
  • Definition: Literal['INPUT', 'OUTPUT']
  • Values: INPUT, OUTPUT

PortState

  • Group: Core API Models
  • Definition: Literal['OPEN', 'CLOSED', 'UNSET', 'UNKNOWN']
  • Values: OPEN, CLOSED, UNSET, UNKNOWN

Protocol

  • Group: Core API Models
  • Definition: Literal['tcp', 'udp']
  • Values: tcp, udp

TypedDict Models

AllowedPortCfg

  • Group: Core API Models
  • Description: Static firewall port configuration entry.
  • Fields:
  • purpose (str)
  • protocol (Protocol)
  • direction (Direction)

Pydantic Models

BoolValuePayload

  • Group: Command Payload Models
  • Description: Request body for boolean-based command endpoints.
  • Fields:
  • value (bool) (default: Field(..., description='Boolean payload value.'))

CoordinatesValuePayload

  • Group: Command Payload Models
  • Description: Request body for coordinates-based command endpoints.
  • Fields:
  • value (Coordinates) (default: Field(..., description='Coordinates payload value.'))

DictValuePayload

  • Group: Command Payload Models
  • Description: Request body for dictionary-based command endpoints.
  • Fields:
  • value (dict[str, Any]) (default: Field(..., description='Dictionary payload value.'))

FloatValuePayload

  • Group: Command Payload Models
  • Description: Request body for float-based command endpoints.
  • Fields:
  • value (float) (default: Field(..., description='Float payload value.'))

IntValuePayload

  • Group: Command Payload Models
  • Description: Request body for integer-based command endpoints.
  • Fields:
  • value (int) (default: Field(..., description='Integer payload value.'))

ListValuePayload

  • Group: Command Payload Models
  • Description: Request body for list-based command endpoints.
  • Fields:
  • value (list[Any]) (default: Field(..., description='List payload value.'))

StrValuePayload

  • Group: Command Payload Models
  • Description: Request body for string-based command endpoints.
  • Fields:
  • value (str) (default: Field(..., description='String payload value.'))

BoolCommand

  • Group: Core API Models
  • Description: Represents a command associated with a Boolean value.
  • Fields:
  • command (str)
  • value (bool)

Coordinates

  • Group: Core API Models
  • Description: Represent 3D spatial coordinates with orientation.
  • Fields:
  • x (float) (default: 0.0)
  • y (float) (default: 0.0)
  • z (float) (default: 0.0)
  • theta (float) (default: 0.0)

CoordinatesCommand

  • Group: Core API Models
  • Description: Encapsulates a command with associated coordinate data.
  • Fields:
  • command (str)
  • value (Coordinates)

DictCommand

  • Group: Core API Models
  • Description: Models a command that involves dictionary data.
  • Fields:
  • command (str)
  • value (dict)

FirewallPortEntry

  • Group: Core API Models
  • Description: Firewall port state exposed by the REST API.
  • Fields:
  • port (int) (default: Field(..., ge=1, le=65535))
  • purpose (str)
  • protocol (Protocol)
  • direction (Direction)
  • state (PortState)

FloatCommand

  • Group: Core API Models
  • Description: Defines a command that includes a floating-point number.
  • Fields:
  • command (str)
  • value (float)

IntCommand

  • Group: Core API Models
  • Description: Encapsulates a command that requires an integer value.
  • Fields:
  • command (str)
  • value (int)

ListCommand

  • Group: Core API Models
  • Description: Describes a command that involves a list of values.
  • Fields:
  • command (str)
  • value (list)

NoArgCommand

  • Group: Core API Models
  • Description: Represents a command with no arguments.
  • Fields:
  • command (str)

SSHKeyCreate

  • Group: Core API Models
  • Description: Model for adding a new SSH public key.
  • Fields:
  • public_key (constr(strip_whitespace=True, min_length=1)) (default: Field(..., description="SSH public key in authorized_keys format (for example: 'ssh-rsa AAAAB3N... user@host')."))

SSHKeyEntry

  • Group: Core API Models
  • Description: Representation of a single SSH key entry.
  • Fields:
  • id (int) (default: Field(..., description='Index of the key as reported by ssh-auth-keys list.'))
  • name (str) (default: Field(..., description='Human-readable name associated with the key.'))
  • created_at (datetime | None) (default: Field(None, description="Datetime when the key was registered, parsed from ssh-auth-keys output. Can be null if the date is reported as 'unknown'."))
  • fingerprint (str) (default: Field(..., description='Key hash or fingerprint as reported by ssh-auth-keys list.'))

StrCommand

  • Group: Core API Models
  • Description: Represents a command that involves a string value.
  • Fields:
  • command (str)
  • value (str)

WiFiConfig

  • Group: Core API Models
  • Description: Represents WiFi configuration details for the API.
  • Fields:
  • ssid (str) (default: Field(..., min_length=1, max_length=32))
  • password (str | None) (default: Field(None))
  • is_hidden (bool) (default: Field(False))
  • eap_method (Literal['PEAP', 'TTLS', 'FAST', 'PWD'] | None) (default: None)
  • phase2 (Literal['MSCHAPV2', 'GTC', 'PAP', 'CHAP', 'EAP'] | None) (default: None)
  • identity (str | None) (default: None)
  • anonymous_identity (str | None) (default: None)
  • ca_cert (str | None) (default: None)
  • client_cert (str | None) (default: None)
  • private_key (str | None) (default: None)
  • private_key_password (str | None) (default: None)
  • subject_match (str | None) (default: None)
  • domain_suffix_match (str | None) (default: None)
  • security (str | None) (default: None)

ButtonAction

  • Group: Database Models
  • Description: Gamepad button mapping payload.
  • Fields:
  • touch (constr(strip_whitespace=True, min_length=1))
  • simpleClick (list[str])
  • doubleClick (list[str])

DatabaseItem

  • Group: Database Models
  • Description: Generic payload containing a table name and item dictionary.
  • Fields:
  • tablename (str)
  • item (dict)

GamepadConfigModel

  • Group: Database Models
  • Description: REST payload model used to update gamepad configuration entries.
  • Fields:
  • id (int)
  • name (constr(strip_whitespace=True, min_length=1))
  • prompt_name (str)
  • config (list[ButtonAction])

LoadDatabase

  • Group: Database Models
  • Description: Pydantic model to load the database with a path and tablename.
  • Fields:
  • path (str) (default: '')
  • tablename (str) (default: '')

UpdateRequest

  • Group: Database Models
  • Description: Generic update payload for one attribute in a table item.
  • Fields:
  • tablename (str)
  • item (dict)
  • attribute (str)
  • new_value (Any)

SQLAlchemy Models

Action (abstract)

  • Group: Database Models
  • Description: Abstract SQLAlchemy model for actions.
  • Abstract: true
  • Columns:
  • id (Integer) (primary_key=True)
  • name (String)
  • favorite (Boolean)
  • type (String)

Animation (abstract)

  • Group: Database Models
  • Description: Abstract SQLAlchemy model for animations.
  • Abstract: true
  • Columns:
  • id (Integer) (primary_key=True)
  • image (String)
  • video (String)

Animation (animations_table)

  • Group: Database Models
  • Description: SQLAlchemy model for the 'animations_table'.
  • Table: animations_table
  • Columns:
  • command_value (String)
  • subcategory_id (Integer)
  • robot_id (Integer)
  • Relationships:
  • subcategory -> 'SubCategory'
  • robot -> 'Robot'

Category (categories_table)

  • Group: Database Models
  • Description: SQLAlchemy model for the 'categories_table'.
  • Table: categories_table
  • Columns:
  • id (Integer) (primary_key=True)
  • name (String)
  • logo (String)
  • Relationships:
  • sub_categories -> 'SubCategory'

CustomizedLLM (customized_prompts_table)

  • Group: Database Models
  • Description: SQLAlchemy model for the 'customized_prompts_table'.
  • Table: customized_prompts_table
  • Columns:
  • id (Integer) (primary_key=True)
  • name (String)
  • prompt (String)
  • selected (Boolean)
  • order (Integer)

GamepadConfig (gamepad_config_table)

  • Group: Database Models
  • Description: SQLAlchemy model for the 'gamepad_config_table'.
  • Table: gamepad_config_table
  • Columns:
  • id (Integer) (primary_key=True)
  • name (String) (nullable=False)
  • value (String) (nullable=False)
  • prompt_name (String) (nullable=False)
  • config (JSON) (nullable=True)

Grasping (grasping_table)

  • Group: Database Models
  • Description: SQLAlchemy model for the 'grasping_table'.
  • Table: grasping_table
  • Columns:
  • command_value (String)
  • rune (String)
  • function (String)
  • access_level (String)
  • couple_id (Integer)
  • subcategory_id (Integer)
  • Relationships:
  • subcategory -> 'SubCategory'

KnownLocation (known_locations_table)

  • Group: Database Models
  • Description: SQLAlchemy model for the 'known_locations_table'.
  • Table: known_locations_table
  • Columns:
  • id (String) (primary_key=True)
  • color (String) (nullable=False, default='#2196f3')

KnownRune (known_runes_table)

  • Group: Database Models
  • Description: SQLAlchemy model for the 'known_runes_table'.
  • Table: known_runes_table
  • Columns:
  • id (String) (primary_key=True)
  • virtual_id (String)
  • label (String)
  • description (String)
  • class_ (String)

KnownSequenceRoute (routes_table)

  • Group: Database Models
  • Description: SQLAlchemy model for the 'routes_table'.
  • Table: routes_table
  • Columns:
  • id (String) (primary_key=True)
  • color (String) (nullable=False, default='#9c27b0')
  • visible (Boolean) (nullable=False, default=True)
  • Group: Database Models
  • Description: SQLAlchemy model for the 'navigation_table'.
  • Table: navigation_table
  • Columns:
  • command_value (String)
  • rune (String)
  • subcategory_id (Integer)
  • Relationships:
  • subcategory -> 'SubCategory'

Robot (robots_table)

  • Group: Database Models
  • Description: SQLAlchemy model for the 'robots_table'.
  • Table: robots_table
  • Columns:
  • id (Integer) (primary_key=True)
  • name (String)
  • body_image (String)
  • head_image (String)
  • color (String)
  • Relationships:
  • tts -> 'TextToSpeech'
  • animations -> 'Animation'

RobotConfig (robot_configuration_table)

  • Group: Database Models
  • Description: SQLAlchemy model for the robot_configuration_table.
  • Table: robot_configuration_table
  • Columns:
  • id (String(64)) (primary_key=True)
  • value (JSON) (nullable=True)

Rune (runes_table)

  • Group: Database Models
  • Description: SQLAlchemy model for the 'runes_table'.
  • Table: runes_table
  • Columns:
  • id (Integer) (primary_key=True)
  • name (String)
  • command_name (String)
  • simple_click (String) (default='Nothing.')
  • double_click (String) (default='Nothing.')
  • long_press (String) (default='Nothing.')
  • access_level (String)
  • subcategory_id (Integer)
  • Relationships:
  • subcategory -> 'SubCategory'

Skill (skills_table)

  • Group: Database Models
  • Description: SQLAlchemy model for the 'skills_table'.
  • Table: skills_table
  • Columns:
  • swapable (Boolean)
  • value (JSON) (nullable=False)
  • side (String)
  • description (JSON) (nullable=False)
  • access_level (String)
  • subcategory_id (Integer)
  • Relationships:
  • subcategory -> 'SubCategory'

SubCategory (subcategories_table)

  • Group: Database Models
  • Description: SQLAlchemy model for the 'subcategories_table'.
  • Table: subcategories_table
  • Columns:
  • id (Integer) (primary_key=True)
  • name (String)
  • logo (String)
  • category_id (Integer)
  • local (Boolean) (default=False)
  • Relationships:
  • category -> 'Category'
  • rel_tts -> 'TextToSpeech'
  • rel_skills -> 'Skill'
  • rel_animations -> 'Animation'
  • rel_navigation -> 'Navigation'
  • rel_grasping -> 'Grasping'
  • rel_rune -> 'Rune'

TextToSpeech (tts_table)

  • Group: Database Models
  • Description: SQLAlchemy model for the 'tts_table'.
  • Table: tts_table
  • Columns:
  • name (JSON) (nullable=False, default={})
  • sentences (JSON) (nullable=False, default={})
  • local (Boolean) (default=False)
  • favorite (Boolean) (default=False)
  • robot_id (Integer)
  • subcategory_id (Integer)
  • Relationships:
  • robot -> 'Robot'
  • subcategory -> 'SubCategory'