diff --git a/package.json b/package.json index 45974e9c..e231ef1f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@kittycad/lib", - "version": "2.0.13", + "version": "2.0.14", "description": "Javascript library for KittyCAD API", "type": "module", "keywords": [ diff --git a/spec.json b/spec.json index a6aeaabd..0942cb0a 100644 --- a/spec.json +++ b/spec.json @@ -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" - } - }, - "required": [ - "helix_id" - ] + "type": "object" + }, + "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": [ diff --git a/src/models.ts b/src/models.ts index 90cb81bf..782ff1f9 100644 --- a/src/models.ts +++ b/src/models.ts @@ -791,6 +791,23 @@ export interface Color_type { r: number; } +export interface ComponentTransform_type { + /*{ + "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)." +}*/ + rotate_angle_axis?: TransformByForPoint4d_type; + /*{ + "nullable": true, + "description": "Rotate component of the transform. The rotation is specified as a roll, pitch, yaw." +}*/ + rotate_rpy?: TransformByForPoint3d_type; + /* nullable:true, description:Scale component of the transform. */ + scale?: TransformByForPoint3d_type; + /* nullable:true, description:Translate component of the transform. */ + translate?: TransformByForPoint3d_type; +} + export interface Connection_type { /* default:0, format:int64, description:The auth timeout of the server. */ auth_timeout: number; @@ -1219,15 +1236,11 @@ export interface EntityLinearPatternTransform_type { entity_ids: string[]; } -export interface EntityMakeHelix_type { - /* format:uuid, description:The UUID of the helix that was created. */ - helix_id: string; -} +export interface EntityMakeHelix_type {} /* Empty object */ -export interface EntityMakeHelixFromParams_type { - /* format:uuid, description:The UUID of the helix that was created. */ - helix_id: string; -} +export interface EntityMakeHelixFromEdge_type {} /* Empty object */ + +export interface EntityMakeHelixFromParams_type {} /* Empty object */ export interface EntityMirror_type { /*{ @@ -2559,14 +2572,29 @@ export type ModelingCmd_type = center: Point3d_type /* Center of the helix at the base of the helix. */; is_clockwise: boolean /* Is the helix rotation clockwise? */; length: LengthUnit_type /* Length of the helix. */; - /* format:double, description:Radius of the helix. */ - radius: number; + radius: LengthUnit_type /* Radius of the helix. */; /* format:double, description:Number of revolutions. */ revolutions: number; /* default:{unit:degrees, value:0}, description:Start angle. */ start_angle: Angle_type; type: 'entity_make_helix_from_params'; } + | { + /* format:uuid, description:Edge about which to make the helix. */ + edge_id: string; + is_clockwise: boolean /* Is the helix rotation clockwise? */; + /*{ + "nullable": true, + "description": "Length of the helix. If None, the length of the edge will be used instead." +}*/ + length?: LengthUnit_type; + radius: LengthUnit_type /* Radius of the helix. */; + /* format:double, description:Number of revolutions. */ + revolutions: number; + /* default:{unit:degrees, value:0}, description:Start angle. */ + start_angle: Angle_type; + type: 'entity_make_helix_from_edge'; + } | { axis: Point3d_type /* Axis to use as mirror. */; /*{ @@ -3124,6 +3152,12 @@ export type ModelingCmd_type = | { type: 'select_clear' } | { type: 'select_get' } | { type: 'get_num_objects' } + | { + /* format:uuid, description:Id of the object whose transform is to be set. */ + object_id: string; + transforms: ComponentTransform_type[] /* List of transforms to be applied to the object. */; + type: 'set_object_transform'; + } | { /*{ "nullable": true, @@ -3706,6 +3740,13 @@ export type OkModelingCmdResponse_type = } | { /*{ + "$ref": "#/components/schemas/SetObjectTransform" +}*/ + data: SetObjectTransform_type; + type: 'set_object_transform'; + } + | { + /*{ "$ref": "#/components/schemas/AddHoleFromOffset" }*/ data: AddHoleFromOffset_type; @@ -4000,6 +4041,13 @@ export type OkModelingCmdResponse_type = } | { /*{ + "$ref": "#/components/schemas/EntityMakeHelixFromEdge" +}*/ + data: EntityMakeHelixFromEdge_type; + type: 'entity_make_helix_from_edge'; + } + | { + /*{ "$ref": "#/components/schemas/Solid3dGetExtrusionFaceInfo" }*/ data: Solid3dGetExtrusionFaceInfo_type; @@ -4696,6 +4744,8 @@ export interface SetCurrentToolProperties_type {} /* Empty object */ export interface SetDefaultSystemProperties_type {} /* Empty object */ +export interface SetObjectTransform_type {} /* Empty object */ + export interface SetSceneUnits_type {} /* Empty object */ export interface SetSelectionFilter_type {} /* Empty object */ @@ -5045,6 +5095,10 @@ export interface Transform_type { translate: Point3d_type; } +export type TransformByForPoint3d_type = string; + +export type TransformByForPoint4d_type = string; + export type UnitAngle_type = 'degrees' | 'radians'; export interface UnitAngleConversion_type { @@ -5950,6 +6004,7 @@ export interface Models { CodeLanguage_type: CodeLanguage_type; CodeOutput_type: CodeOutput_type; Color_type: Color_type; + ComponentTransform_type: ComponentTransform_type; Connection_type: Connection_type; CountryCode_type: CountryCode_type; Coupon_type: Coupon_type; @@ -6002,6 +6057,7 @@ export interface Models { EntityLinearPattern_type: EntityLinearPattern_type; EntityLinearPatternTransform_type: EntityLinearPatternTransform_type; EntityMakeHelix_type: EntityMakeHelix_type; + EntityMakeHelixFromEdge_type: EntityMakeHelixFromEdge_type; EntityMakeHelixFromParams_type: EntityMakeHelixFromParams_type; EntityMirror_type: EntityMirror_type; EntityMirrorAcrossEdge_type: EntityMirrorAcrossEdge_type; @@ -6166,6 +6222,7 @@ export interface Models { SetBackgroundColor_type: SetBackgroundColor_type; SetCurrentToolProperties_type: SetCurrentToolProperties_type; SetDefaultSystemProperties_type: SetDefaultSystemProperties_type; + SetObjectTransform_type: SetObjectTransform_type; SetSceneUnits_type: SetSceneUnits_type; SetSelectionFilter_type: SetSelectionFilter_type; SetSelectionType_type: SetSelectionType_type; @@ -6208,6 +6265,8 @@ export interface Models { TextToCadResultsPage_type: TextToCadResultsPage_type; TokenRevokeRequestForm_type: TokenRevokeRequestForm_type; Transform_type: Transform_type; + TransformByForPoint3d_type: TransformByForPoint3d_type; + TransformByForPoint4d_type: TransformByForPoint4d_type; UnitAngle_type: UnitAngle_type; UnitAngleConversion_type: UnitAngleConversion_type; UnitArea_type: UnitArea_type;