Update api spec (#362)

* YOYO NEW API SPEC!

* I have generated the latest API!

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
zoo-github-actions-auth[bot]
2025-01-27 13:13:12 -08:00
committed by GitHub
parent 525456428a
commit cf7e20536c
12 changed files with 931 additions and 637 deletions

File diff suppressed because it is too large Load Diff

View File

@ -47,6 +47,7 @@ from .cluster import Cluster
from .code_language import CodeLanguage
from .code_output import CodeOutput
from .color import Color
from .component_transform import ComponentTransform
from .connection import Connection
from .country_code import CountryCode
from .coupon import Coupon
@ -100,6 +101,7 @@ from .entity_get_sketch_paths import EntityGetSketchPaths
from .entity_linear_pattern import EntityLinearPattern
from .entity_linear_pattern_transform import EntityLinearPatternTransform
from .entity_make_helix import EntityMakeHelix
from .entity_make_helix_from_edge import EntityMakeHelixFromEdge
from .entity_make_helix_from_params import EntityMakeHelixFromParams
from .entity_mirror import EntityMirror
from .entity_mirror_across_edge import EntityMirrorAcrossEdge
@ -268,6 +270,7 @@ from .session_uuid import SessionUuid
from .set_background_color import SetBackgroundColor
from .set_current_tool_properties import SetCurrentToolProperties
from .set_default_system_properties import SetDefaultSystemProperties
from .set_object_transform import SetObjectTransform
from .set_scene_units import SetSceneUnits
from .set_selection_filter import SetSelectionFilter
from .set_selection_type import SetSelectionType
@ -310,6 +313,8 @@ from .text_to_cad_model import TextToCadModel
from .text_to_cad_results_page import TextToCadResultsPage
from .token_revoke_request_form import TokenRevokeRequestForm
from .transform import Transform
from .transform_by_for_point3d import TransformByForPoint3d
from .transform_by_for_point4d import TransformByForPoint4d
from .unit_angle import UnitAngle
from .unit_angle_conversion import UnitAngleConversion
from .unit_area import UnitArea

View File

@ -0,0 +1,20 @@
from typing import Optional
from pydantic import BaseModel, ConfigDict
from ..models.transform_by_for_point3d import TransformByForPoint3d
from ..models.transform_by_for_point4d import TransformByForPoint4d
class ComponentTransform(BaseModel):
"""Container that holds a translate, rotate and scale."""
rotate_angle_axis: Optional[TransformByForPoint4d] = None
rotate_rpy: Optional[TransformByForPoint3d] = None
scale: Optional[TransformByForPoint3d] = None
translate: Optional[TransformByForPoint3d] = None
model_config = ConfigDict(protected_namespaces=())

View File

@ -4,6 +4,4 @@ from pydantic import BaseModel, ConfigDict
class EntityMakeHelix(BaseModel):
"""The response from the `EntityMakeHelix` endpoint."""
helix_id: str
model_config = ConfigDict(protected_namespaces=())

View File

@ -0,0 +1,7 @@
from pydantic import BaseModel, ConfigDict
class EntityMakeHelixFromEdge(BaseModel):
"""The response from the `EntityMakeHelixFromEdge` endpoint."""
model_config = ConfigDict(protected_namespaces=())

View File

@ -4,6 +4,4 @@ from pydantic import BaseModel, ConfigDict
class EntityMakeHelixFromParams(BaseModel):
"""The response from the `EntityMakeHelixFromParams` endpoint."""
helix_id: str
model_config = ConfigDict(protected_namespaces=())

View File

@ -9,6 +9,7 @@ from ..models.annotation_type import AnnotationType
from ..models.camera_drag_interaction_type import CameraDragInteractionType
from ..models.camera_movement import CameraMovement
from ..models.color import Color
from ..models.component_transform import ComponentTransform
from ..models.cut_type import CutType
from ..models.distance_type import DistanceType
from ..models.entity_type import EntityType
@ -442,7 +443,7 @@ class OptionEntityMakeHelixFromParams(BaseModel):
length: LengthUnit
radius: float
radius: LengthUnit
revolutions: float
@ -453,6 +454,26 @@ class OptionEntityMakeHelixFromParams(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class OptionEntityMakeHelixFromEdge(BaseModel):
"""Create a helix using the specified parameters."""
edge_id: str
is_clockwise: bool
length: Optional[LengthUnit] = None
radius: LengthUnit
revolutions: float
start_angle: Angle = {"unit": "degrees", "value": 0.0} # type: ignore
type: Literal["entity_make_helix_from_edge"] = "entity_make_helix_from_edge"
model_config = ConfigDict(protected_namespaces=())
class OptionEntityMirror(BaseModel):
"""Mirror the input entities over the specified axis. (Currently only supports sketches)"""
@ -1387,6 +1408,18 @@ class OptionGetNumObjects(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class OptionSetObjectTransform(BaseModel):
"""Set the transform of an object."""
object_id: str
transforms: List[ComponentTransform]
type: Literal["set_object_transform"] = "set_object_transform"
model_config = ConfigDict(protected_namespaces=())
class OptionMakeOffsetPath(BaseModel):
"""Make a new path by offsetting an object by a given distance. The new path's ID will be the ID of this command."""
@ -1446,6 +1479,7 @@ ModelingCmd = RootModel[
OptionEntityCircularPattern,
OptionEntityMakeHelix,
OptionEntityMakeHelixFromParams,
OptionEntityMakeHelixFromEdge,
OptionEntityMirror,
OptionEntityMirrorAcrossEdge,
OptionSelectWithPoint,
@ -1527,6 +1561,7 @@ ModelingCmd = RootModel[
OptionSelectClear,
OptionSelectGet,
OptionGetNumObjects,
OptionSetObjectTransform,
OptionMakeOffsetPath,
OptionAddHoleFromOffset,
],

View File

@ -41,6 +41,7 @@ from ..models.entity_get_sketch_paths import EntityGetSketchPaths
from ..models.entity_linear_pattern import EntityLinearPattern
from ..models.entity_linear_pattern_transform import EntityLinearPatternTransform
from ..models.entity_make_helix import EntityMakeHelix
from ..models.entity_make_helix_from_edge import EntityMakeHelixFromEdge
from ..models.entity_make_helix_from_params import EntityMakeHelixFromParams
from ..models.entity_mirror import EntityMirror
from ..models.entity_mirror_across_edge import EntityMirrorAcrossEdge
@ -98,6 +99,7 @@ from ..models.send_object import SendObject
from ..models.set_background_color import SetBackgroundColor
from ..models.set_current_tool_properties import SetCurrentToolProperties
from ..models.set_default_system_properties import SetDefaultSystemProperties
from ..models.set_object_transform import SetObjectTransform
from ..models.set_scene_units import SetSceneUnits
from ..models.set_selection_filter import SetSelectionFilter
from ..models.set_selection_type import SetSelectionType
@ -855,6 +857,16 @@ class OptionMakeOffsetPath(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class OptionSetObjectTransform(BaseModel):
""""""
data: SetObjectTransform
type: Literal["set_object_transform"] = "set_object_transform"
model_config = ConfigDict(protected_namespaces=())
class OptionAddHoleFromOffset(BaseModel):
""""""
@ -1277,6 +1289,16 @@ class OptionEntityMakeHelixFromParams(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class OptionEntityMakeHelixFromEdge(BaseModel):
""""""
data: EntityMakeHelixFromEdge
type: Literal["entity_make_helix_from_edge"] = "entity_make_helix_from_edge"
model_config = ConfigDict(protected_namespaces=())
class OptionSolid3DGetExtrusionFaceInfo(BaseModel):
""""""
@ -1373,6 +1395,7 @@ OkModelingCmdResponse = RootModel[
OptionViewIsometric,
OptionGetNumObjects,
OptionMakeOffsetPath,
OptionSetObjectTransform,
OptionAddHoleFromOffset,
OptionDefaultCameraFocusOn,
OptionSelectGet,
@ -1415,6 +1438,7 @@ OkModelingCmdResponse = RootModel[
OptionEntityMirrorAcrossEdge,
OptionEntityMakeHelix,
OptionEntityMakeHelixFromParams,
OptionEntityMakeHelixFromEdge,
OptionSolid3DGetExtrusionFaceInfo,
OptionExtrusionFaceInfo,
],

View File

@ -0,0 +1,7 @@
from pydantic import BaseModel, ConfigDict
class SetObjectTransform(BaseModel):
"""The response from the `SetObjectTransform` command."""
model_config = ConfigDict(protected_namespaces=())

View File

@ -0,0 +1,17 @@
from typing import Any
from pydantic import GetCoreSchemaHandler
from pydantic_core import CoreSchema, core_schema
class TransformByForPoint3d(str):
""""""
def __str__(self) -> str:
return self
@classmethod
def __get_pydantic_core_schema__(
cls, source_type: Any, handler: GetCoreSchemaHandler
) -> CoreSchema:
return core_schema.no_info_after_validator_function(cls, handler(str))

View File

@ -0,0 +1,17 @@
from typing import Any
from pydantic import GetCoreSchemaHandler
from pydantic_core import CoreSchema, core_schema
class TransformByForPoint4d(str):
""""""
def __str__(self) -> str:
return self
@classmethod
def __get_pydantic_core_schema__(
cls, source_type: Any, handler: GetCoreSchemaHandler
) -> CoreSchema:
return core_schema.no_info_after_validator_function(cls, handler(str))

214
spec.json
View File

@ -1279,7 +1279,7 @@
"tags": [
"hidden"
],
"summary": "Listen for callbacks for email verification for users.",
"summary": "Listen for callbacks for email authentication for users.",
"operationId": "auth_email_callback",
"parameters": [
{
@ -17100,6 +17100,48 @@
"r"
]
},
"ComponentTransform": {
"description": "Container that holds a translate, rotate and scale.",
"type": "object",
"properties": {
"rotate_angle_axis": {
"nullable": true,
"description": "Rotate component of the transform. The rotation is specified as an axis and an angle (xyz are the components of the axis, w is the angle in degrees).",
"allOf": [
{
"$ref": "#/components/schemas/TransformByForPoint4d"
}
]
},
"rotate_rpy": {
"nullable": true,
"description": "Rotate component of the transform. The rotation is specified as a roll, pitch, yaw.",
"allOf": [
{
"$ref": "#/components/schemas/TransformByForPoint3d"
}
]
},
"scale": {
"nullable": true,
"description": "Scale component of the transform.",
"allOf": [
{
"$ref": "#/components/schemas/TransformByForPoint3d"
}
]
},
"translate": {
"nullable": true,
"description": "Translate component of the transform.",
"allOf": [
{
"$ref": "#/components/schemas/TransformByForPoint3d"
}
]
}
}
},
"Connection": {
"description": "Metadata about a pub-sub connection.\n\nThis is mostly used for internal purposes and debugging.",
"type": "object",
@ -18351,31 +18393,15 @@
},
"EntityMakeHelix": {
"description": "The response from the `EntityMakeHelix` endpoint.",
"type": "object",
"properties": {
"helix_id": {
"description": "The UUID of the helix that was created.",
"type": "string",
"format": "uuid"
}
"type": "object"
},
"required": [
"helix_id"
]
"EntityMakeHelixFromEdge": {
"description": "The response from the `EntityMakeHelixFromEdge` endpoint.",
"type": "object"
},
"EntityMakeHelixFromParams": {
"description": "The response from the `EntityMakeHelixFromParams` endpoint.",
"type": "object",
"properties": {
"helix_id": {
"description": "The UUID of the helix that was created.",
"type": "string",
"format": "uuid"
}
},
"required": [
"helix_id"
]
"type": "object"
},
"EntityMirror": {
"description": "The response from the `EntityMirror` endpoint.",
@ -22694,8 +22720,11 @@
},
"radius": {
"description": "Radius of the helix.",
"type": "number",
"format": "double"
"allOf": [
{
"$ref": "#/components/schemas/LengthUnit"
}
]
},
"revolutions": {
"description": "Number of revolutions.",
@ -22731,6 +22760,68 @@
"type"
]
},
{
"description": "Create a helix using the specified parameters.",
"type": "object",
"properties": {
"edge_id": {
"description": "Edge about which to make the helix.",
"type": "string",
"format": "uuid"
},
"is_clockwise": {
"description": "Is the helix rotation clockwise?",
"type": "boolean"
},
"length": {
"nullable": true,
"description": "Length of the helix. If None, the length of the edge will be used instead.",
"allOf": [
{
"$ref": "#/components/schemas/LengthUnit"
}
]
},
"radius": {
"description": "Radius of the helix.",
"allOf": [
{
"$ref": "#/components/schemas/LengthUnit"
}
]
},
"revolutions": {
"description": "Number of revolutions.",
"type": "number",
"format": "double"
},
"start_angle": {
"description": "Start angle.",
"default": {
"unit": "degrees",
"value": 0.0
},
"allOf": [
{
"$ref": "#/components/schemas/Angle"
}
]
},
"type": {
"type": "string",
"enum": [
"entity_make_helix_from_edge"
]
}
},
"required": [
"edge_id",
"is_clockwise",
"radius",
"revolutions",
"type"
]
},
{
"description": "Mirror the input entities over the specified axis. (Currently only supports sketches)",
"type": "object",
@ -24980,6 +25071,35 @@
"type"
]
},
{
"description": "Set the transform of an object.",
"type": "object",
"properties": {
"object_id": {
"description": "Id of the object whose transform is to be set.",
"type": "string",
"format": "uuid"
},
"transforms": {
"description": "List of transforms to be applied to the object.",
"type": "array",
"items": {
"$ref": "#/components/schemas/ComponentTransform"
}
},
"type": {
"type": "string",
"enum": [
"set_object_transform"
]
}
},
"required": [
"object_id",
"transforms",
"type"
]
},
{
"description": "Make a new path by offsetting an object by a given distance. The new path's ID will be the ID of this command.",
"type": "object",
@ -26487,6 +26607,24 @@
"type"
]
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/SetObjectTransform"
},
"type": {
"type": "string",
"enum": [
"set_object_transform"
]
}
},
"required": [
"data",
"type"
]
},
{
"type": "object",
"properties": {
@ -27243,6 +27381,24 @@
"type"
]
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EntityMakeHelixFromEdge"
},
"type": {
"type": "string",
"enum": [
"entity_make_helix_from_edge"
]
}
},
"required": [
"data",
"type"
]
},
{
"type": "object",
"properties": {
@ -29470,6 +29626,10 @@
"description": "The response from the `SetDefaultSystemProperties` endpoint.",
"type": "object"
},
"SetObjectTransform": {
"description": "The response from the `SetObjectTransform` command.",
"type": "object"
},
"SetSceneUnits": {
"description": "The response from the `SetSceneUnits` endpoint.",
"type": "object"
@ -30520,6 +30680,12 @@
}
}
},
"TransformByForPoint3d": {
"type": "string"
},
"TransformByForPoint4d": {
"type": "string"
},
"UnitAngle": {
"description": "The valid types of angle formats.",
"oneOf": [