From 1da5f995f98ad06aaa6eb0f4a29fb8559cb338d1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 22 Aug 2024 21:03:43 +0000 Subject: [PATCH] YOYO NEW API SPEC! --- spec.json | 2497 ++++++++++++++++++++++++++++++++--------------------- 1 file changed, 1493 insertions(+), 1004 deletions(-) diff --git a/spec.json b/spec.json index 560fccb9..111b2d89 100644 --- a/spec.json +++ b/spec.json @@ -194,47 +194,47 @@ } } }, - "/ai-prompts": { - "get": { + "/ai/text-to-cad/{output_format}": { + "post": { "tags": [ - "ml", - "hidden" + "ml" ], - "summary": "List all AI prompts.", - "description": "For text-to-cad prompts, this will always return the STEP file contents as well as the format the user originally requested.\nThis endpoint requires authentication by a Zoo employee.\nThe AI prompts are returned in order of creation, with the most recently created AI prompts first.", - "operationId": "list_ai_prompts", + "summary": "Generate a CAD model from text.", + "description": "Because our source of truth for the resulting model is a STEP file, you will always have STEP file contents when you list your generated models. Any other formats you request here will also be returned when you list your generated models.\nThis operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.\nOne thing to note, if you hit the cache, this endpoint will return right away. So you only have to wait if the status is not `Completed` or `Failed`.", + "operationId": "create_text_to_cad", "parameters": [ { - "in": "query", - "name": "limit", - "description": "Maximum number of items returned by a single call", + "in": "path", + "name": "output_format", + "description": "The format the output file should be converted to.", + "required": true, "schema": { - "nullable": true, - "type": "integer", - "format": "uint32", - "minimum": 1 + "$ref": "#/components/schemas/FileExportFormat" } }, { "in": "query", - "name": "page_token", - "description": "Token returned by previous call to retrieve the subsequent page", + "name": "kcl", + "description": "If we should output the kcl for the model.", "schema": { "nullable": true, - "type": "string" - } - }, - { - "in": "query", - "name": "sort_by", - "schema": { - "$ref": "#/components/schemas/CreatedAtSortMode" + "type": "boolean" } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TextToCadCreateBody" + } + } + }, + "required": true + }, "responses": { - "200": { - "description": "successful operation", + "201": { + "description": "successful creation", "headers": { "Access-Control-Allow-Credentials": { "description": "Access-Control-Allow-Credentials header.", @@ -272,7 +272,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AiPromptResultsPage" + "$ref": "#/components/schemas/TextToCad" } } } @@ -283,36 +283,29 @@ "5XX": { "$ref": "#/components/responses/Error" } - }, - "x-dropshot-pagination": { - "required": [] } - } - }, - "/ai-prompts/{id}": { - "get": { + }, + "options": { "tags": [ - "ml", "hidden" ], - "summary": "Get an AI prompt.", - "description": "This endpoint requires authentication by a Zoo employee.", - "operationId": "get_ai_prompt", + "summary": "OPTIONS endpoint.", + "description": "This is necessary for some preflight requests, specifically POST, PUT, and DELETE.", + "operationId": "options_text_to_cad", "parameters": [ { "in": "path", - "name": "id", - "description": "The id of the model to give feedback to.", + "name": "output_format", + "description": "The format the output file should be converted to.", "required": true, "schema": { - "type": "string", - "format": "uuid" + "$ref": "#/components/schemas/FileExportFormat" } } ], "responses": { - "200": { - "description": "successful operation", + "204": { + "description": "successful operation, no content", "headers": { "Access-Control-Allow-Credentials": { "description": "Access-Control-Allow-Credentials header.", @@ -346,13 +339,6 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AiPrompt" - } - } } }, "4XX": { @@ -364,27 +350,29 @@ } } }, - "/ai/kcl/completions": { - "post": { + "/api-call-metrics": { + "get": { "tags": [ - "ml", - "beta" + "api-calls", + "hidden" ], - "summary": "Generate code completions for KCL.", - "operationId": "create_kcl_code_completions", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/KclCodeCompletionRequest" - } + "summary": "Get API call metrics.", + "description": "This endpoint requires authentication by a Zoo employee. The API calls are grouped by the parameter passed.", + "operationId": "get_api_call_metrics", + "parameters": [ + { + "in": "query", + "name": "group_by", + "description": "What field to group the metrics by.", + "required": true, + "schema": { + "$ref": "#/components/schemas/ApiCallQueryGroupBy" } - }, - "required": true - }, + } + ], "responses": { - "201": { - "description": "successful creation", + "200": { + "description": "successful operation", "headers": { "Access-Control-Allow-Credentials": { "description": "Access-Control-Allow-Credentials header.", @@ -422,7 +410,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/KclCodeCompletionResponse" + "title": "Array_of_ApiCallQueryGroup", + "type": "array", + "items": { + "$ref": "#/components/schemas/ApiCallQueryGroup" + } } } } @@ -434,17 +426,49 @@ "$ref": "#/components/responses/Error" } } - }, - "options": { + } + }, + "/api-calls": { + "get": { "tags": [ + "api-calls", "hidden" ], - "summary": "OPTIONS endpoint.", - "description": "This is necessary for some preflight requests, specifically POST, PUT, and DELETE.", - "operationId": "options_kcl_code_completions", + "summary": "List API calls.", + "description": "This endpoint requires authentication by a Zoo employee. The API calls are returned in order of creation, with the most recently created API calls first.", + "operationId": "list_api_calls", + "parameters": [ + { + "in": "query", + "name": "limit", + "description": "Maximum number of items returned by a single call", + "schema": { + "nullable": true, + "type": "integer", + "format": "uint32", + "minimum": 1 + } + }, + { + "in": "query", + "name": "page_token", + "description": "Token returned by previous call to retrieve the subsequent page", + "schema": { + "nullable": true, + "type": "string" + } + }, + { + "in": "query", + "name": "sort_by", + "schema": { + "$ref": "#/components/schemas/CreatedAtSortMode" + } + } + ], "responses": { - "204": { - "description": "successful operation, no content", + "200": { + "description": "successful operation", "headers": { "Access-Control-Allow-Credentials": { "description": "Access-Control-Allow-Credentials header.", @@ -478,6 +502,13 @@ "type": "string" } } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiCallWithPriceResultsPage" + } + } } }, "4XX": { @@ -486,50 +517,36 @@ "5XX": { "$ref": "#/components/responses/Error" } + }, + "x-dropshot-pagination": { + "required": [] } } }, - "/ai/text-to-cad/{output_format}": { - "post": { + "/api-calls/{id}": { + "get": { "tags": [ - "ml" + "api-calls", + "hidden" ], - "summary": "Generate a CAD model from text.", - "description": "Because our source of truth for the resulting model is a STEP file, you will always have STEP file contents when you list your generated models. Any other formats you request here will also be returned when you list your generated models.\nThis operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.\nOne thing to note, if you hit the cache, this endpoint will return right away. So you only have to wait if the status is not `Completed` or `Failed`.", - "operationId": "create_text_to_cad", + "summary": "Get details of an API call.", + "description": "This endpoint requires authentication by any Zoo user. It returns details of the requested API call for the user.\nIf the user is not authenticated to view the specified API call, then it is not returned.\nOnly Zoo employees can view API calls for other users.", + "operationId": "get_api_call", "parameters": [ { "in": "path", - "name": "output_format", - "description": "The format the output file should be converted to.", + "name": "id", + "description": "The ID of the API call.", "required": true, "schema": { - "$ref": "#/components/schemas/FileExportFormat" - } - }, - { - "in": "query", - "name": "kcl", - "description": "If we should output the kcl for the model.", - "schema": { - "nullable": true, - "type": "boolean" + "type": "string", + "format": "uuid" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TextToCadCreateBody" - } - } - }, - "required": true - }, "responses": { - "201": { - "description": "successful creation", + "200": { + "description": "successful operation", "headers": { "Access-Control-Allow-Credentials": { "description": "Access-Control-Allow-Credentials header.", @@ -567,7 +584,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TextToCad" + "$ref": "#/components/schemas/ApiCallWithPrice" } } } @@ -579,25 +596,25 @@ "$ref": "#/components/responses/Error" } } - }, - "options": { + } + }, + "/apps/github/callback": { + "get": { "tags": [ + "apps", "hidden" ], - "summary": "OPTIONS endpoint.", - "description": "This is necessary for some preflight requests, specifically POST, PUT, and DELETE.", - "operationId": "options_text_to_cad", - "parameters": [ - { - "in": "path", - "name": "output_format", - "description": "The format the output file should be converted to.", - "required": true, - "schema": { - "$ref": "#/components/schemas/FileExportFormat" + "summary": "Listen for callbacks to GitHub app authentication.", + "description": "This is different than OAuth 2.0 authentication for users. This endpoint grants access for Zoo to access user's repos.\nThe user doesn't need Zoo OAuth authorization for this endpoint, this is purely for the GitHub permissions to access repos.", + "operationId": "apps_github_callback", + "requestBody": { + "content": { + "application/json": { + "schema": {} } - } - ], + }, + "required": true + }, "responses": { "204": { "description": "successful operation, no content", @@ -645,26 +662,15 @@ } } }, - "/api-call-metrics": { + "/apps/github/consent": { "get": { "tags": [ - "api-calls", + "apps", "hidden" ], - "summary": "Get API call metrics.", - "description": "This endpoint requires authentication by a Zoo employee. The API calls are grouped by the parameter passed.", - "operationId": "get_api_call_metrics", - "parameters": [ - { - "in": "query", - "name": "group_by", - "description": "What field to group the metrics by.", - "required": true, - "schema": { - "$ref": "#/components/schemas/ApiCallQueryGroupBy" - } - } - ], + "summary": "Get the consent URL for GitHub app authentication.", + "description": "This is different than OAuth 2.0 authentication for users. This endpoint grants access for Zoo to access user's repos.\nThe user doesn't need Zoo OAuth authorization for this endpoint, this is purely for the GitHub permissions to access repos.", + "operationId": "apps_github_consent", "responses": { "200": { "description": "successful operation", @@ -705,11 +711,7 @@ "content": { "application/json": { "schema": { - "title": "Array_of_ApiCallQueryGroup", - "type": "array", - "items": { - "$ref": "#/components/schemas/ApiCallQueryGroup" - } + "$ref": "#/components/schemas/AppClientInfo" } } } @@ -723,47 +725,29 @@ } } }, - "/api-calls": { - "get": { + "/apps/github/webhook": { + "post": { "tags": [ - "api-calls", + "apps", "hidden" ], - "summary": "List API calls.", - "description": "This endpoint requires authentication by a Zoo employee. The API calls are returned in order of creation, with the most recently created API calls first.", - "operationId": "list_api_calls", - "parameters": [ - { - "in": "query", - "name": "limit", - "description": "Maximum number of items returned by a single call", - "schema": { - "nullable": true, - "type": "integer", - "format": "uint32", - "minimum": 1 - } - }, - { - "in": "query", - "name": "page_token", - "description": "Token returned by previous call to retrieve the subsequent page", - "schema": { - "nullable": true, - "type": "string" + "summary": "Listen for GitHub webhooks.", + "description": "These come from the GitHub app.", + "operationId": "apps_github_webhook", + "requestBody": { + "content": { + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary" + } } }, - { - "in": "query", - "name": "sort_by", - "schema": { - "$ref": "#/components/schemas/CreatedAtSortMode" - } - } - ], + "required": true + }, "responses": { - "200": { - "description": "successful operation", + "204": { + "description": "successful operation, no content", "headers": { "Access-Control-Allow-Credentials": { "description": "Access-Control-Allow-Credentials header.", @@ -797,13 +781,6 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ApiCallWithPriceResultsPage" - } - } } }, "4XX": { @@ -812,36 +789,18 @@ "5XX": { "$ref": "#/components/responses/Error" } - }, - "x-dropshot-pagination": { - "required": [] } - } - }, - "/api-calls/{id}": { - "get": { + }, + "options": { "tags": [ - "api-calls", "hidden" ], - "summary": "Get details of an API call.", - "description": "This endpoint requires authentication by any Zoo user. It returns details of the requested API call for the user.\nIf the user is not authenticated to view the specified API call, then it is not returned.\nOnly Zoo employees can view API calls for other users.", - "operationId": "get_api_call", - "parameters": [ - { - "in": "path", - "name": "id", - "description": "The ID of the API call.", - "required": true, - "schema": { - "type": "string", - "format": "uuid" - } - } - ], + "summary": "OPTIONS endpoint.", + "description": "This is necessary for some preflight requests, specifically POST, PUT, and DELETE.", + "operationId": "options_apps_github_webhook", "responses": { - "200": { - "description": "successful operation", + "204": { + "description": "successful operation, no content", "headers": { "Access-Control-Allow-Credentials": { "description": "Access-Control-Allow-Credentials header.", @@ -875,13 +834,6 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ApiCallWithPrice" - } - } } }, "4XX": { @@ -893,26 +845,55 @@ } } }, - "/apps/github/callback": { + "/async/operations": { "get": { "tags": [ - "apps", + "api-calls", "hidden" ], - "summary": "Listen for callbacks to GitHub app authentication.", - "description": "This is different than OAuth 2.0 authentication for users. This endpoint grants access for Zoo to access user's repos.\nThe user doesn't need Zoo OAuth authorization for this endpoint, this is purely for the GitHub permissions to access repos.", - "operationId": "apps_github_callback", - "requestBody": { - "content": { - "application/json": { - "schema": {} + "summary": "List async operations.", + "description": "For async file conversion operations, this endpoint does not return the contents of converted files (`output`). To get the contents use the `/async/operations/{id}` endpoint.\nThis endpoint requires authentication by a Zoo employee.", + "operationId": "list_async_operations", + "parameters": [ + { + "in": "query", + "name": "limit", + "description": "Maximum number of items returned by a single call", + "schema": { + "nullable": true, + "type": "integer", + "format": "uint32", + "minimum": 1 } }, - "required": true - }, + { + "in": "query", + "name": "page_token", + "description": "Token returned by previous call to retrieve the subsequent page", + "schema": { + "nullable": true, + "type": "string" + } + }, + { + "in": "query", + "name": "sort_by", + "schema": { + "$ref": "#/components/schemas/CreatedAtSortMode" + } + }, + { + "in": "query", + "name": "status", + "description": "The status to filter by.", + "schema": { + "$ref": "#/components/schemas/ApiCallStatus" + } + } + ], "responses": { - "204": { - "description": "successful operation, no content", + "200": { + "description": "successful operation", "headers": { "Access-Control-Allow-Credentials": { "description": "Access-Control-Allow-Credentials header.", @@ -946,6 +927,13 @@ "type": "string" } } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AsyncApiCallResultsPage" + } + } } }, "4XX": { @@ -954,18 +942,32 @@ "5XX": { "$ref": "#/components/responses/Error" } + }, + "x-dropshot-pagination": { + "required": [] } } }, - "/apps/github/consent": { + "/async/operations/{id}": { "get": { "tags": [ - "apps", - "hidden" + "api-calls" + ], + "summary": "Get an async operation.", + "description": "Get the status and output of an async operation.\nThis endpoint requires authentication by any Zoo user. It returns details of the requested async operation for the user.\nIf the user is not authenticated to view the specified async operation, then it is not returned.\nOnly Zoo employees with the proper access can view async operations for other users.", + "operationId": "get_async_operation", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "The ID of the async operation.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } ], - "summary": "Get the consent URL for GitHub app authentication.", - "description": "This is different than OAuth 2.0 authentication for users. This endpoint grants access for Zoo to access user's repos.\nThe user doesn't need Zoo OAuth authorization for this endpoint, this is purely for the GitHub permissions to access repos.", - "operationId": "apps_github_consent", "responses": { "200": { "description": "successful operation", @@ -1006,7 +1008,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AppClientInfo" + "$ref": "#/components/schemas/AsyncApiCallOutput" } } } @@ -1020,29 +1022,26 @@ } } }, - "/apps/github/webhook": { + "/auth/email": { "post": { "tags": [ - "apps", "hidden" ], - "summary": "Listen for GitHub webhooks.", - "description": "These come from the GitHub app.", - "operationId": "apps_github_webhook", + "summary": "Create an email verification request for a user.", + "operationId": "auth_email", "requestBody": { "content": { - "application/octet-stream": { + "application/json": { "schema": { - "type": "string", - "format": "binary" + "$ref": "#/components/schemas/EmailAuthenticationForm" } } }, "required": true }, "responses": { - "204": { - "description": "successful operation, no content", + "201": { + "description": "successful creation", "headers": { "Access-Control-Allow-Credentials": { "description": "Access-Control-Allow-Credentials header.", @@ -1076,6 +1075,13 @@ "type": "string" } } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VerificationTokenResponse" + } + } } }, "4XX": { @@ -1092,7 +1098,7 @@ ], "summary": "OPTIONS endpoint.", "description": "This is necessary for some preflight requests, specifically POST, PUT, and DELETE.", - "operationId": "options_apps_github_webhook", + "operationId": "options_auth_email", "responses": { "204": { "description": "successful operation, no content", @@ -1140,55 +1146,47 @@ } } }, - "/async/operations": { + "/auth/email/callback": { "get": { "tags": [ - "api-calls", "hidden" ], - "summary": "List async operations.", - "description": "For async file conversion operations, this endpoint does not return the contents of converted files (`output`). To get the contents use the `/async/operations/{id}` endpoint.\nThis endpoint requires authentication by a Zoo employee.", - "operationId": "list_async_operations", + "summary": "Listen for callbacks for email verification for users.", + "operationId": "auth_email_callback", "parameters": [ { "in": "query", - "name": "limit", - "description": "Maximum number of items returned by a single call", + "name": "callback_url", + "description": "The URL to redirect back to after we have authenticated.", "schema": { "nullable": true, - "type": "integer", - "format": "uint32", - "minimum": 1 + "type": "string", + "format": "uri" } }, { "in": "query", - "name": "page_token", - "description": "Token returned by previous call to retrieve the subsequent page", - "schema": { - "nullable": true, - "type": "string" - } - }, - { - "in": "query", - "name": "sort_by", + "name": "email", + "description": "The user's email.", + "required": true, "schema": { - "$ref": "#/components/schemas/CreatedAtSortMode" + "type": "string", + "format": "email" } }, { "in": "query", - "name": "status", - "description": "The status to filter by.", + "name": "token", + "description": "The verification token.", + "required": true, "schema": { - "$ref": "#/components/schemas/ApiCallStatus" + "type": "string" } } ], "responses": { - "200": { - "description": "successful operation", + "302": { + "description": "Temporary Redirect", "headers": { "Access-Control-Allow-Credentials": { "description": "Access-Control-Allow-Credentials header.", @@ -1221,12 +1219,13 @@ "schema": { "type": "string" } - } - }, - "content": { - "application/json": { + }, + "Set-Cookie": { + "description": "Set-Cookie header.", + "style": "simple", + "required": true, "schema": { - "$ref": "#/components/schemas/AsyncApiCallResultsPage" + "type": "string" } } } @@ -1237,35 +1236,41 @@ "5XX": { "$ref": "#/components/responses/Error" } - }, - "x-dropshot-pagination": { - "required": [] } } }, - "/async/operations/{id}": { + "/auth/saml/provider/{provider_id}/login": { "get": { "tags": [ - "api-calls" + "hidden" ], - "summary": "Get an async operation.", - "description": "Get the status and output of an async operation.\nThis endpoint requires authentication by any Zoo user. It returns details of the requested async operation for the user.\nIf the user is not authenticated to view the specified async operation, then it is not returned.\nOnly Zoo employees with the proper access can view async operations for other users.", - "operationId": "get_async_operation", + "summary": "Get a redirect straight to the SAML IdP.", + "description": "The UI uses this to avoid having to ask the API anything about the IdP. It already knows the SAML IdP ID from the path, so it can just link to this path and rely on the API to redirect to the actual IdP.", + "operationId": "get_auth_saml", "parameters": [ { "in": "path", - "name": "id", - "description": "The ID of the async operation.", + "name": "provider_id", + "description": "The ID of the identity provider.", "required": true, "schema": { + "$ref": "#/components/schemas/Uuid" + } + }, + { + "in": "query", + "name": "callback_url", + "description": "The URL to redirect back to after we have authenticated.", + "schema": { + "nullable": true, "type": "string", - "format": "uuid" + "format": "uri" } } ], "responses": { - "200": { - "description": "successful operation", + "302": { + "description": "Temporary Redirect", "headers": { "Access-Control-Allow-Credentials": { "description": "Access-Control-Allow-Credentials header.", @@ -1299,13 +1304,6 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AsyncApiCallOutput" - } - } } }, "4XX": { @@ -1315,28 +1313,38 @@ "$ref": "#/components/responses/Error" } } - } - }, - "/auth/email": { + }, "post": { "tags": [ "hidden" ], - "summary": "Create an email verification request for a user.", - "operationId": "auth_email", + "summary": "Authenticate a user via SAML", + "operationId": "post_auth_saml", + "parameters": [ + { + "in": "path", + "name": "provider_id", + "description": "The ID of the identity provider.", + "required": true, + "schema": { + "$ref": "#/components/schemas/Uuid" + } + } + ], "requestBody": { "content": { - "application/json": { + "application/octet-stream": { "schema": { - "$ref": "#/components/schemas/EmailAuthenticationForm" + "type": "string", + "format": "binary" } } }, "required": true }, "responses": { - "201": { - "description": "successful creation", + "302": { + "description": "Temporary Redirect", "headers": { "Access-Control-Allow-Credentials": { "description": "Access-Control-Allow-Credentials header.", @@ -1369,12 +1377,13 @@ "schema": { "type": "string" } - } - }, - "content": { - "application/json": { + }, + "Set-Cookie": { + "description": "Set-Cookie header.", + "style": "simple", + "required": true, "schema": { - "$ref": "#/components/schemas/VerificationTokenResponse" + "type": "string" } } } @@ -1393,7 +1402,18 @@ ], "summary": "OPTIONS endpoint.", "description": "This is necessary for some preflight requests, specifically POST, PUT, and DELETE.", - "operationId": "options_auth_email", + "operationId": "options_auth_saml", + "parameters": [ + { + "in": "path", + "name": "provider_id", + "description": "The ID of the identity provider.", + "required": true, + "schema": { + "$ref": "#/components/schemas/Uuid" + } + } + ], "responses": { "204": { "description": "successful operation, no content", @@ -1441,47 +1461,29 @@ } } }, - "/auth/email/callback": { - "get": { + "/debug/uploads": { + "post": { "tags": [ + "meta", "hidden" ], - "summary": "Listen for callbacks for email verification for users.", - "operationId": "auth_email_callback", - "parameters": [ - { - "in": "query", - "name": "callback_url", - "description": "The URL to redirect back to after we have authenticated.", - "schema": { - "nullable": true, - "type": "string", - "format": "uri" - } - }, - { - "in": "query", - "name": "email", - "description": "The user's email.", - "required": true, - "schema": { - "type": "string", - "format": "email" + "summary": "Uploads files to public blob storage for debugging purposes.", + "description": "Do NOT send files here that you don't want to be public.", + "operationId": "create_debug_uploads", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "string", + "format": "binary" + } } }, - { - "in": "query", - "name": "token", - "description": "The verification token.", - "required": true, - "schema": { - "type": "string" - } - } - ], + "required": true + }, "responses": { - "302": { - "description": "Temporary Redirect", + "201": { + "description": "successful creation", "headers": { "Access-Control-Allow-Credentials": { "description": "Access-Control-Allow-Credentials header.", @@ -1514,13 +1516,17 @@ "schema": { "type": "string" } - }, - "Set-Cookie": { - "description": "Set-Cookie header.", - "style": "simple", - "required": true, + } + }, + "content": { + "application/json": { "schema": { - "type": "string" + "title": "Array_of_Url", + "type": "array", + "items": { + "type": "string", + "format": "uri" + } } } } @@ -1532,40 +1538,17 @@ "$ref": "#/components/responses/Error" } } - } - }, - "/auth/saml/provider/{provider_id}/login": { - "get": { + }, + "options": { "tags": [ "hidden" ], - "summary": "Get a redirect straight to the SAML IdP.", - "description": "The UI uses this to avoid having to ask the API anything about the IdP. It already knows the SAML IdP ID from the path, so it can just link to this path and rely on the API to redirect to the actual IdP.", - "operationId": "get_auth_saml", - "parameters": [ - { - "in": "path", - "name": "provider_id", - "description": "The ID of the identity provider.", - "required": true, - "schema": { - "$ref": "#/components/schemas/Uuid" - } - }, - { - "in": "query", - "name": "callback_url", - "description": "The URL to redirect back to after we have authenticated.", - "schema": { - "nullable": true, - "type": "string", - "format": "uri" - } - } - ], + "summary": "OPTIONS endpoint.", + "description": "This is necessary for some preflight requests, specifically POST, PUT, and DELETE.", + "operationId": "options_create_debug_uploads", "responses": { - "302": { - "description": "Temporary Redirect", + "204": { + "description": "successful operation, no content", "headers": { "Access-Control-Allow-Credentials": { "description": "Access-Control-Allow-Credentials header.", @@ -1608,38 +1591,31 @@ "$ref": "#/components/responses/Error" } } - }, + } + }, + "/events": { "post": { "tags": [ + "meta", "hidden" ], - "summary": "Authenticate a user via SAML", - "operationId": "post_auth_saml", - "parameters": [ - { - "in": "path", - "name": "provider_id", - "description": "The ID of the identity provider.", - "required": true, - "schema": { - "$ref": "#/components/schemas/Uuid" - } - } - ], + "summary": "Creates an internal telemetry event.", + "description": "We collect anonymous telemetry data for improving our product.", + "operationId": "create_event", "requestBody": { + "description": "Telemetry requests", "content": { - "application/octet-stream": { + "multipart/form-data": { "schema": { - "type": "string", - "format": "binary" + "$ref": "#/components/schemas/Event" } } }, "required": true }, "responses": { - "302": { - "description": "Temporary Redirect", + "204": { + "description": "resource updated", "headers": { "Access-Control-Allow-Credentials": { "description": "Access-Control-Allow-Credentials header.", @@ -1672,14 +1648,6 @@ "schema": { "type": "string" } - }, - "Set-Cookie": { - "description": "Set-Cookie header.", - "style": "simple", - "required": true, - "schema": { - "type": "string" - } } } }, @@ -1697,18 +1665,7 @@ ], "summary": "OPTIONS endpoint.", "description": "This is necessary for some preflight requests, specifically POST, PUT, and DELETE.", - "operationId": "options_auth_saml", - "parameters": [ - { - "in": "path", - "name": "provider_id", - "description": "The ID of the identity provider.", - "required": true, - "schema": { - "$ref": "#/components/schemas/Uuid" - } - } - ], + "operationId": "options_create_event", "responses": { "204": { "description": "successful operation, no content", @@ -1756,18 +1713,36 @@ } } }, - "/debug/uploads": { + "/file/center-of-mass": { "post": { "tags": [ - "meta", - "hidden" + "file" + ], + "summary": "Get CAD file center of mass.", + "description": "We assume any file given to us has one consistent unit throughout. We also assume the file is at the proper scale.\nThis endpoint returns the cartesian coordinate in world space measure units.\nIn the future, we will use the units inside the file if they are given and do any conversions if necessary for the calculation. But currently, that is not supported.\nGet the center of mass of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously.\nIf the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.", + "operationId": "create_file_center_of_mass", + "parameters": [ + { + "in": "query", + "name": "output_unit", + "description": "The output unit for the center of mass.", + "schema": { + "$ref": "#/components/schemas/UnitLength" + } + }, + { + "in": "query", + "name": "src_format", + "description": "The format of the file.", + "required": true, + "schema": { + "$ref": "#/components/schemas/FileImportFormat" + } + } ], - "summary": "Uploads files to public blob storage for debugging purposes.", - "description": "Do NOT send files here that you don't want to be public.", - "operationId": "create_debug_uploads", "requestBody": { "content": { - "multipart/form-data": { + "application/octet-stream": { "schema": { "type": "string", "format": "binary" @@ -1816,12 +1791,7 @@ "content": { "application/json": { "schema": { - "title": "Array_of_Url", - "type": "array", - "items": { - "type": "string", - "format": "uri" - } + "$ref": "#/components/schemas/FileCenterOfMass" } } } @@ -1840,7 +1810,7 @@ ], "summary": "OPTIONS endpoint.", "description": "This is necessary for some preflight requests, specifically POST, PUT, and DELETE.", - "operationId": "options_create_debug_uploads", + "operationId": "options_file_center_of_mass", "responses": { "204": { "description": "successful operation, no content", @@ -1888,29 +1858,48 @@ } } }, - "/events": { + "/file/conversion/{src_format}/{output_format}": { "post": { "tags": [ - "meta", - "hidden" + "file" + ], + "summary": "Convert CAD file with defaults.", + "description": "If you wish to specify the conversion options, use the `/file/conversion` endpoint instead.\nConvert a CAD file from one format to another. If the file being converted is larger than 25MB, it will be performed asynchronously.\nIf the conversion is performed synchronously, the contents of the converted file (`output`) will be returned as a base64 encoded string.\nIf the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.", + "operationId": "create_file_conversion", + "parameters": [ + { + "in": "path", + "name": "output_format", + "description": "The format the file should be converted to.", + "required": true, + "schema": { + "$ref": "#/components/schemas/FileExportFormat" + } + }, + { + "in": "path", + "name": "src_format", + "description": "The format of the file to convert.", + "required": true, + "schema": { + "$ref": "#/components/schemas/FileImportFormat" + } + } ], - "summary": "Creates an internal telemetry event.", - "description": "We collect anonymous telemetry data for improving our product.", - "operationId": "create_event", "requestBody": { - "description": "Telemetry requests", "content": { - "multipart/form-data": { + "application/octet-stream": { "schema": { - "$ref": "#/components/schemas/Event" + "type": "string", + "format": "binary" } } }, "required": true }, "responses": { - "204": { - "description": "resource updated", + "201": { + "description": "successful creation", "headers": { "Access-Control-Allow-Credentials": { "description": "Access-Control-Allow-Credentials header.", @@ -1944,6 +1933,13 @@ "type": "string" } } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FileConversion" + } + } } }, "4XX": { @@ -1960,7 +1956,27 @@ ], "summary": "OPTIONS endpoint.", "description": "This is necessary for some preflight requests, specifically POST, PUT, and DELETE.", - "operationId": "options_create_event", + "operationId": "options_file_conversion", + "parameters": [ + { + "in": "path", + "name": "output_format", + "description": "The format the file should be converted to.", + "required": true, + "schema": { + "$ref": "#/components/schemas/FileExportFormat" + } + }, + { + "in": "path", + "name": "src_format", + "description": "The format of the file to convert.", + "required": true, + "schema": { + "$ref": "#/components/schemas/FileImportFormat" + } + } + ], "responses": { "204": { "description": "successful operation, no content", @@ -2008,21 +2024,39 @@ } } }, - "/file/center-of-mass": { + "/file/density": { "post": { "tags": [ "file" ], - "summary": "Get CAD file center of mass.", - "description": "We assume any file given to us has one consistent unit throughout. We also assume the file is at the proper scale.\nThis endpoint returns the cartesian coordinate in world space measure units.\nIn the future, we will use the units inside the file if they are given and do any conversions if necessary for the calculation. But currently, that is not supported.\nGet the center of mass of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously.\nIf the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.", - "operationId": "create_file_center_of_mass", + "summary": "Get CAD file density.", + "description": "We assume any file given to us has one consistent unit throughout. We also assume the file is at the proper scale.\nThis endpoint assumes if you are giving a material mass in a specific mass units, we return a density in mass unit per cubic measure unit.\nIn the future, we will use the units inside the file if they are given and do any conversions if necessary for the calculation. But currently, that is not supported.\nGet the density of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously.\nIf the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.", + "operationId": "create_file_density", "parameters": [ + { + "in": "query", + "name": "material_mass", + "description": "The material mass.", + "required": true, + "schema": { + "type": "number", + "format": "double" + } + }, + { + "in": "query", + "name": "material_mass_unit", + "description": "The unit of the material mass.", + "schema": { + "$ref": "#/components/schemas/UnitMass" + } + }, { "in": "query", "name": "output_unit", - "description": "The output unit for the center of mass.", + "description": "The output unit for the density.", "schema": { - "$ref": "#/components/schemas/UnitLength" + "$ref": "#/components/schemas/UnitDensity" } }, { @@ -2086,7 +2120,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/FileCenterOfMass" + "$ref": "#/components/schemas/FileDensity" } } } @@ -2105,7 +2139,7 @@ ], "summary": "OPTIONS endpoint.", "description": "This is necessary for some preflight requests, specifically POST, PUT, and DELETE.", - "operationId": "options_file_center_of_mass", + "operationId": "options_file_density", "responses": { "204": { "description": "successful operation, no content", @@ -2153,31 +2187,31 @@ } } }, - "/file/conversion/{src_format}/{output_format}": { + "/file/execute/{lang}": { "post": { "tags": [ - "file" + "executor", + "hidden" ], - "summary": "Convert CAD file with defaults.", - "description": "If you wish to specify the conversion options, use the `/file/conversion` endpoint instead.\nConvert a CAD file from one format to another. If the file being converted is larger than 25MB, it will be performed asynchronously.\nIf the conversion is performed synchronously, the contents of the converted file (`output`) will be returned as a base64 encoded string.\nIf the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.", - "operationId": "create_file_conversion", + "summary": "Execute a Zoo program in a specific language.", + "operationId": "create_file_execution", "parameters": [ { "in": "path", - "name": "output_format", - "description": "The format the file should be converted to.", + "name": "lang", + "description": "The language of the code.", "required": true, "schema": { - "$ref": "#/components/schemas/FileExportFormat" + "$ref": "#/components/schemas/CodeLanguage" } }, { - "in": "path", - "name": "src_format", - "description": "The format of the file to convert.", - "required": true, + "in": "query", + "name": "output", + "description": "The output file we want to get the contents for (the paths are relative to where in litterbox it is being run). You can denote more than one file with a comma separated list of string paths.", "schema": { - "$ref": "#/components/schemas/FileImportFormat" + "nullable": true, + "type": "string" } } ], @@ -2232,7 +2266,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/FileConversion" + "$ref": "#/components/schemas/CodeOutput" } } } @@ -2251,24 +2285,15 @@ ], "summary": "OPTIONS endpoint.", "description": "This is necessary for some preflight requests, specifically POST, PUT, and DELETE.", - "operationId": "options_file_conversion", + "operationId": "options_file_execution", "parameters": [ { "in": "path", - "name": "output_format", - "description": "The format the file should be converted to.", - "required": true, - "schema": { - "$ref": "#/components/schemas/FileExportFormat" - } - }, - { - "in": "path", - "name": "src_format", - "description": "The format of the file to convert.", + "name": "lang", + "description": "The language of the code.", "required": true, "schema": { - "$ref": "#/components/schemas/FileImportFormat" + "$ref": "#/components/schemas/CodeLanguage" } } ], @@ -2319,19 +2344,19 @@ } } }, - "/file/density": { + "/file/mass": { "post": { "tags": [ "file" ], - "summary": "Get CAD file density.", - "description": "We assume any file given to us has one consistent unit throughout. We also assume the file is at the proper scale.\nThis endpoint assumes if you are giving a material mass in a specific mass units, we return a density in mass unit per cubic measure unit.\nIn the future, we will use the units inside the file if they are given and do any conversions if necessary for the calculation. But currently, that is not supported.\nGet the density of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously.\nIf the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.", - "operationId": "create_file_density", + "summary": "Get CAD file mass.", + "description": "We assume any file given to us has one consistent unit throughout. We also assume the file is at the proper scale.\nThis endpoint assumes if you are giving a material density in a specific mass unit per cubic measure unit, we return a mass in mass units. The same mass units as passed in the material density.\nIn the future, we will use the units inside the file if they are given and do any conversions if necessary for the calculation. But currently, that is not supported.\nGet the mass of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously.\nIf the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.", + "operationId": "create_file_mass", "parameters": [ { "in": "query", - "name": "material_mass", - "description": "The material mass.", + "name": "material_density", + "description": "The material density.", "required": true, "schema": { "type": "number", @@ -2340,18 +2365,18 @@ }, { "in": "query", - "name": "material_mass_unit", - "description": "The unit of the material mass.", + "name": "material_density_unit", + "description": "The unit of the material density.", "schema": { - "$ref": "#/components/schemas/UnitMass" + "$ref": "#/components/schemas/UnitDensity" } }, { "in": "query", "name": "output_unit", - "description": "The output unit for the density.", + "description": "The output unit for the mass.", "schema": { - "$ref": "#/components/schemas/UnitDensity" + "$ref": "#/components/schemas/UnitMass" } }, { @@ -2415,7 +2440,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/FileDensity" + "$ref": "#/components/schemas/FileMass" } } } @@ -2434,7 +2459,7 @@ ], "summary": "OPTIONS endpoint.", "description": "This is necessary for some preflight requests, specifically POST, PUT, and DELETE.", - "operationId": "options_file_density", + "operationId": "options_file_mass", "responses": { "204": { "description": "successful operation, no content", @@ -2482,31 +2507,30 @@ } } }, - "/file/execute/{lang}": { + "/file/surface-area": { "post": { "tags": [ - "executor", - "hidden" + "file" ], - "summary": "Execute a Zoo program in a specific language.", - "operationId": "create_file_execution", + "summary": "Get CAD file surface area.", + "description": "We assume any file given to us has one consistent unit throughout. We also assume the file is at the proper scale.\nThis endpoint returns the square measure units.\nIn the future, we will use the units inside the file if they are given and do any conversions if necessary for the calculation. But currently, that is not supported.\nGet the surface area of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously.\nIf the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.", + "operationId": "create_file_surface_area", "parameters": [ { - "in": "path", - "name": "lang", - "description": "The language of the code.", - "required": true, + "in": "query", + "name": "output_unit", + "description": "The output unit for the surface area.", "schema": { - "$ref": "#/components/schemas/CodeLanguage" + "$ref": "#/components/schemas/UnitArea" } }, { "in": "query", - "name": "output", - "description": "The output file we want to get the contents for (the paths are relative to where in litterbox it is being run). You can denote more than one file with a comma separated list of string paths.", + "name": "src_format", + "description": "The format of the file.", + "required": true, "schema": { - "nullable": true, - "type": "string" + "$ref": "#/components/schemas/FileImportFormat" } } ], @@ -2561,7 +2585,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CodeOutput" + "$ref": "#/components/schemas/FileSurfaceArea" } } } @@ -2580,18 +2604,7 @@ ], "summary": "OPTIONS endpoint.", "description": "This is necessary for some preflight requests, specifically POST, PUT, and DELETE.", - "operationId": "options_file_execution", - "parameters": [ - { - "in": "path", - "name": "lang", - "description": "The language of the code.", - "required": true, - "schema": { - "$ref": "#/components/schemas/CodeLanguage" - } - } - ], + "operationId": "options_file_surface_area", "responses": { "204": { "description": "successful operation, no content", @@ -2639,39 +2652,21 @@ } } }, - "/file/mass": { + "/file/volume": { "post": { "tags": [ "file" ], - "summary": "Get CAD file mass.", - "description": "We assume any file given to us has one consistent unit throughout. We also assume the file is at the proper scale.\nThis endpoint assumes if you are giving a material density in a specific mass unit per cubic measure unit, we return a mass in mass units. The same mass units as passed in the material density.\nIn the future, we will use the units inside the file if they are given and do any conversions if necessary for the calculation. But currently, that is not supported.\nGet the mass of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously.\nIf the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.", - "operationId": "create_file_mass", + "summary": "Get CAD file volume.", + "description": "We assume any file given to us has one consistent unit throughout. We also assume the file is at the proper scale.\nThis endpoint returns the cubic measure units.\nIn the future, we will use the units inside the file if they are given and do any conversions if necessary for the calculation. But currently, that is not supported.\nGet the volume of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously.\nIf the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.", + "operationId": "create_file_volume", "parameters": [ - { - "in": "query", - "name": "material_density", - "description": "The material density.", - "required": true, - "schema": { - "type": "number", - "format": "double" - } - }, - { - "in": "query", - "name": "material_density_unit", - "description": "The unit of the material density.", - "schema": { - "$ref": "#/components/schemas/UnitDensity" - } - }, { "in": "query", "name": "output_unit", - "description": "The output unit for the mass.", + "description": "The output unit for the volume.", "schema": { - "$ref": "#/components/schemas/UnitMass" + "$ref": "#/components/schemas/UnitVolume" } }, { @@ -2735,7 +2730,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/FileMass" + "$ref": "#/components/schemas/FileVolume" } } } @@ -2754,7 +2749,7 @@ ], "summary": "OPTIONS endpoint.", "description": "This is necessary for some preflight requests, specifically POST, PUT, and DELETE.", - "operationId": "options_file_mass", + "operationId": "options_file_volume", "responses": { "204": { "description": "successful operation, no content", @@ -2802,47 +2797,29 @@ } } }, - "/file/surface-area": { - "post": { + "/internal/discord/api-token/{discord_id}": { + "get": { "tags": [ - "file" + "meta", + "hidden" ], - "summary": "Get CAD file surface area.", - "description": "We assume any file given to us has one consistent unit throughout. We also assume the file is at the proper scale.\nThis endpoint returns the square measure units.\nIn the future, we will use the units inside the file if they are given and do any conversions if necessary for the calculation. But currently, that is not supported.\nGet the surface area of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously.\nIf the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.", - "operationId": "create_file_surface_area", + "summary": "Get an API token for a user by their discord id.", + "description": "This endpoint allows us to run API calls from our discord bot on behalf of a user. The user must have a discord account linked to their Zoo Account via oauth2 for this to work.\nYou must be a Zoo employee to use this endpoint.", + "operationId": "internal_get_api_token_for_discord_user", "parameters": [ { - "in": "query", - "name": "output_unit", - "description": "The output unit for the surface area.", - "schema": { - "$ref": "#/components/schemas/UnitArea" - } - }, - { - "in": "query", - "name": "src_format", - "description": "The format of the file.", + "in": "path", + "name": "discord_id", + "description": "The user's discord ID.", "required": true, "schema": { - "$ref": "#/components/schemas/FileImportFormat" + "type": "string" } } ], - "requestBody": { - "content": { - "application/octet-stream": { - "schema": { - "type": "string", - "format": "binary" - } - } - }, - "required": true - }, "responses": { - "201": { - "description": "successful creation", + "200": { + "description": "successful operation", "headers": { "Access-Control-Allow-Credentials": { "description": "Access-Control-Allow-Credentials header.", @@ -2880,7 +2857,70 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/FileSurfaceArea" + "$ref": "#/components/schemas/ApiToken" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + } + }, + "/logout": { + "post": { + "tags": [ + "hidden" + ], + "summary": "This endpoint removes the session cookie for a user.", + "description": "This is used in logout scenarios.", + "operationId": "logout", + "responses": { + "204": { + "description": "resource updated", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "style": "simple", + "required": true, + "schema": { + "type": "string" + } + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "style": "simple", + "required": true, + "schema": { + "type": "string" + } + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "style": "simple", + "required": true, + "schema": { + "type": "string" + } + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "style": "simple", + "required": true, + "schema": { + "type": "string" + } + }, + "Set-Cookie": { + "description": "Set-Cookie header.", + "style": "simple", + "required": true, + "schema": { + "type": "string" } } } @@ -2899,7 +2939,7 @@ ], "summary": "OPTIONS endpoint.", "description": "This is necessary for some preflight requests, specifically POST, PUT, and DELETE.", - "operationId": "options_file_surface_area", + "operationId": "options_logout", "responses": { "204": { "description": "successful operation, no content", @@ -2947,47 +2987,125 @@ } } }, - "/file/volume": { - "post": { + "/ml-prompts": { + "get": { "tags": [ - "file" + "ml", + "hidden" ], - "summary": "Get CAD file volume.", - "description": "We assume any file given to us has one consistent unit throughout. We also assume the file is at the proper scale.\nThis endpoint returns the cubic measure units.\nIn the future, we will use the units inside the file if they are given and do any conversions if necessary for the calculation. But currently, that is not supported.\nGet the volume of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously.\nIf the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.", - "operationId": "create_file_volume", + "summary": "List all ML prompts.", + "description": "For text-to-cad prompts, this will always return the STEP file contents as well as the format the user originally requested.\nThis endpoint requires authentication by a Zoo employee.\nThe ML prompts are returned in order of creation, with the most recently created ML prompts first.", + "operationId": "list_ml_prompts", "parameters": [ { "in": "query", - "name": "output_unit", - "description": "The output unit for the volume.", + "name": "limit", + "description": "Maximum number of items returned by a single call", "schema": { - "$ref": "#/components/schemas/UnitVolume" + "nullable": true, + "type": "integer", + "format": "uint32", + "minimum": 1 } }, { "in": "query", - "name": "src_format", - "description": "The format of the file.", - "required": true, + "name": "page_token", + "description": "Token returned by previous call to retrieve the subsequent page", "schema": { - "$ref": "#/components/schemas/FileImportFormat" + "nullable": true, + "type": "string" + } + }, + { + "in": "query", + "name": "sort_by", + "schema": { + "$ref": "#/components/schemas/CreatedAtSortMode" } } ], - "requestBody": { - "content": { - "application/octet-stream": { - "schema": { - "type": "string", - "format": "binary" + "responses": { + "200": { + "description": "successful operation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "style": "simple", + "required": true, + "schema": { + "type": "string" + } + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "style": "simple", + "required": true, + "schema": { + "type": "string" + } + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "style": "simple", + "required": true, + "schema": { + "type": "string" + } + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "style": "simple", + "required": true, + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MlPromptResultsPage" + } } } }, - "required": true + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } }, + "x-dropshot-pagination": { + "required": [] + } + } + }, + "/ml-prompts/{id}": { + "get": { + "tags": [ + "ml", + "hidden" + ], + "summary": "Get a ML prompt.", + "description": "This endpoint requires authentication by a Zoo employee.", + "operationId": "get_ml_prompt", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "The id of the model to give feedback to.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], "responses": { - "201": { - "description": "successful creation", + "200": { + "description": "successful operation", "headers": { "Access-Control-Allow-Credentials": { "description": "Access-Control-Allow-Credentials header.", @@ -3025,7 +3143,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/FileVolume" + "$ref": "#/components/schemas/MlPrompt" } } } @@ -3037,17 +3155,29 @@ "$ref": "#/components/responses/Error" } } - }, - "options": { + } + }, + "/ml/kcl/completions": { + "post": { "tags": [ - "hidden" + "ml", + "beta" ], - "summary": "OPTIONS endpoint.", - "description": "This is necessary for some preflight requests, specifically POST, PUT, and DELETE.", - "operationId": "options_file_volume", + "summary": "Generate code completions for KCL.", + "operationId": "create_kcl_code_completions", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/KclCodeCompletionRequest" + } + } + }, + "required": true + }, "responses": { - "204": { - "description": "successful operation, no content", + "201": { + "description": "successful creation", "headers": { "Access-Control-Allow-Credentials": { "description": "Access-Control-Allow-Credentials header.", @@ -3081,6 +3211,13 @@ "type": "string" } } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/KclCodeCompletionResponse" + } + } } }, "4XX": { @@ -3090,31 +3227,17 @@ "$ref": "#/components/responses/Error" } } - } - }, - "/internal/discord/api-token/{discord_id}": { - "get": { + }, + "options": { "tags": [ - "meta", "hidden" ], - "summary": "Get an API token for a user by their discord id.", - "description": "This endpoint allows us to run API calls from our discord bot on behalf of a user. The user must have a discord account linked to their Zoo Account via oauth2 for this to work.\nYou must be a Zoo employee to use this endpoint.", - "operationId": "internal_get_api_token_for_discord_user", - "parameters": [ - { - "in": "path", - "name": "discord_id", - "description": "The user's discord ID.", - "required": true, - "schema": { - "type": "string" - } - } - ], + "summary": "OPTIONS endpoint.", + "description": "This is necessary for some preflight requests, specifically POST, PUT, and DELETE.", + "operationId": "options_kcl_code_completions", "responses": { - "200": { - "description": "successful operation", + "204": { + "description": "successful operation, no content", "headers": { "Access-Control-Allow-Credentials": { "description": "Access-Control-Allow-Credentials header.", @@ -3148,13 +3271,6 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ApiToken" - } - } } }, "4XX": { @@ -3166,17 +3282,27 @@ } } }, - "/logout": { + "/ml/text-to-cad/iteration": { "post": { "tags": [ - "hidden" + "ml" ], - "summary": "This endpoint removes the session cookie for a user.", - "description": "This is used in logout scenarios.", - "operationId": "logout", + "summary": "Iterate on a CAD model with a prompt.", + "description": "This operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.", + "operationId": "create_text_to_cad_iteration", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TextToCadIterationBody" + } + } + }, + "required": true + }, "responses": { - "204": { - "description": "resource updated", + "201": { + "description": "successful creation", "headers": { "Access-Control-Allow-Credentials": { "description": "Access-Control-Allow-Credentials header.", @@ -3209,13 +3335,12 @@ "schema": { "type": "string" } - }, - "Set-Cookie": { - "description": "Set-Cookie header.", - "style": "simple", - "required": true, + } + }, + "content": { + "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/TextToCadIteration" } } } @@ -3234,7 +3359,7 @@ ], "summary": "OPTIONS endpoint.", "description": "This is necessary for some preflight requests, specifically POST, PUT, and DELETE.", - "operationId": "options_logout", + "operationId": "options_text_to_cad_iteration", "responses": { "204": { "description": "successful operation, no content", @@ -11523,7 +11648,7 @@ "description": "The feedback.", "required": true, "schema": { - "$ref": "#/components/schemas/AiFeedback" + "$ref": "#/components/schemas/MlFeedback" } } ], @@ -12440,306 +12565,112 @@ { "description": "The Apple account provider.", "type": "string", - "enum": [ - "apple" - ] - }, - { - "description": "The Discord account provider.", - "type": "string", - "enum": [ - "discord" - ] - }, - { - "description": "The Google account provider.", - "type": "string", - "enum": [ - "google" - ] - }, - { - "description": "The GitHub account provider.", - "type": "string", - "enum": [ - "github" - ] - }, - { - "description": "The Microsoft account provider.", - "type": "string", - "enum": [ - "microsoft" - ] - }, - { - "description": "The SAML account provider.", - "type": "string", - "enum": [ - "saml" - ] - }, - { - "description": "The Tencent QQ account provider.", - "type": "string", - "enum": [ - "tencent" - ] - } - ] - }, - "AddOrgMember": { - "description": "Data for adding a member to an org.", - "type": "object", - "properties": { - "email": { - "description": "The email address of the user to add to the org.", - "type": "string", - "format": "email" - }, - "role": { - "description": "The organization role to give the user.", - "allOf": [ - { - "$ref": "#/components/schemas/UserOrgRole" - } - ] - } - }, - "required": [ - "email", - "role" - ] - }, - "AddressDetails": { - "description": "Address details.", - "type": "object", - "properties": { - "city": { - "description": "The city component.", - "type": "string" - }, - "country": { - "description": "The country component. This is a two-letter ISO country code.", - "allOf": [ - { - "$ref": "#/components/schemas/CountryCode" - } - ] - }, - "state": { - "description": "The state component.", - "type": "string" - }, - "street1": { - "description": "The first street component.", - "type": "string" - }, - "street2": { - "description": "The second street component.", - "type": "string" - }, - "zip": { - "description": "The zip component.", - "type": "string" - } - }, - "required": [ - "country" - ] - }, - "AiFeedback": { - "description": "Human feedback on an AI response.", - "oneOf": [ - { - "description": "Thumbs up.", - "type": "string", - "enum": [ - "thumbs_up" - ] - }, - { - "description": "Thumbs down.", - "type": "string", - "enum": [ - "thumbs_down" - ] - }, - { - "description": "Accepted.", - "type": "string", - "enum": [ - "accepted" - ] - }, - { - "description": "Rejected.", - "type": "string", - "enum": [ - "rejected" - ] - } - ] - }, - "AiPrompt": { - "description": "An AI prompt.", - "type": "object", - "properties": { - "completed_at": { - "nullable": true, - "title": "DateTime", - "description": "When the prompt was completed.", - "type": "string", - "format": "date-time" - }, - "created_at": { - "title": "DateTime", - "description": "The date and time the AI prompt was created.", - "type": "string", - "format": "date-time" - }, - "error": { - "nullable": true, - "description": "The error message if the prompt failed.", - "type": "string" - }, - "feedback": { - "nullable": true, - "description": "Feedback from the user, if any.", - "allOf": [ - { - "$ref": "#/components/schemas/AiFeedback" - } - ] - }, - "id": { - "description": "The unique identifier for the AI Prompt.", - "allOf": [ - { - "$ref": "#/components/schemas/Uuid" - } - ] - }, - "metadata": { - "nullable": true, - "description": "The metadata for the prompt.", - "allOf": [ - { - "$ref": "#/components/schemas/AiPromptMetadata" - } - ] - }, - "model_version": { - "description": "The version of the model.", - "type": "string" + "enum": [ + "apple" + ] }, - "output_file": { - "nullable": true, - "description": "The output file. In the case of TextToCad this is a link to a file in a GCP bucket.", - "type": "string" + { + "description": "The Discord account provider.", + "type": "string", + "enum": [ + "discord" + ] }, - "prompt": { - "description": "The prompt.", - "type": "string" + { + "description": "The Google account provider.", + "type": "string", + "enum": [ + "google" + ] }, - "started_at": { - "nullable": true, - "title": "DateTime", - "description": "When the prompt was started.", + { + "description": "The GitHub account provider.", "type": "string", - "format": "date-time" + "enum": [ + "github" + ] }, - "status": { - "description": "The status of the prompt.", - "allOf": [ - { - "$ref": "#/components/schemas/ApiCallStatus" - } + { + "description": "The Microsoft account provider.", + "type": "string", + "enum": [ + "microsoft" ] }, - "type": { - "description": "The type of prompt.", - "allOf": [ - { - "$ref": "#/components/schemas/AiPromptType" - } + { + "description": "The SAML account provider.", + "type": "string", + "enum": [ + "saml" ] }, - "updated_at": { - "title": "DateTime", - "description": "The date and time the AI prompt was last updated.", + { + "description": "The Tencent QQ account provider.", "type": "string", - "format": "date-time" + "enum": [ + "tencent" + ] + } + ] + }, + "AddOrgMember": { + "description": "Data for adding a member to an org.", + "type": "object", + "properties": { + "email": { + "description": "The email address of the user to add to the org.", + "type": "string", + "format": "email" }, - "user_id": { - "description": "The user ID of the user who created the AI Prompt.", + "role": { + "description": "The organization role to give the user.", "allOf": [ { - "$ref": "#/components/schemas/Uuid" + "$ref": "#/components/schemas/UserOrgRole" } ] } }, "required": [ - "created_at", - "id", - "model_version", - "prompt", - "status", - "type", - "updated_at", - "user_id" + "email", + "role" ] }, - "AiPromptMetadata": { - "description": "Metadata for an AI prompt.", + "AddressDetails": { + "description": "Address details.", "type": "object", "properties": { - "code": { - "nullable": true, - "description": "Code for the model.", + "city": { + "description": "The city component.", "type": "string" - } - } - }, - "AiPromptResultsPage": { - "description": "A single page of results", - "type": "object", - "properties": { - "items": { - "description": "list of items on this page of results", - "type": "array", - "items": { - "$ref": "#/components/schemas/AiPrompt" - } }, - "next_page": { - "nullable": true, - "description": "token used to fetch the next page of results (if any)", + "country": { + "description": "The country component. This is a two-letter ISO country code.", + "allOf": [ + { + "$ref": "#/components/schemas/CountryCode" + } + ] + }, + "state": { + "description": "The state component.", + "type": "string" + }, + "street1": { + "description": "The first street component.", + "type": "string" + }, + "street2": { + "description": "The second street component.", + "type": "string" + }, + "zip": { + "description": "The zip component.", "type": "string" } }, "required": [ - "items" - ] - }, - "AiPromptType": { - "description": "A type of AI prompt.", - "oneOf": [ - { - "description": "Text to CAD.", - "type": "string", - "enum": [ - "text_to_cad" - ] - }, - { - "description": "Text to KCL.", - "type": "string", - "enum": [ - "text_to_kcl" - ] - } + "country" ] }, "Angle": { @@ -14086,7 +14017,7 @@ "description": "Feedback from the user, if any.", "allOf": [ { - "$ref": "#/components/schemas/AiFeedback" + "$ref": "#/components/schemas/MlFeedback" } ] }, @@ -14179,6 +14110,127 @@ "updated_at", "user_id" ] + }, + { + "description": "Text to CAD iteration.", + "type": "object", + "properties": { + "code": { + "description": "The code for the new model.", + "type": "string" + }, + "completed_at": { + "nullable": true, + "title": "DateTime", + "description": "The time and date the API call was completed.", + "type": "string", + "format": "date-time" + }, + "created_at": { + "title": "DateTime", + "description": "The time and date the API call was created.", + "type": "string", + "format": "date-time" + }, + "error": { + "nullable": true, + "description": "The error the function returned, if any.", + "type": "string" + }, + "feedback": { + "nullable": true, + "description": "Feedback from the user, if any.", + "allOf": [ + { + "$ref": "#/components/schemas/MlFeedback" + } + ] + }, + "id": { + "description": "The unique identifier of the API call.\n\nThis is the same as the API call ID.", + "allOf": [ + { + "$ref": "#/components/schemas/Uuid" + } + ] + }, + "model": { + "description": "The model being used.", + "allOf": [ + { + "$ref": "#/components/schemas/TextToCadModel" + } + ] + }, + "model_version": { + "description": "The version of the model.", + "type": "string" + }, + "original_source_code": { + "description": "The original source code for the model, previous to the changes.", + "type": "string" + }, + "prompt": { + "nullable": true, + "description": "The prompt for the overall changes. This is optional if you only want changes on specific source ranges.", + "type": "string" + }, + "source_ranges": { + "description": "The source ranges the user suggested to change.", + "type": "array", + "items": { + "$ref": "#/components/schemas/SourceRangePrompt" + } + }, + "started_at": { + "nullable": true, + "title": "DateTime", + "description": "The time and date the API call was started.", + "type": "string", + "format": "date-time" + }, + "status": { + "description": "The status of the API call.", + "allOf": [ + { + "$ref": "#/components/schemas/ApiCallStatus" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "text_to_cad_iteration" + ] + }, + "updated_at": { + "title": "DateTime", + "description": "The time and date the API call was last updated.", + "type": "string", + "format": "date-time" + }, + "user_id": { + "description": "The user ID of the user who created the API call.", + "allOf": [ + { + "$ref": "#/components/schemas/Uuid" + } + ] + } + }, + "required": [ + "code", + "created_at", + "id", + "model", + "model_version", + "original_source_code", + "source_ranges", + "status", + "type", + "updated_at", + "user_id" + ] } ] }, @@ -14254,6 +14306,13 @@ "enum": [ "text_to_cad" ] + }, + { + "description": "Text to CAD iteration.", + "type": "string", + "enum": [ + "text_to_cad_iteration" + ] } ] }, @@ -18497,98 +18556,311 @@ } ] }, - "git_hash": { - "description": "The git hash of the server.", + "git_hash": { + "description": "The git hash of the server.", + "type": "string" + }, + "pubsub": { + "description": "Metadata about our pub-sub connection.", + "allOf": [ + { + "$ref": "#/components/schemas/Connection" + } + ] + } + }, + "required": [ + "cache", + "environment", + "fs", + "git_hash", + "pubsub" + ] + }, + "Method": { + "description": "The Request Method (VERB)\n\nThis type also contains constants for a number of common HTTP methods such as GET, POST, etc.\n\nCurrently includes 8 variants representing the 8 methods defined in [RFC 7230](https://tools.ietf.org/html/rfc7231#section-4.1), plus PATCH, and an Extension variant for all extensions.", + "oneOf": [ + { + "description": "The `OPTIONS` method as defined in [RFC 7231](https://tools.ietf.org/html/rfc7231#section-4.2.1).", + "type": "string", + "enum": [ + "OPTIONS" + ] + }, + { + "description": "The `GET` method as defined in [RFC 7231](https://tools.ietf.org/html/rfc7231#section-4.3.1).", + "type": "string", + "enum": [ + "GET" + ] + }, + { + "description": "The `POST` method as defined in [RFC 7231](https://tools.ietf.org/html/rfc7231#section-4.3.1).", + "type": "string", + "enum": [ + "POST" + ] + }, + { + "description": "The `PUT` method as defined in [RFC 7231](https://tools.ietf.org/html/rfc7231#section-4.3.1).", + "type": "string", + "enum": [ + "PUT" + ] + }, + { + "description": "The `DELETE` method as defined in [RFC 7231](https://tools.ietf.org/html/rfc7231#section-4.3.5).", + "type": "string", + "enum": [ + "DELETE" + ] + }, + { + "description": "The `HEAD` method as defined in [RFC 7231](https://tools.ietf.org/html/rfc7231#section-4.3.2).", + "type": "string", + "enum": [ + "HEAD" + ] + }, + { + "description": "The `TRACE` method as defined in [RFC 7231](https://tools.ietf.org/html/rfc7231#section-4.3).", + "type": "string", + "enum": [ + "TRACE" + ] + }, + { + "description": "The `CONNECT` method as defined in [RFC 7231](https://tools.ietf.org/html/rfc7231#section-4.3.6).", + "type": "string", + "enum": [ + "CONNECT" + ] + }, + { + "description": "The `PATCH` method as defined in [RFC 5789](https://tools.ietf.org/html/rfc5789).", + "type": "string", + "enum": [ + "PATCH" + ] + }, + { + "description": "A catch all.", + "type": "string", + "enum": [ + "EXTENSION" + ] + } + ] + }, + "MlFeedback": { + "description": "Human feedback on an ML response.", + "oneOf": [ + { + "description": "Thumbs up.", + "type": "string", + "enum": [ + "thumbs_up" + ] + }, + { + "description": "Thumbs down.", + "type": "string", + "enum": [ + "thumbs_down" + ] + }, + { + "description": "Accepted.", + "type": "string", + "enum": [ + "accepted" + ] + }, + { + "description": "Rejected.", + "type": "string", + "enum": [ + "rejected" + ] + } + ] + }, + "MlPrompt": { + "description": "A ML prompt.", + "type": "object", + "properties": { + "completed_at": { + "nullable": true, + "title": "DateTime", + "description": "When the prompt was completed.", + "type": "string", + "format": "date-time" + }, + "created_at": { + "title": "DateTime", + "description": "The date and time the ML prompt was created.", + "type": "string", + "format": "date-time" + }, + "error": { + "nullable": true, + "description": "The error message if the prompt failed.", + "type": "string" + }, + "feedback": { + "nullable": true, + "description": "Feedback from the user, if any.", + "allOf": [ + { + "$ref": "#/components/schemas/MlFeedback" + } + ] + }, + "id": { + "description": "The unique identifier for the ML prompt.", + "allOf": [ + { + "$ref": "#/components/schemas/Uuid" + } + ] + }, + "metadata": { + "nullable": true, + "description": "The metadata for the prompt.", + "allOf": [ + { + "$ref": "#/components/schemas/MlPromptMetadata" + } + ] + }, + "model_version": { + "description": "The version of the model.", + "type": "string" + }, + "output_file": { + "nullable": true, + "description": "The output file. In the case of TextToCad this is a link to a file in a GCP bucket.", + "type": "string" + }, + "prompt": { + "description": "The prompt.", + "type": "string" + }, + "started_at": { + "nullable": true, + "title": "DateTime", + "description": "When the prompt was started.", + "type": "string", + "format": "date-time" + }, + "status": { + "description": "The status of the prompt.", + "allOf": [ + { + "$ref": "#/components/schemas/ApiCallStatus" + } + ] + }, + "type": { + "description": "The type of prompt.", + "allOf": [ + { + "$ref": "#/components/schemas/MlPromptType" + } + ] + }, + "updated_at": { + "title": "DateTime", + "description": "The date and time the ML prompt was last updated.", + "type": "string", + "format": "date-time" + }, + "user_id": { + "description": "The user ID of the user who created the ML prompt.", + "allOf": [ + { + "$ref": "#/components/schemas/Uuid" + } + ] + } + }, + "required": [ + "created_at", + "id", + "model_version", + "prompt", + "status", + "type", + "updated_at", + "user_id" + ] + }, + "MlPromptMetadata": { + "description": "Metadata for a ML prompt.", + "type": "object", + "properties": { + "code": { + "nullable": true, + "description": "Code for the model.", + "type": "string" + }, + "original_source_code": { + "nullable": true, + "description": "The original source code for the model.", + "type": "string" + }, + "source_ranges": { + "description": "The source ranges the user suggested to change.", + "type": "array", + "items": { + "$ref": "#/components/schemas/SourceRangePrompt" + } + } + } + }, + "MlPromptResultsPage": { + "description": "A single page of results", + "type": "object", + "properties": { + "items": { + "description": "list of items on this page of results", + "type": "array", + "items": { + "$ref": "#/components/schemas/MlPrompt" + } + }, + "next_page": { + "nullable": true, + "description": "token used to fetch the next page of results (if any)", "type": "string" - }, - "pubsub": { - "description": "Metadata about our pub-sub connection.", - "allOf": [ - { - "$ref": "#/components/schemas/Connection" - } - ] } }, "required": [ - "cache", - "environment", - "fs", - "git_hash", - "pubsub" + "items" ] }, - "Method": { - "description": "The Request Method (VERB)\n\nThis type also contains constants for a number of common HTTP methods such as GET, POST, etc.\n\nCurrently includes 8 variants representing the 8 methods defined in [RFC 7230](https://tools.ietf.org/html/rfc7231#section-4.1), plus PATCH, and an Extension variant for all extensions.", + "MlPromptType": { + "description": "A type of ML prompt.", "oneOf": [ { - "description": "The `OPTIONS` method as defined in [RFC 7231](https://tools.ietf.org/html/rfc7231#section-4.2.1).", - "type": "string", - "enum": [ - "OPTIONS" - ] - }, - { - "description": "The `GET` method as defined in [RFC 7231](https://tools.ietf.org/html/rfc7231#section-4.3.1).", - "type": "string", - "enum": [ - "GET" - ] - }, - { - "description": "The `POST` method as defined in [RFC 7231](https://tools.ietf.org/html/rfc7231#section-4.3.1).", - "type": "string", - "enum": [ - "POST" - ] - }, - { - "description": "The `PUT` method as defined in [RFC 7231](https://tools.ietf.org/html/rfc7231#section-4.3.1).", - "type": "string", - "enum": [ - "PUT" - ] - }, - { - "description": "The `DELETE` method as defined in [RFC 7231](https://tools.ietf.org/html/rfc7231#section-4.3.5).", - "type": "string", - "enum": [ - "DELETE" - ] - }, - { - "description": "The `HEAD` method as defined in [RFC 7231](https://tools.ietf.org/html/rfc7231#section-4.3.2).", - "type": "string", - "enum": [ - "HEAD" - ] - }, - { - "description": "The `TRACE` method as defined in [RFC 7231](https://tools.ietf.org/html/rfc7231#section-4.3).", - "type": "string", - "enum": [ - "TRACE" - ] - }, - { - "description": "The `CONNECT` method as defined in [RFC 7231](https://tools.ietf.org/html/rfc7231#section-4.3.6).", + "description": "Text to CAD.", "type": "string", "enum": [ - "CONNECT" + "text_to_cad" ] }, { - "description": "The `PATCH` method as defined in [RFC 5789](https://tools.ietf.org/html/rfc5789).", + "description": "Text to KCL.", "type": "string", "enum": [ - "PATCH" + "text_to_kcl" ] }, { - "description": "A catch all.", + "description": "Text to Kcl iteration,", "type": "string", "enum": [ - "EXTENSION" + "text_to_kcl_iteration" ] } ] @@ -25023,6 +25295,76 @@ } } }, + "SourcePosition": { + "description": "A position in the source code.", + "type": "object", + "properties": { + "column": { + "description": "The column number.", + "type": "integer", + "format": "uint32", + "minimum": 0 + }, + "line": { + "description": "The line number.", + "type": "integer", + "format": "uint32", + "minimum": 0 + } + }, + "required": [ + "column", + "line" + ] + }, + "SourceRange": { + "description": "A source range of code.", + "type": "object", + "properties": { + "end": { + "description": "The end of the range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourcePosition" + } + ] + }, + "start": { + "description": "The start of the range.", + "allOf": [ + { + "$ref": "#/components/schemas/SourcePosition" + } + ] + } + }, + "required": [ + "end", + "start" + ] + }, + "SourceRangePrompt": { + "description": "A source range and prompt for a text to CAD iteration.", + "type": "object", + "properties": { + "prompt": { + "description": "The prompt for the changes.", + "type": "string" + }, + "range": { + "description": "The range of the source code to change.", + "allOf": [ + { + "$ref": "#/components/schemas/SourceRange" + } + ] + } + }, + "required": [ + "prompt", + "range" + ] + }, "StlStorage": { "description": "Export storage.", "oneOf": [ @@ -25381,7 +25723,7 @@ "description": "Feedback from the user, if any.", "allOf": [ { - "$ref": "#/components/schemas/AiFeedback" + "$ref": "#/components/schemas/MlFeedback" } ] }, @@ -25481,6 +25823,146 @@ "prompt" ] }, + "TextToCadIteration": { + "description": "A response from a text to CAD iteration.", + "type": "object", + "properties": { + "code": { + "description": "The code for the new model.", + "type": "string" + }, + "completed_at": { + "nullable": true, + "title": "DateTime", + "description": "The time and date the API call was completed.", + "type": "string", + "format": "date-time" + }, + "created_at": { + "title": "DateTime", + "description": "The time and date the API call was created.", + "type": "string", + "format": "date-time" + }, + "error": { + "nullable": true, + "description": "The error the function returned, if any.", + "type": "string" + }, + "feedback": { + "nullable": true, + "description": "Feedback from the user, if any.", + "allOf": [ + { + "$ref": "#/components/schemas/MlFeedback" + } + ] + }, + "id": { + "description": "The unique identifier of the API call.\n\nThis is the same as the API call ID.", + "allOf": [ + { + "$ref": "#/components/schemas/Uuid" + } + ] + }, + "model": { + "description": "The model being used.", + "allOf": [ + { + "$ref": "#/components/schemas/TextToCadModel" + } + ] + }, + "model_version": { + "description": "The version of the model.", + "type": "string" + }, + "original_source_code": { + "description": "The original source code for the model, previous to the changes.", + "type": "string" + }, + "prompt": { + "nullable": true, + "description": "The prompt for the overall changes. This is optional if you only want changes on specific source ranges.", + "type": "string" + }, + "source_ranges": { + "description": "The source ranges the user suggested to change.", + "type": "array", + "items": { + "$ref": "#/components/schemas/SourceRangePrompt" + } + }, + "started_at": { + "nullable": true, + "title": "DateTime", + "description": "The time and date the API call was started.", + "type": "string", + "format": "date-time" + }, + "status": { + "description": "The status of the API call.", + "allOf": [ + { + "$ref": "#/components/schemas/ApiCallStatus" + } + ] + }, + "updated_at": { + "title": "DateTime", + "description": "The time and date the API call was last updated.", + "type": "string", + "format": "date-time" + }, + "user_id": { + "description": "The user ID of the user who created the API call.", + "allOf": [ + { + "$ref": "#/components/schemas/Uuid" + } + ] + } + }, + "required": [ + "code", + "created_at", + "id", + "model", + "model_version", + "original_source_code", + "source_ranges", + "status", + "updated_at", + "user_id" + ] + }, + "TextToCadIterationBody": { + "description": "Body for generating models from text.", + "type": "object", + "properties": { + "original_source_code": { + "description": "The source code for the model (in kcl) that is to be edited.", + "type": "string" + }, + "prompt": { + "nullable": true, + "description": "The prompt for the model, if not using source ranges.", + "type": "string" + }, + "source_ranges": { + "description": "The source ranges the user suggested to change. If empty, the prompt will be used and is required.", + "type": "array", + "items": { + "$ref": "#/components/schemas/SourceRangePrompt" + } + } + }, + "required": [ + "original_source_code", + "source_ranges" + ] + }, "TextToCadModel": { "description": "A type of Text-to-CAD model.", "oneOf": [ @@ -25497,6 +25979,13 @@ "enum": [ "kcl" ] + }, + { + "description": "KCL iteration.", + "type": "string", + "enum": [ + "kcl_iteration" + ] } ] },