Update api spec (#439)

* 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-05-15 14:47:53 -07:00
committed by GitHub
parent ed50b95b1e
commit 243ae12ed3
14 changed files with 1189 additions and 1018 deletions

File diff suppressed because it is too large Load Diff

View File

@ -3,12 +3,14 @@ from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.code_option import CodeOption
from ...models.error import Error
from ...models.kcl_model import KclModel
from ...types import Response
def _get_kwargs(
code_option: CodeOption,
*,
client: Client,
) -> Dict[str, Any]:
@ -16,6 +18,12 @@ def _get_kwargs(
client.base_url,
) # noqa: E501
if code_option is not None:
if "?" in url:
url = url + "&code_option=" + str(code_option)
else:
url = url + "?code_option=" + str(code_option)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
@ -52,10 +60,12 @@ def _build_response(
def sync_detailed(
code_option: CodeOption,
*,
client: Client,
) -> Response[Optional[Union[KclModel, Error]]]:
kwargs = _get_kwargs(
code_option=code_option,
client=client,
)
@ -68,6 +78,7 @@ def sync_detailed(
def sync(
code_option: CodeOption,
*,
client: Client,
) -> Optional[Union[KclModel, Error]]:
@ -76,15 +87,18 @@ def sync(
A STEP file does not have feature tree data, so it will not work. A sldprt file does have feature tree data, so it will work.""" # noqa: E501
return sync_detailed(
code_option=code_option,
client=client,
).parsed
async def asyncio_detailed(
code_option: CodeOption,
*,
client: Client,
) -> Response[Optional[Union[KclModel, Error]]]:
kwargs = _get_kwargs(
code_option=code_option,
client=client,
)
@ -95,6 +109,7 @@ async def asyncio_detailed(
async def asyncio(
code_option: CodeOption,
*,
client: Client,
) -> Optional[Union[KclModel, Error]]:
@ -104,6 +119,7 @@ async def asyncio(
return (
await asyncio_detailed(
code_option=code_option,
client=client,
)
).parsed

View File

@ -241,6 +241,7 @@ from kittycad.models.api_token_uuid import ApiTokenUuid
from kittycad.models.base64data import Base64Data
from kittycad.models.billing_info import BillingInfo
from kittycad.models.code_language import CodeLanguage
from kittycad.models.code_option import CodeOption
from kittycad.models.create_shortlink_request import CreateShortlinkRequest
from kittycad.models.created_at_sort_mode import CreatedAtSortMode
from kittycad.models.crm_data import CrmData
@ -1916,6 +1917,7 @@ def test_create_proprietary_to_kcl():
result: Optional[Union[KclModel, Error]] = create_proprietary_to_kcl.sync(
client=client,
code_option=CodeOption.PARSE,
)
if isinstance(result, Error) or result is None:
@ -1929,6 +1931,7 @@ def test_create_proprietary_to_kcl():
response: Response[Optional[Union[KclModel, Error]]] = (
create_proprietary_to_kcl.sync_detailed(
client=client,
code_option=CodeOption.PARSE,
)
)
@ -1942,6 +1945,7 @@ async def test_create_proprietary_to_kcl_async():
result: Optional[Union[KclModel, Error]] = await create_proprietary_to_kcl.asyncio(
client=client,
code_option=CodeOption.PARSE,
)
# OR run async with more info
@ -1949,6 +1953,7 @@ async def test_create_proprietary_to_kcl_async():
Optional[Union[KclModel, Error]]
] = await create_proprietary_to_kcl.asyncio_detailed(
client=client,
code_option=CodeOption.PARSE,
)

View File

@ -4,6 +4,7 @@ from .account_provider import AccountProvider
from .add_hole_from_offset import AddHoleFromOffset
from .add_org_member import AddOrgMember
from .address_details import AddressDetails
from .adjacency_info import AdjacencyInfo
from .angle import Angle
from .annotation_line_end import AnnotationLineEnd
from .annotation_line_end_options import AnnotationLineEndOptions
@ -50,6 +51,7 @@ from .client_metrics import ClientMetrics
from .close_path import ClosePath
from .cluster import Cluster
from .code_language import CodeLanguage
from .code_option import CodeOption
from .code_output import CodeOutput
from .color import Color
from .complementary_edges import ComplementaryEdges
@ -94,6 +96,7 @@ from .discount import Discount
from .discount_code import DiscountCode
from .distance_type import DistanceType
from .dxf_storage import DxfStorage
from .edge_info import EdgeInfo
from .edge_lines_visible import EdgeLinesVisible
from .email_authentication_form import EmailAuthenticationForm
from .empty import Empty
@ -266,6 +269,7 @@ from .project_entity_to_plane import ProjectEntityToPlane
from .project_points_to_plane import ProjectPointsToPlane
from .raw_file import RawFile
from .reconfigure_stream import ReconfigureStream
from .relative_to import RelativeTo
from .remove_scene_objects import RemoveSceneObjects
from .revolve import Revolve
from .revolve_about_edge import RevolveAboutEdge
@ -306,16 +310,15 @@ from .side_face import SideFace
from .sketch_mode_disable import SketchModeDisable
from .solid2d_add_hole import Solid2dAddHole
from .solid3d_fillet_edge import Solid3dFilletEdge
from .solid3d_get_adjacency_info import Solid3dGetAdjacencyInfo
from .solid3d_get_all_edge_faces import Solid3dGetAllEdgeFaces
from .solid3d_get_all_opposite_edges import Solid3dGetAllOppositeEdges
from .solid3d_get_common_edge import Solid3dGetCommonEdge
from .solid3d_get_extrusion_face_info import Solid3dGetExtrusionFaceInfo
from .solid3d_get_info import Solid3dGetInfo
from .solid3d_get_next_adjacent_edge import Solid3dGetNextAdjacentEdge
from .solid3d_get_opposite_edge import Solid3dGetOppositeEdge
from .solid3d_get_prev_adjacent_edge import Solid3dGetPrevAdjacentEdge
from .solid3d_shell_face import Solid3dShellFace
from .solid_info import SolidInfo
from .source_position import SourcePosition
from .source_range import SourceRange
from .source_range_prompt import SourceRangePrompt

View File

@ -0,0 +1,17 @@
from typing import Optional
from pydantic import BaseModel, ConfigDict
from ..models.edge_info import EdgeInfo
class AdjacencyInfo(BaseModel):
"""Edge info struct (useful for maintaining mappings between edges and faces and adjacent/opposite edges)."""
adjacent_info: Optional[EdgeInfo] = None
opposite_info: Optional[EdgeInfo] = None
original_info: Optional[EdgeInfo] = None
model_config = ConfigDict(protected_namespaces=())

View File

@ -0,0 +1,17 @@
from enum import Enum
class CodeOption(str, Enum):
"""Code option for running and verifying kcl.
<details><summary>JSON schema</summary>
```json { "title": "CodeOption", "description": "Code option for running and verifying kcl.", "type": "string", "enum": [ "parse", "execute", "cleanup", "mock_execute" ] } ``` </details>""" # noqa: E501
PARSE = "parse"
EXECUTE = "execute"
CLEANUP = "cleanup"
MOCK_EXECUTE = "mock_execute"
def __str__(self) -> str:
return str(self.value)

View File

@ -0,0 +1,13 @@
from typing import List
from pydantic import BaseModel, ConfigDict
class EdgeInfo(BaseModel):
"""A list of faces for a specific edge."""
edge_id: str
faces: List[str]
model_config = ConfigDict(protected_namespaces=())

View File

@ -31,6 +31,7 @@ from ..models.path_segment import PathSegment
from ..models.perspective_camera_parameters import PerspectiveCameraParameters
from ..models.point2d import Point2d
from ..models.point3d import Point3d
from ..models.relative_to import RelativeTo
from ..models.scene_selection_type import SceneSelectionType
from ..models.scene_tool_type import SceneToolType
from ..models.transform import Transform
@ -104,6 +105,8 @@ class OptionExtrude(BaseModel):
class OptionSweep(BaseModel):
"""Extrude the object along a path."""
relative_to: RelativeTo = "sketch_plane" # type: ignore
sectional: bool
target: ModelingCmdId
@ -1493,12 +1496,14 @@ class OptionSolid3DGetExtrusionFaceInfo(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class OptionSolid3DGetInfo(BaseModel):
class OptionSolid3DGetAdjacencyInfo(BaseModel):
"""Get a concise description of all of solids edges."""
edge_id: str
object_id: str
type: Literal["solid3d_get_info"] = "solid3d_get_info"
type: Literal["solid3d_get_adjacency_info"] = "solid3d_get_adjacency_info"
model_config = ConfigDict(protected_namespaces=())
@ -1735,7 +1740,7 @@ ModelingCmd = RootModel[
OptionOrientToFace,
OptionViewIsometric,
OptionSolid3DGetExtrusionFaceInfo,
OptionSolid3DGetInfo,
OptionSolid3DGetAdjacencyInfo,
OptionSelectClear,
OptionSelectGet,
OptionGetNumObjects,

View File

@ -4,6 +4,7 @@ from pydantic import BaseModel, ConfigDict, Field, RootModel
from typing_extensions import Annotated
from ..models.add_hole_from_offset import AddHoleFromOffset
from ..models.adjacency_info import AdjacencyInfo
from ..models.boolean_intersection import BooleanIntersection
from ..models.boolean_subtract import BooleanSubtract
from ..models.boolean_union import BooleanUnion
@ -32,6 +33,7 @@ from ..models.default_camera_set_view import DefaultCameraSetView
from ..models.default_camera_zoom import DefaultCameraZoom
from ..models.density import Density
from ..models.disable_dry_run import DisableDryRun
from ..models.edge_info import EdgeInfo
from ..models.edge_lines_visible import EdgeLinesVisible
from ..models.enable_dry_run import EnableDryRun
from ..models.enable_sketch_mode import EnableSketchMode
@ -121,16 +123,15 @@ from ..models.set_tool import SetTool
from ..models.sketch_mode_disable import SketchModeDisable
from ..models.solid2d_add_hole import Solid2dAddHole
from ..models.solid3d_fillet_edge import Solid3dFilletEdge
from ..models.solid3d_get_adjacency_info import Solid3dGetAdjacencyInfo
from ..models.solid3d_get_all_edge_faces import Solid3dGetAllEdgeFaces
from ..models.solid3d_get_all_opposite_edges import Solid3dGetAllOppositeEdges
from ..models.solid3d_get_common_edge import Solid3dGetCommonEdge
from ..models.solid3d_get_extrusion_face_info import Solid3dGetExtrusionFaceInfo
from ..models.solid3d_get_info import Solid3dGetInfo
from ..models.solid3d_get_next_adjacent_edge import Solid3dGetNextAdjacentEdge
from ..models.solid3d_get_opposite_edge import Solid3dGetOppositeEdge
from ..models.solid3d_get_prev_adjacent_edge import Solid3dGetPrevAdjacentEdge
from ..models.solid3d_shell_face import Solid3dShellFace
from ..models.solid_info import SolidInfo
from ..models.start_path import StartPath
from ..models.surface_area import SurfaceArea
from ..models.sweep import Sweep
@ -963,6 +964,16 @@ class OptionSelectGet(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class OptionSolid3DGetAdjacencyInfo(BaseModel):
""""""
data: Solid3dGetAdjacencyInfo
type: Literal["solid3d_get_adjacency_info"] = "solid3d_get_adjacency_info"
model_config = ConfigDict(protected_namespaces=())
class OptionSolid3DGetAllEdgeFaces(BaseModel):
""""""
@ -1315,6 +1326,16 @@ class OptionFaceEdgeInfo(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class OptionEdgeInfo(BaseModel):
""""""
data: EdgeInfo
type: Literal["edge_info"] = "edge_info"
model_config = ConfigDict(protected_namespaces=())
class OptionEntityClone(BaseModel):
""""""
@ -1435,22 +1456,12 @@ class OptionComplementaryEdges(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class OptionSolid3DGetInfo(BaseModel):
class OptionAdjacencyInfo(BaseModel):
""""""
data: Solid3dGetInfo
data: AdjacencyInfo
type: Literal["solid3d_get_info"] = "solid3d_get_info"
model_config = ConfigDict(protected_namespaces=())
class OptionSolidInfo(BaseModel):
""""""
data: SolidInfo
type: Literal["solid_info"] = "solid_info"
type: Literal["adjacency_info"] = "adjacency_info"
model_config = ConfigDict(protected_namespaces=())
@ -1580,6 +1591,7 @@ OkModelingCmdResponse = RootModel[
OptionAddHoleFromOffset,
OptionDefaultCameraFocusOn,
OptionSelectGet,
OptionSolid3DGetAdjacencyInfo,
OptionSolid3DGetAllEdgeFaces,
OptionSolid3DGetAllOppositeEdges,
OptionSolid3DGetOppositeEdge,
@ -1615,6 +1627,7 @@ OkModelingCmdResponse = RootModel[
OptionGetSketchModePlane,
OptionEntityGetDistance,
OptionFaceEdgeInfo,
OptionEdgeInfo,
OptionEntityClone,
OptionEntityLinearPatternTransform,
OptionEntityLinearPattern,
@ -1627,8 +1640,7 @@ OkModelingCmdResponse = RootModel[
OptionSolid3DGetExtrusionFaceInfo,
OptionExtrusionFaceInfo,
OptionComplementaryEdges,
OptionSolid3DGetInfo,
OptionSolidInfo,
OptionAdjacencyInfo,
OptionSetGridReferencePlane,
OptionBooleanUnion,
OptionBooleanIntersection,

View File

@ -0,0 +1,13 @@
from enum import Enum
class RelativeTo(str, Enum):
"""What is the given geometry relative to?""" # noqa: E501
"""# Local/relative to a position centered within the plane being sketched on """ # noqa: E501
SKETCH_PLANE = "sketch_plane"
"""# Local/relative to the trajectory curve """ # noqa: E501
TRAJECTORY_CURVE = "trajectory_curve"
def __str__(self) -> str:
return str(self.value)

View File

@ -0,0 +1,13 @@
from typing import List
from pydantic import BaseModel, ConfigDict
from ..models.adjacency_info import AdjacencyInfo
class Solid3dGetAdjacencyInfo(BaseModel):
"""Extrusion face info struct (useful for maintaining mappings between source path segment ids and extrusion faces) This includes the opposite and adjacent faces and edges."""
edges: List[AdjacencyInfo]
model_config = ConfigDict(protected_namespaces=())

View File

@ -1,11 +0,0 @@
from pydantic import BaseModel, ConfigDict
from ..models.solid_info import SolidInfo
class Solid3dGetInfo(BaseModel):
"""Extrusion face info struct (useful for maintaining mappings between source path segment ids and extrusion faces)"""
info: SolidInfo
model_config = ConfigDict(protected_namespaces=())

View File

@ -1,19 +0,0 @@
from typing import Dict, List, Optional
from pydantic import BaseModel, ConfigDict
from ..models.complementary_edges import ComplementaryEdges
class SolidInfo(BaseModel):
"""Solid info struct (useful for maintaining mappings between edges and faces and adjacent/opposite edges)."""
bottom_cap_id: Optional[str] = None
common_edges: Dict[str, List[str]]
complementary_edges: Dict[str, ComplementaryEdges]
top_cap_id: Optional[str] = None
model_config = ConfigDict(protected_namespaces=())

243
spec.json
View File

@ -3920,6 +3920,16 @@
"summary": "Converts a proprietary CAD format to KCL.",
"description": "This endpoint is used to convert a proprietary CAD format to KCL. The file passed MUST have feature tree data.\n\nA STEP file does not have feature tree data, so it will not work. A sldprt file does have feature tree data, so it will work.",
"operationId": "create_proprietary_to_kcl",
"parameters": [
{
"in": "query",
"name": "code_option",
"description": "The options to run on the code. By default this is set to `execute`.",
"schema": {
"$ref": "#/components/schemas/CodeOption"
}
}
],
"requestBody": {
"content": {
"multipart/form-data": {
@ -17329,6 +17339,39 @@
"country"
]
},
"AdjacencyInfo": {
"description": "Edge info struct (useful for maintaining mappings between edges and faces and adjacent/opposite edges).",
"type": "object",
"properties": {
"adjacent_info": {
"nullable": true,
"description": "Adjacent edge and face info.",
"allOf": [
{
"$ref": "#/components/schemas/EdgeInfo"
}
]
},
"opposite_info": {
"nullable": true,
"description": "Opposite edge and face info.",
"allOf": [
{
"$ref": "#/components/schemas/EdgeInfo"
}
]
},
"original_info": {
"nullable": true,
"description": "Original edge id and face info.",
"allOf": [
{
"$ref": "#/components/schemas/EdgeInfo"
}
]
}
}
},
"Angle": {
"description": "An angle, with a specific unit.",
"type": "object",
@ -19805,6 +19848,16 @@
}
]
},
"CodeOption": {
"description": "Code option for running and verifying kcl.\n\n<details><summary>JSON schema</summary>\n\n```json { \"title\": \"CodeOption\", \"description\": \"Code option for running and verifying kcl.\", \"type\": \"string\", \"enum\": [ \"parse\", \"execute\", \"cleanup\", \"mock_execute\" ] } ``` </details>",
"type": "string",
"enum": [
"parse",
"execute",
"cleanup",
"mock_execute"
]
},
"CodeOutput": {
"description": "Output of the code being executed.\n\n<details><summary>JSON schema</summary>\n\n```json { \"description\": \"Output of the code being executed.\", \"type\": \"object\", \"properties\": { \"output_files\": { \"description\": \"The contents of the files requested if they were passed.\", \"type\": \"array\", \"items\": { \"$ref\": \"#/components/schemas/OutputFile\" } }, \"stderr\": { \"description\": \"The stderr of the code.\", \"default\": \"\", \"type\": \"string\" }, \"stdout\": { \"description\": \"The stdout of the code.\", \"default\": \"\", \"type\": \"string\" } } } ``` </details>",
"type": "object",
@ -20994,6 +21047,29 @@
}
]
},
"EdgeInfo": {
"description": "A list of faces for a specific edge.",
"type": "object",
"properties": {
"edge_id": {
"description": "The UUID of the id.",
"type": "string",
"format": "uuid"
},
"faces": {
"description": "The faces of each edge.",
"type": "array",
"items": {
"type": "string",
"format": "uuid"
}
}
},
"required": [
"edge_id",
"faces"
]
},
"EdgeLinesVisible": {
"description": "The response from the `EdgeLinesVisible` endpoint.",
"type": "object"
@ -24944,6 +25020,15 @@
"description": "Extrude the object along a path.",
"type": "object",
"properties": {
"relative_to": {
"description": "What is this sweep relative to?",
"default": "sketch_plane",
"allOf": [
{
"$ref": "#/components/schemas/RelativeTo"
}
]
},
"sectional": {
"description": "If true, the sweep will be broken up into sub-sweeps (extrusions, revolves, sweeps) based on the trajectory path components.",
"type": "boolean"
@ -28459,6 +28544,11 @@
"description": "Get a concise description of all of solids edges.",
"type": "object",
"properties": {
"edge_id": {
"description": "Any edge that lies on the extrusion base path.",
"type": "string",
"format": "uuid"
},
"object_id": {
"description": "The Solid3d object whose info is being queried.",
"type": "string",
@ -28467,11 +28557,12 @@
"type": {
"type": "string",
"enum": [
"solid3d_get_info"
"solid3d_get_adjacency_info"
]
}
},
"required": [
"edge_id",
"object_id",
"type"
]
@ -30359,6 +30450,24 @@
"type"
]
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/Solid3dGetAdjacencyInfo"
},
"type": {
"type": "string",
"enum": [
"solid3d_get_adjacency_info"
]
}
},
"required": [
"data",
"type"
]
},
{
"type": "object",
"properties": {
@ -30989,6 +31098,24 @@
"type"
]
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EdgeInfo"
},
"type": {
"type": "string",
"enum": [
"edge_info"
]
}
},
"required": [
"data",
"type"
]
},
{
"type": "object",
"properties": {
@ -31209,30 +31336,12 @@
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/Solid3dGetInfo"
"$ref": "#/components/schemas/AdjacencyInfo"
},
"type": {
"type": "string",
"enum": [
"solid3d_get_info"
]
}
},
"required": [
"data",
"type"
]
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/SolidInfo"
},
"type": {
"type": "string",
"enum": [
"solid_info"
"adjacency_info"
]
}
},
@ -33068,6 +33177,25 @@
"description": "The response from the `ReconfigureStream` endpoint.",
"type": "object"
},
"RelativeTo": {
"description": "What is the given geometry relative to?",
"oneOf": [
{
"description": "Local/relative to a position centered within the plane being sketched on",
"type": "string",
"enum": [
"sketch_plane"
]
},
{
"description": "Local/relative to the trajectory curve",
"type": "string",
"enum": [
"trajectory_curve"
]
}
]
},
"RemoveSceneObjects": {
"description": "The response from the `RemoveSceneObjects` endpoint.",
"type": "object"
@ -33823,6 +33951,22 @@
"description": "The response from the `Solid3dFilletEdge` endpoint.",
"type": "object"
},
"Solid3dGetAdjacencyInfo": {
"description": "Extrusion face info struct (useful for maintaining mappings between source path segment ids and extrusion faces) This includes the opposite and adjacent faces and edges.",
"type": "object",
"properties": {
"edges": {
"description": "Details of each edge.",
"type": "array",
"items": {
"$ref": "#/components/schemas/AdjacencyInfo"
}
}
},
"required": [
"edges"
]
},
"Solid3dGetAllEdgeFaces": {
"description": "The response from the `Solid3dGetAllEdgeFaces` command.",
"type": "object",
@ -33885,23 +34029,6 @@
"faces"
]
},
"Solid3dGetInfo": {
"description": "Extrusion face info struct (useful for maintaining mappings between source path segment ids and extrusion faces)",
"type": "object",
"properties": {
"info": {
"description": "Details of each face.",
"allOf": [
{
"$ref": "#/components/schemas/SolidInfo"
}
]
}
},
"required": [
"info"
]
},
"Solid3dGetNextAdjacentEdge": {
"description": "The response from the `Solid3dGetNextAdjacentEdge` command.",
"type": "object",
@ -33944,46 +34071,6 @@
"description": "The response from the `Solid3dShellFace` endpoint.",
"type": "object"
},
"SolidInfo": {
"description": "Solid info struct (useful for maintaining mappings between edges and faces and adjacent/opposite edges).",
"type": "object",
"properties": {
"bottom_cap_id": {
"nullable": true,
"description": "UUID for bottom cap.",
"type": "string",
"format": "uuid"
},
"common_edges": {
"description": "A map containing the common faces for all edges.",
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "string",
"format": "uuid"
}
}
},
"complementary_edges": {
"description": "A map containing the adjacent and opposite edge ids of each wall face.",
"type": "object",
"additionalProperties": {
"$ref": "#/components/schemas/ComplementaryEdges"
}
},
"top_cap_id": {
"nullable": true,
"description": "UUID for top cap.",
"type": "string",
"format": "uuid"
}
},
"required": [
"common_edges",
"complementary_edges"
]
},
"SourcePosition": {
"description": "A position in the source code.",
"type": "object",