Skip to content

Commit d0c0035

Browse files
Update api spec (#342)
* YOYO NEW API SPEC! * Generated new lib * 2.0.44 * 2.0.45 --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent b37f9e3 commit d0c0035

File tree

5 files changed

+145
-4
lines changed

5 files changed

+145
-4
lines changed

__tests__/gen/ml-create_text_to_cad_multi_file_iteration.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ async function example() {
99
},
1010
],
1111
body: {
12+
conversation_id: 'A UUID usually v4 or v7',
1213
kcl_version:
1314
'The version of kcl to use. If empty, the latest version will be used.',
1415
project_name:

kittycad.ts.patch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,7 @@
907907
"op": "add",
908908
"path": "/paths/~1ml~1text-to-cad~1multi-file~1iteration/post/x-typescript",
909909
"value": {
910-
"example": "import { ml } from '@kittycad/lib'\n\nasync function example() {\n const response = await ml.create_text_to_cad_multi_file_iteration({\n files: [\n {\n name: 'thing.kcl',\n data: new Blob(['thing = 1'], { type: 'text/plain' }),\n },\n ],\n body: {\n kcl_version:\n 'The version of kcl to use. If empty, the latest version will be used.',\n project_name:\n 'The project name. This is used to tie the prompt to a project. Which helps us make our models better over time.',\n prompt: 'The prompt for the overall changes. This is optional if you only want changes on specific source ranges. This will apply to all the files. If you want to apply a prompt to just a single file, use the source_ranges field and you can leave this empty.',\n source_ranges: [],\n },\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
910+
"example": "import { ml } from '@kittycad/lib'\n\nasync function example() {\n const response = await ml.create_text_to_cad_multi_file_iteration({\n files: [\n {\n name: 'thing.kcl',\n data: new Blob(['thing = 1'], { type: 'text/plain' }),\n },\n ],\n body: {\n conversation_id: 'A UUID usually v4 or v7',\n kcl_version:\n 'The version of kcl to use. If empty, the latest version will be used.',\n project_name:\n 'The project name. This is used to tie the prompt to a project. Which helps us make our models better over time.',\n prompt: 'The prompt for the overall changes. This is optional if you only want changes on specific source ranges. This will apply to all the files. If you want to apply a prompt to just a single file, use the source_ranges field and you can leave this empty.',\n source_ranges: [],\n },\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
911911
"libDocsLink": ""
912912
}
913913
},

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kittycad/lib",
3-
"version": "2.0.43",
3+
"version": "2.0.45",
44
"description": "Javascript library for KittyCAD API",
55
"type": "module",
66
"keywords": [

spec.json

Lines changed: 129 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1571,6 +1571,98 @@
15711571
}
15721572
}
15731573
},
1574+
"/auth/saml/org/{org_id}/login": {
1575+
"get": {
1576+
"tags": [
1577+
"hidden"
1578+
],
1579+
"summary": "GET /auth/saml/{org_id}",
1580+
"description": "Redirects the browser straight to the org’s SAML IdP.",
1581+
"operationId": "get_auth_saml_by_org",
1582+
"parameters": [
1583+
{
1584+
"in": "path",
1585+
"name": "org_id",
1586+
"description": "The ID of the organisation that owns the IdP.",
1587+
"required": true,
1588+
"schema": {
1589+
"$ref": "#/components/schemas/Uuid"
1590+
}
1591+
},
1592+
{
1593+
"in": "query",
1594+
"name": "callback_url",
1595+
"description": "The URL to redirect back to after we have authenticated.",
1596+
"schema": {
1597+
"nullable": true,
1598+
"type": "string",
1599+
"format": "uri"
1600+
}
1601+
}
1602+
],
1603+
"responses": {
1604+
"302": {
1605+
"description": "Temporary Redirect",
1606+
"headers": {
1607+
"Access-Control-Allow-Credentials": {
1608+
"description": "Access-Control-Allow-Credentials header.",
1609+
"style": "simple",
1610+
"schema": {
1611+
"nullable": true,
1612+
"type": "string"
1613+
}
1614+
},
1615+
"Access-Control-Allow-Headers": {
1616+
"description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.",
1617+
"style": "simple",
1618+
"schema": {
1619+
"nullable": true,
1620+
"type": "string"
1621+
}
1622+
},
1623+
"Access-Control-Allow-Methods": {
1624+
"description": "Access-Control-Allow-Methods header.",
1625+
"style": "simple",
1626+
"schema": {
1627+
"nullable": true,
1628+
"type": "string"
1629+
}
1630+
},
1631+
"Access-Control-Allow-Origin": {
1632+
"description": "Access-Control-Allow-Origin header.",
1633+
"style": "simple",
1634+
"schema": {
1635+
"nullable": true,
1636+
"type": "string"
1637+
}
1638+
},
1639+
"Set-Cookie": {
1640+
"description": "Set-Cookie header.",
1641+
"style": "simple",
1642+
"schema": {
1643+
"nullable": true,
1644+
"type": "string"
1645+
}
1646+
},
1647+
"X-Api-Call-Id": {
1648+
"description": "ID for this request. We return it so that users can report this to us and help us debug their problems.",
1649+
"style": "simple",
1650+
"required": true,
1651+
"schema": {
1652+
"type": "string"
1653+
}
1654+
}
1655+
}
1656+
},
1657+
"4XX": {
1658+
"$ref": "#/components/responses/Error"
1659+
},
1660+
"5XX": {
1661+
"$ref": "#/components/responses/Error"
1662+
}
1663+
}
1664+
}
1665+
},
15741666
"/auth/saml/provider/{provider_id}/login": {
15751667
"get": {
15761668
"tags": [
@@ -19306,6 +19398,14 @@
1930619398
"type": "string",
1930719399
"format": "date-time"
1930819400
},
19401+
"conversation_id": {
19402+
"description": "The conversation ID Conversations group different prompts together.",
19403+
"allOf": [
19404+
{
19405+
"$ref": "#/components/schemas/Uuid"
19406+
}
19407+
]
19408+
},
1930919409
"created_at": {
1931019410
"title": "DateTime",
1931119411
"description": "The time and date the API call was created.",
@@ -19412,6 +19512,7 @@
1941219512
}
1941319513
},
1941419514
"required": [
19515+
"conversation_id",
1941519516
"created_at",
1941619517
"id",
1941719518
"model",
@@ -24060,6 +24161,15 @@
2406024161
"type": "string",
2406124162
"format": "date-time"
2406224163
},
24164+
"conversation_id": {
24165+
"nullable": true,
24166+
"description": "The id for the conversation related to this prompt.",
24167+
"allOf": [
24168+
{
24169+
"$ref": "#/components/schemas/Uuid"
24170+
}
24171+
]
24172+
},
2406324173
"created_at": {
2406424174
"title": "DateTime",
2406524175
"description": "The date and time the ML prompt was created.",
@@ -24607,7 +24717,7 @@
2460724717
]
2460824718
},
2460924719
"extrude_method": {
24610-
"description": "Should the extrusion create a new object or be part of the existing object. If a new object is created, the command id will be the id of the newly created object.",
24720+
"description": "Should the extrusion create a new object or be part of the existing object.",
2461124721
"default": "merge",
2461224722
"allOf": [
2461324723
{
@@ -34742,6 +34852,14 @@
3474234852
"type": "string",
3474334853
"format": "date-time"
3474434854
},
34855+
"conversation_id": {
34856+
"description": "The conversation ID Conversations group different prompts together.",
34857+
"allOf": [
34858+
{
34859+
"$ref": "#/components/schemas/Uuid"
34860+
}
34861+
]
34862+
},
3474534863
"created_at": {
3474634864
"title": "DateTime",
3474734865
"description": "The time and date the API call was created.",
@@ -34842,6 +34960,7 @@
3484234960
}
3484334961
},
3484434962
"required": [
34963+
"conversation_id",
3484534964
"created_at",
3484634965
"id",
3484734966
"model",
@@ -34856,6 +34975,15 @@
3485634975
"description": "Body for iterating on models from text prompts.",
3485734976
"type": "object",
3485834977
"properties": {
34978+
"conversation_id": {
34979+
"nullable": true,
34980+
"description": "The conversation ID Conversations group different prompts together. This should be omitted when starting a new conversation. The conversation_id returned in the response should be used to link future messages in the same conversation.",
34981+
"allOf": [
34982+
{
34983+
"$ref": "#/components/schemas/Uuid"
34984+
}
34985+
]
34986+
},
3485934987
"kcl_version": {
3486034988
"nullable": true,
3486134989
"description": "The version of kcl to use. If empty, the latest version will be used.",

src/models.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,7 @@ This is the same as the API call ID. */
588588
"description": "The time and date the API call was completed."
589589
}*/
590590
completed_at?: string;
591+
conversation_id: Uuid_type /* The conversation ID Conversations group different prompts together. */;
591592
/* title:DateTime, format:date-time, description:The time and date the API call was created. */
592593
created_at: string;
593594
/* nullable:true, description:The error the function returned, if any. */
@@ -2301,6 +2302,11 @@ export interface MlPrompt_type {
23012302
"description": "When the prompt was completed."
23022303
}*/
23032304
completed_at?: string;
2305+
/*{
2306+
"nullable": true,
2307+
"description": "The id for the conversation related to this prompt."
2308+
}*/
2309+
conversation_id?: Uuid_type;
23042310
/* title:DateTime, format:date-time, description:The date and time the ML prompt was created. */
23052311
created_at: string;
23062312
/* nullable:true, description:The error message if the prompt failed. */
@@ -2449,7 +2455,7 @@ export type ModelingCmd_type =
24492455
distance: LengthUnit_type /* How far off the plane to extrude */;
24502456
/*{
24512457
"default": "merge",
2452-
"description": "Should the extrusion create a new object or be part of the existing object. If a new object is created, the command id will be the id of the newly created object."
2458+
"description": "Should the extrusion create a new object or be part of the existing object."
24532459
}*/
24542460
extrude_method: ExtrudeMethod_type;
24552461
/*{
@@ -5534,6 +5540,7 @@ export interface TextToCadMultiFileIteration_type {
55345540
"description": "The time and date the API call was completed."
55355541
}*/
55365542
completed_at?: string;
5543+
conversation_id: Uuid_type /* The conversation ID Conversations group different prompts together. */;
55375544
/* title:DateTime, format:date-time, description:The time and date the API call was created. */
55385545
created_at: string;
55395546
/* nullable:true, description:The error the function returned, if any. */
@@ -5577,6 +5584,11 @@ This is the same as the API call ID. */
55775584
}
55785585

55795586
export interface TextToCadMultiFileIterationBody_type {
5587+
/*{
5588+
"nullable": true,
5589+
"description": "The conversation ID Conversations group different prompts together. This should be omitted when starting a new conversation. The conversation_id returned in the response should be used to link future messages in the same conversation."
5590+
}*/
5591+
conversation_id?: Uuid_type;
55805592
/*{
55815593
"nullable": true,
55825594
"description": "The version of kcl to use. If empty, the latest version will be used."

0 commit comments

Comments
 (0)