Skip to content

Commit

Permalink
Update api spec (#308)
Browse files Browse the repository at this point in the history
* YOYO NEW API SPEC!

* I have generated the latest API!

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 1e8dd64 commit 924073c
Show file tree
Hide file tree
Showing 6 changed files with 508 additions and 410 deletions.
814 changes: 407 additions & 407 deletions kittycad.py.patch.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions kittycad/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
from .empty import Empty
from .enable_dry_run import EnableDryRun
from .enable_sketch_mode import EnableSketchMode
from .engine_util_evaluate_path import EngineUtilEvaluatePath
from .entity_circular_pattern import EntityCircularPattern
from .entity_fade import EntityFade
from .entity_get_all_child_uuids import EntityGetAllChildUuids
Expand Down
11 changes: 11 additions & 0 deletions kittycad/models/engine_util_evaluate_path.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from pydantic import BaseModel, ConfigDict

from ..models.point3d import Point3d


class EngineUtilEvaluatePath(BaseModel):
"""The response of the `EngineUtilEvaluatePath` endpoint"""

pos: Point3d

model_config = ConfigDict(protected_namespaces=())
15 changes: 14 additions & 1 deletion kittycad/models/modeling_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@
from ..models.unit_volume import UnitVolume


class OptionEngineUtilEvaluatePath(BaseModel):
"""Evaluates the position of a path in one shot (engine utility for kcl executor)"""

path_json: str

t: float

type: Literal["engine_util_evaluate_path"] = "engine_util_evaluate_path"

model_config = ConfigDict(protected_namespaces=())


class OptionStartPath(BaseModel):
"""Start a new path."""

Expand Down Expand Up @@ -1264,7 +1276,7 @@ class OptionZoomToFit(BaseModel):

object_ids: List[str] = []

padding: float
padding: float = 0.0

type: Literal["zoom_to_fit"] = "zoom_to_fit"

Expand Down Expand Up @@ -1320,6 +1332,7 @@ class OptionGetNumObjects(BaseModel):
ModelingCmd = RootModel[
Annotated[
Union[
OptionEngineUtilEvaluatePath,
OptionStartPath,
OptionMovePathPen,
OptionExtendPath,
Expand Down
12 changes: 12 additions & 0 deletions kittycad/models/ok_modeling_cmd_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from ..models.edge_lines_visible import EdgeLinesVisible
from ..models.enable_dry_run import EnableDryRun
from ..models.enable_sketch_mode import EnableSketchMode
from ..models.engine_util_evaluate_path import EngineUtilEvaluatePath
from ..models.entity_circular_pattern import EntityCircularPattern
from ..models.entity_fade import EntityFade
from ..models.entity_get_all_child_uuids import EntityGetAllChildUuids
Expand Down Expand Up @@ -125,6 +126,16 @@ class OptionEmpty(BaseModel):
model_config = ConfigDict(protected_namespaces=())


class OptionEngineUtilEvaluatePath(BaseModel):
""""""

data: EngineUtilEvaluatePath

type: Literal["engine_util_evaluate_path"] = "engine_util_evaluate_path"

model_config = ConfigDict(protected_namespaces=())


class OptionStartPath(BaseModel):
""""""

Expand Down Expand Up @@ -1235,6 +1246,7 @@ class OptionExtrusionFaceInfo(BaseModel):
Annotated[
Union[
OptionEmpty,
OptionEngineUtilEvaluatePath,
OptionStartPath,
OptionMovePathPen,
OptionExtendPath,
Expand Down
65 changes: 63 additions & 2 deletions spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -17982,6 +17982,23 @@
"description": "The response from the `EnableSketchMode` endpoint.",
"type": "object"
},
"EngineUtilEvaluatePath": {
"description": "The response of the `EngineUtilEvaluatePath` endpoint",
"type": "object",
"properties": {
"pos": {
"description": "The evaluated path curve position",
"allOf": [
{
"$ref": "#/components/schemas/Point3d"
}
]
}
},
"required": [
"pos"
]
},
"EntityCircularPattern": {
"description": "The response from the `EntityCircularPattern` command.",
"type": "object",
Expand Down Expand Up @@ -21288,6 +21305,32 @@
"ModelingCmd": {
"description": "Commands that the KittyCAD engine can execute.",
"oneOf": [
{
"description": "Evaluates the position of a path in one shot (engine utility for kcl executor)",
"type": "object",
"properties": {
"path_json": {
"description": "The path in json form (the serialized result of the kcl Sketch/Path object",
"type": "string"
},
"t": {
"description": "The evaluation parameter (path curve parameter in the normalized domain [0, 1])",
"type": "number",
"format": "double"
},
"type": {
"type": "string",
"enum": [
"engine_util_evaluate_path"
]
}
},
"required": [
"path_json",
"t",
"type"
]
},
{
"description": "Start a new path.",
"type": "object",
Expand Down Expand Up @@ -24354,6 +24397,7 @@
},
"padding": {
"description": "How much to pad the view frame by, as a fraction of the object(s) bounding box size. Negative padding will crop the view of the object proportionally. e.g. padding = 0.2 means the view will span 120% of the object(s) bounding box, and padding = -0.2 means the view will span 80% of the object(s) bounding box.",
"default": 0.0,
"type": "number",
"format": "float"
},
Expand All @@ -24365,7 +24409,6 @@
}
},
"required": [
"padding",
"type"
]
},
Expand All @@ -24374,7 +24417,7 @@
"type": "object",
"properties": {
"padding": {
"description": "How much to pad the view frame by.",
"description": "How much to pad the view frame by, as a fraction of the object(s) bounding box size. Negative padding will crop the view of the object proportionally. e.g. padding = 0.2 means the view will span 120% of the object(s) bounding box, and padding = -0.2 means the view will span 80% of the object(s) bounding box.",
"default": 0.0,
"type": "number",
"format": "float"
Expand Down Expand Up @@ -24607,6 +24650,24 @@
"type"
]
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EngineUtilEvaluatePath"
},
"type": {
"type": "string",
"enum": [
"engine_util_evaluate_path"
]
}
},
"required": [
"data",
"type"
]
},
{
"type": "object",
"properties": {
Expand Down

0 comments on commit 924073c

Please sign in to comment.