From 6141d8ead07f04cd59648efe63a6e46556c74b03 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 11 Oct 2024 02:31:53 +0000 Subject: [PATCH 1/8] YOYO NEW API SPEC! --- spec.json | 1020 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 980 insertions(+), 40 deletions(-) diff --git a/spec.json b/spec.json index 89d8cba..e3df895 100644 --- a/spec.json +++ b/spec.json @@ -7915,6 +7915,109 @@ } } }, + "/org/shortlinks": { + "get": { + "tags": [ + "orgs", + "shortlinks" + ], + "summary": "Get the shortlinks for an org.", + "description": "This endpoint requires authentication by an org admin. It gets the shortlinks for the authenticated user's org.", + "operationId": "get_org_shortlinks", + "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": { + "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" + } + }, + "X-Api-Call-Id": { + "description": "ID for this request. We return it so that users can report this to us and help us debug their problems.", + "style": "simple", + "required": true, + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ShortlinkResultsPage" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + }, + "x-dropshot-pagination": { + "required": [] + } + } + }, "/orgs": { "get": { "tags": [ @@ -12645,15 +12748,571 @@ "5XX": { "$ref": "#/components/responses/Error" } - } - }, - "options": { - "tags": [ - "hidden" + } + }, + "options": { + "tags": [ + "hidden" + ], + "summary": "OPTIONS endpoint.", + "description": "This is necessary for some preflight requests, specifically POST, PUT, and DELETE.", + "operationId": "options_user_privacy_settings", + "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" + } + }, + "X-Api-Call-Id": { + "description": "ID for this request. We return it so that users can report this to us and help us debug their problems.", + "style": "simple", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + } + }, + "/user/session/{token}": { + "get": { + "tags": [ + "users" + ], + "summary": "Get a session for your user.", + "description": "This endpoint requires authentication by any Zoo user. It returns details of the requested API token for the user.", + "operationId": "get_session_for_user", + "parameters": [ + { + "in": "path", + "name": "token", + "description": "The API token.", + "required": true, + "schema": { + "$ref": "#/components/schemas/SessionUuid" + } + } + ], + "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" + } + }, + "X-Api-Call-Id": { + "description": "ID for this request. We return it so that users can report this to us and help us debug their problems.", + "style": "simple", + "required": true, + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Session" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + } + }, + "/user/shortlinks": { + "get": { + "tags": [ + "users", + "shortlinks" + ], + "summary": "Get the shortlinks for a user.", + "description": "This endpoint requires authentication by any Zoo user. It gets the shortlinks for the user.", + "operationId": "get_user_shortlinks", + "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": { + "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" + } + }, + "X-Api-Call-Id": { + "description": "ID for this request. We return it so that users can report this to us and help us debug their problems.", + "style": "simple", + "required": true, + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ShortlinkResultsPage" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + }, + "x-dropshot-pagination": { + "required": [] + } + }, + "post": { + "tags": [ + "users", + "shortlinks" + ], + "summary": "Create a shortlink for a user.", + "description": "This endpoint requires authentication by any Zoo user. It creates a shortlink for the user.", + "operationId": "create_user_shortlink", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateShortlinkRequest" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "successful creation", + "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" + } + }, + "X-Api-Call-Id": { + "description": "ID for this request. We return it so that users can report this to us and help us debug their problems.", + "style": "simple", + "required": true, + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateShortlinkResponse" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + }, + "options": { + "tags": [ + "hidden" + ], + "summary": "OPTIONS endpoint.", + "description": "This is necessary for some preflight requests, specifically POST, PUT, and DELETE.", + "operationId": "options_user_shortlinks", + "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" + } + }, + "X-Api-Call-Id": { + "description": "ID for this request. We return it so that users can report this to us and help us debug their problems.", + "style": "simple", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + } + }, + "/user/shortlinks/{key}": { + "get": { + "tags": [ + "hidden", + "users", + "shortlinks" + ], + "summary": "Redirect the user to the URL for the shortlink.", + "description": "This endpoint might require authentication by a Zoo user. It gets the shortlink for the user and redirects them to the URL. If the shortlink is owned by an org, the user must be a member of the org.", + "operationId": "redirect_user_shortlink", + "parameters": [ + { + "in": "path", + "name": "key", + "description": "The key of the shortlink.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "302": { + "description": "Temporary Redirect", + "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" + } + }, + "X-Api-Call-Id": { + "description": "ID for this request. We return it so that users can report this to us and help us debug their problems.", + "style": "simple", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + }, + "put": { + "tags": [ + "users", + "shortlinks" + ], + "summary": "Update a shortlink for a user.", + "description": "This endpoint requires authentication by any Zoo user. It updates a shortlink for the user.\n\nThis endpoint really only allows you to change the `restrict_to_org` setting of a shortlink. Thus it is only useful for folks who are part of an org. If you are not part of an org, you will not be able to change the `restrict_to_org` status.", + "operationId": "update_user_shortlink", + "parameters": [ + { + "in": "path", + "name": "key", + "description": "The key of the shortlink.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateShortlinkRequest" + } + } + }, + "required": true + }, + "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" + } + }, + "X-Api-Call-Id": { + "description": "ID for this request. We return it so that users can report this to us and help us debug their problems.", + "style": "simple", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + }, + "delete": { + "tags": [ + "users", + "shortlinks" + ], + "summary": "Delete a shortlink for a user.", + "description": "This endpoint requires authentication by any Zoo user. It deletes a shortlink for the user.", + "operationId": "delete_user_shortlink", + "parameters": [ + { + "in": "path", + "name": "key", + "description": "The key of the shortlink.", + "required": true, + "schema": { + "type": "string" + } + } ], - "summary": "OPTIONS endpoint.", - "description": "This is necessary for some preflight requests, specifically POST, PUT, and DELETE.", - "operationId": "options_user_privacy_settings", "responses": { "204": { "description": "resource updated", @@ -12707,30 +13366,28 @@ "$ref": "#/components/responses/Error" } } - } - }, - "/user/session/{token}": { - "get": { + }, + "options": { "tags": [ - "users" + "hidden" ], - "summary": "Get a session for your user.", - "description": "This endpoint requires authentication by any Zoo user. It returns details of the requested API token for the user.", - "operationId": "get_session_for_user", + "summary": "OPTIONS endpoint.", + "description": "This is necessary for some preflight requests, specifically POST, PUT, and DELETE.", + "operationId": "options_delete_user_shortlinks", "parameters": [ { "in": "path", - "name": "token", - "description": "The API token.", + "name": "key", + "description": "The key of the shortlink.", "required": true, "schema": { - "$ref": "#/components/schemas/SessionUuid" + "type": "string" } } ], "responses": { - "200": { - "description": "successful operation", + "204": { + "description": "successful operation, no content", "headers": { "Access-Control-Allow-Credentials": { "description": "Access-Control-Allow-Credentials header.", @@ -12772,13 +13429,6 @@ "type": "string" } } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Session" - } - } } }, "4XX": { @@ -13357,10 +14007,10 @@ { "in": "path", "name": "id", - "description": "The user ID.", + "description": "The user's identifier (uuid or email).", "required": true, "schema": { - "type": "string" + "$ref": "#/components/schemas/UserIdentifier" } } ], @@ -13439,10 +14089,10 @@ { "in": "path", "name": "id", - "description": "The user ID.", + "description": "The user's identifier (uuid or email).", "required": true, "schema": { - "type": "string" + "$ref": "#/components/schemas/UserIdentifier" } } ], @@ -13521,10 +14171,10 @@ { "in": "path", "name": "id", - "description": "The user ID.", + "description": "The user's identifier (uuid or email).", "required": true, "schema": { - "type": "string" + "$ref": "#/components/schemas/UserIdentifier" } }, { @@ -13633,10 +14283,10 @@ { "in": "path", "name": "id", - "description": "The user ID.", + "description": "The user's identifier (uuid or email).", "required": true, "schema": { - "$ref": "#/components/schemas/Uuid" + "$ref": "#/components/schemas/UserIdentifier" } } ], @@ -13713,10 +14363,10 @@ { "in": "path", "name": "id", - "description": "The user ID.", + "description": "The user's identifier (uuid or email).", "required": true, "schema": { - "$ref": "#/components/schemas/Uuid" + "$ref": "#/components/schemas/UserIdentifier" } } ], @@ -13802,10 +14452,10 @@ { "in": "path", "name": "id", - "description": "The user ID.", + "description": "The user's identifier (uuid or email).", "required": true, "schema": { - "$ref": "#/components/schemas/Uuid" + "$ref": "#/components/schemas/UserIdentifier" } } ], @@ -16707,6 +17357,49 @@ } } }, + "CreateShortlinkRequest": { + "description": "Request to create a shortlink.", + "type": "object", + "properties": { + "password": { + "nullable": true, + "description": "The password for the shortlink, if you want to restrict access to it. This can only be set if your subscription allows for it. Otherwise, it will return an error. When you access the link it will be required to enter this password through basic auth. The username will be `{anything}` and the password will be the password you set here.", + "type": "string" + }, + "restrict_to_org": { + "description": "If the shortlink should be restricted to the user's organization to view. This only applies to org shortlinks. If you are creating a user shortlink and you are not a member of a team or enterprise and you try to set this to true, it will fail.", + "default": false, + "type": "boolean" + }, + "url": { + "description": "The URL to redirect back to.", + "type": "string", + "format": "uri" + } + }, + "required": [ + "url" + ] + }, + "CreateShortlinkResponse": { + "description": "Response from creating a shortlink.", + "type": "object", + "properties": { + "key": { + "description": "The key for this url. This is what you use to update or delete the specific shortlink.", + "type": "string" + }, + "url": { + "description": "The shortened url.", + "type": "string", + "format": "uri" + } + }, + "required": [ + "key", + "url" + ] + }, "CreatedAtSortMode": { "description": "Supported set of sort modes for scanning by created_at only.\n\nCurrently, we only support scanning in ascending order.", "oneOf": [ @@ -20438,10 +21131,43 @@ } ] }, + "ModelingAppShareLinks": { + "description": "The options for sharable links through the modeling app.", + "oneOf": [ + { + "description": "Public.", + "type": "string", + "enum": [ + "public" + ] + }, + { + "description": "Password protected.", + "type": "string", + "enum": [ + "password_protected" + ] + }, + { + "description": "Organization only. Links can be made only available to members of the organization.", + "type": "string", + "enum": [ + "organization_only" + ] + } + ] + }, "ModelingAppSubscriptionTier": { "description": "A subscription tier we offer for the Modeling App.", "type": "object", "properties": { + "annual_discount": { + "nullable": true, + "description": "Annual discount. The percentage off the monthly price if the user pays annually.", + "type": "integer", + "format": "uint", + "minimum": 0 + }, "description": { "description": "A description of the tier.", "type": "string" @@ -20477,6 +21203,13 @@ } ] }, + "share_links": { + "description": "The options for sharable links through the modeling app.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ModelingAppShareLinks" + } + }, "support_tier": { "description": "The support tier the subscription provides.", "allOf": [ @@ -22160,6 +22893,38 @@ "type" ] }, + { + "description": "Gets the shared edge between these two faces if it exists", + "type": "object", + "properties": { + "face_ids": { + "description": "The faces being queried", + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "minItems": 2, + "maxItems": 2 + }, + "object_id": { + "description": "Which object is being queried.", + "type": "string", + "format": "uuid" + }, + "type": { + "type": "string", + "enum": [ + "solid3d_get_common_edge" + ] + } + }, + "required": [ + "face_ids", + "object_id", + "type" + ] + }, { "description": "Fillets the given edge with the specified radius.", "type": "object", @@ -25246,6 +26011,24 @@ "type" ] }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/Solid3dGetCommonEdge" + }, + "type": { + "type": "string", + "enum": [ + "solid3d_get_common_edge" + ] + } + }, + "required": [ + "data", + "type" + ] + }, { "type": "object", "properties": { @@ -26182,6 +26965,7 @@ } }, "required": [ + "billing_email", "created_at", "id", "updated_at" @@ -27972,6 +28756,98 @@ "description": "The response from the `SetTool` endpoint.", "type": "object" }, + "Shortlink": { + "description": "A short url.", + "type": "object", + "properties": { + "created_at": { + "title": "DateTime", + "description": "The date and time the shortlink was created.", + "type": "string", + "format": "date-time" + }, + "id": { + "description": "The unique identifier for the shortlink.", + "allOf": [ + { + "$ref": "#/components/schemas/Uuid" + } + ] + }, + "key": { + "description": "The key of the shortlink. This is the short part of the URL.", + "type": "string" + }, + "org_id": { + "nullable": true, + "description": "The organization ID of the shortlink.", + "allOf": [ + { + "$ref": "#/components/schemas/Uuid" + } + ] + }, + "password_hash": { + "nullable": true, + "description": "The hash of the password for the shortlink.", + "type": "string" + }, + "restrict_to_org": { + "description": "If the shortlink should be restricted to the organization. This only applies to org shortlinks. If you are creating a user shortlink and you are not a member of a team or enterprise and you try to set this to true, it will fail.", + "default": false, + "type": "boolean" + }, + "updated_at": { + "title": "DateTime", + "description": "The date and time the shortlink was last updated.", + "type": "string", + "format": "date-time" + }, + "user_id": { + "description": "The ID of the user that made the shortlink.", + "allOf": [ + { + "$ref": "#/components/schemas/Uuid" + } + ] + }, + "value": { + "title": "String", + "description": "The URL the shortlink redirects to.", + "type": "string", + "format": "uri" + } + }, + "required": [ + "created_at", + "id", + "key", + "updated_at", + "user_id", + "value" + ] + }, + "ShortlinkResultsPage": { + "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/Shortlink" + } + }, + "next_page": { + "nullable": true, + "description": "token used to fetch the next page of results (if any)", + "type": "string" + } + }, + "required": [ + "items" + ] + }, "SketchModeDisable": { "description": "The response from the `SketchModeDisable` endpoint.", "type": "object" @@ -28018,6 +28894,18 @@ "edges" ] }, + "Solid3dGetCommonEdge": { + "description": "The response from the `Solid3DGetCommonEdge` command.", + "type": "object", + "properties": { + "edge": { + "nullable": true, + "description": "The UUID of the common edge, if any.", + "type": "string", + "format": "uuid" + } + } + }, "Solid3dGetExtrusionFaceInfo": { "description": "Extrusion face info struct (useful for maintaining mappings between source path segment ids and extrusion faces)", "type": "object", @@ -30795,6 +31683,24 @@ } } }, + "UpdateShortlinkRequest": { + "description": "Request to update a shortlink.", + "type": "object", + "properties": { + "password": { + "nullable": true, + "description": "The password for the shortlink, if you want to restrict access to it. This can only be set if your subscription allows for it. Otherwise, it will return an error. When you access the link it will be required to enter this password through basic auth. The username will be `{anything}` and the password will be the password you set here.", + "type": "string" + }, + "restrict_to_org": { + "description": "If the shortlink should be restricted to the user's organization to view. This only applies to org shortlinks. If you are creating a user shortlink and you are not a member of a team or enterprise and you try to set this to true, it will fail.", + "type": "boolean" + } + }, + "required": [ + "restrict_to_org" + ] + }, "UpdateUser": { "description": "The user-modifiable parts of a User.", "type": "object", @@ -30937,6 +31843,9 @@ "updated_at" ] }, + "UserIdentifier": { + "type": "string" + }, "UserOrgInfo": { "description": "A user's information about an org, including their role.", "type": "object", @@ -31379,6 +32288,13 @@ "description": "A subscription to the modeling app.", "type": "object", "properties": { + "annual_discount": { + "nullable": true, + "description": "Annual discount. The percentage off the monthly price if the user pays annually.", + "type": "integer", + "format": "uint", + "minimum": 0 + }, "description": { "description": "A description of the tier.", "type": "string" @@ -31414,6 +32330,13 @@ } ] }, + "share_links": { + "description": "The options for sharable links through the modeling app.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ModelingAppShareLinks" + } + }, "support_tier": { "description": "The support tier the subscription provides.", "allOf": [ @@ -31487,6 +32410,11 @@ "$ref": "#/components/schemas/ModelingAppOrganizationSubscriptionTier" } ] + }, + "pay_annually": { + "nullable": true, + "description": "If the customer chooses to pay annually or monthly, we can add that here. The annual discount will apply if there is a discount for the subscription.", + "type": "boolean" } } }, @@ -31502,6 +32430,11 @@ "$ref": "#/components/schemas/ModelingAppIndividualSubscriptionTier" } ] + }, + "pay_annually": { + "nullable": true, + "description": "If the customer chooses to pay annually or monthly, we can add that here. The annual discount will apply if there is a discount for the subscription.", + "type": "boolean" } } }, @@ -31668,6 +32601,13 @@ "url": "https://zoo.dev/docs/api/service-accounts" } }, + { + "name": "shortlinks", + "description": "Shortlinks are a way to create a short URL that redirects to a longer URL. This is useful for sharing links that are long and unwieldy.", + "externalDocs": { + "url": "https://zoo.dev/docs/api/shortlinks" + } + }, { "name": "store", "description": "Operations involving our swag store.", From 7ad9827fe0f6ad47980b65090bcf8b3a358af4c2 Mon Sep 17 00:00:00 2001 From: 49lf Date: Fri, 11 Oct 2024 10:07:09 -0400 Subject: [PATCH 2/8] Add UserIdentifier test data generator --- src/apiGen.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/apiGen.ts b/src/apiGen.ts index 3fd4048..53a1472 100644 --- a/src/apiGen.ts +++ b/src/apiGen.ts @@ -144,6 +144,13 @@ export default async function apiGen(lookup: any) { inputParamsExamples.push( `${name}: '${'dev-00000000-0000-0000-0000-000000000000'}'`, ); + } else if ( + reffedSchema.type === 'string' && + refName == 'UserIdentifier' + ) { + inputParamsExamples.push( + `${name}: '${'31337'}'`, + ); } } else { if (schema.type === 'number' || schema.type === 'integer') { From 9406e31ac0e7efdebc3cbb3b7a26de08c6dbe78a Mon Sep 17 00:00:00 2001 From: 49lf Date: Fri, 11 Oct 2024 10:22:16 -0400 Subject: [PATCH 3/8] Add CodeLanguage test code generator --- src/apiGen.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/apiGen.ts b/src/apiGen.ts index 53a1472..789d125 100644 --- a/src/apiGen.ts +++ b/src/apiGen.ts @@ -151,6 +151,13 @@ export default async function apiGen(lookup: any) { inputParamsExamples.push( `${name}: '${'31337'}'`, ); + } else if ( + reffedSchema.type === 'string' && + refName == 'CodeLanguage' + ) { + inputParamsExamples.push( + `${name}: '${'node'}'`, + ); } } else { if (schema.type === 'number' || schema.type === 'integer') { From c58509b55a776f2a8685e2c4e01cf9ced31deddf Mon Sep 17 00:00:00 2001 From: 49lf Date: Fri, 11 Oct 2024 11:22:24 -0400 Subject: [PATCH 4/8] Fix up file creation executor test generator --- src/apiGen.ts | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/src/apiGen.ts b/src/apiGen.ts index 789d125..eff56cb 100644 --- a/src/apiGen.ts +++ b/src/apiGen.ts @@ -148,16 +148,12 @@ export default async function apiGen(lookup: any) { reffedSchema.type === 'string' && refName == 'UserIdentifier' ) { - inputParamsExamples.push( - `${name}: '${'31337'}'`, - ); + inputParamsExamples.push(`${name}: '${'31337'}'`); } else if ( reffedSchema.type === 'string' && refName == 'CodeLanguage' ) { - inputParamsExamples.push( - `${name}: '${'node'}'`, - ); + inputParamsExamples.push(`${name}: '${'node'}'`); } } else { if (schema.type === 'number' || schema.type === 'integer') { @@ -298,14 +294,27 @@ export default async function apiGen(lookup: any) { } inputTypes.push('body: string'); inputParams.push('body'); - const srcFmts = inputParamsExamples.find((str) => { + + let exampleFile = 'example'; + + // For requests depending on a model file + const modelFmts = inputParamsExamples.find((str) => { return str.startsWith('src_format:'); }); - const exampleFile = !srcFmts - ? 'example' - : srcFmts.includes('obj') - ? 'example.obj' - : 'example.svg'; + if (modelFmts) { + exampleFile = modelFmts.includes('obj') + ? 'example.obj' + : 'example.svg'; + } + + // For requests depending on a source code file + const langFmts = inputParamsExamples.find((str) => { + return str.startsWith('lang:'); + }); + if (langFmts) { + exampleFile = `example.${langFmts.replace(/lang: '([a-z]+)'/, '$1')}`; + } + inputParamsExamples.push( `body: await fsp.readFile('./${exampleFile}', 'base64')`, ); From db93f9db588ae986b09531ead6abbe5b31fb0f0b Mon Sep 17 00:00:00 2001 From: 49lf Date: Fri, 11 Oct 2024 12:39:51 -0400 Subject: [PATCH 5/8] Add shortlink deletion to expectedToFail --- src/expectedToFail.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/expectedToFail.ts b/src/expectedToFail.ts index 375846e..9f0146e 100644 --- a/src/expectedToFail.ts +++ b/src/expectedToFail.ts @@ -57,4 +57,7 @@ export const testsExpectedToFail = 'payments.validate_customer_tax_information_for_org', 'service-accounts.create_service_account_for_org', 'users.get_user_privacy_settings', + + // stateful. what matters is the creation variants succeed. + 'users.delete_user_shortlink', ]; From e176298179ca5b44227a436a6f8167f39f36ccfb Mon Sep 17 00:00:00 2001 From: 49lf Date: Fri, 11 Oct 2024 12:42:30 -0400 Subject: [PATCH 6/8] Whoops, include the new example files --- example | 2 +- example.go | 5 +++++ example.node | 1 + example.python | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 example.go create mode 100644 example.node create mode 100644 example.python diff --git a/example b/example index 96236f8..3b9b24d 100644 --- a/example +++ b/example @@ -1 +1 @@ -example \ No newline at end of file +console.log("ok") diff --git a/example.go b/example.go new file mode 100644 index 0000000..b541660 --- /dev/null +++ b/example.go @@ -0,0 +1,5 @@ +package main +import "fmt" +func main() { + fmt.Println("lee was here") +} diff --git a/example.node b/example.node new file mode 100644 index 0000000..359d4e1 --- /dev/null +++ b/example.node @@ -0,0 +1 @@ +console.log('lee was here') diff --git a/example.python b/example.python new file mode 100644 index 0000000..bd4fa8d --- /dev/null +++ b/example.python @@ -0,0 +1 @@ +print "lee was here" From 96b7e0ea4b6b32d275bf432a6a9792f71a572f18 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 11 Oct 2024 16:43:20 +0000 Subject: [PATCH 7/8] Generated new lib --- .../api-calls-list_api_calls_for_user.test.ts | 2 +- .../executor-create_file_execution.test.ts | 2 +- __tests__/gen/orgs-get_org_shortlinks.test.ts | 18 +++ .../payments-create_org_subscription.test.ts | 2 +- .../payments-create_user_subscription.test.ts | 2 +- ...s-get_payment_balance_for_any_user.test.ts | 2 +- .../payments-update_org_subscription.test.ts | 2 +- ...pdate_payment_balance_for_any_user.test.ts | 2 +- .../payments-update_user_subscription.test.ts | 2 +- .../gen/users-create_user_shortlink.test.ts | 21 +++ .../gen/users-delete_user_shortlink.test.ts | 18 +++ __tests__/gen/users-get_user.test.ts | 2 +- __tests__/gen/users-get_user_extended.test.ts | 2 +- .../gen/users-get_user_shortlinks.test.ts | 18 +++ .../gen/users-update_user_shortlink.test.ts | 21 +++ kittycad.ts.patch.json | 60 +++++++-- src/api/api-calls/list_api_calls_for_user.ts | 3 +- src/api/orgs/get_org_shortlinks.ts | 39 ++++++ .../get_payment_balance_for_any_user.ts | 8 +- .../update_payment_balance_for_any_user.ts | 4 +- src/api/users/create_user_shortlink.ts | 36 ++++++ src/api/users/delete_user_shortlink.ts | 31 +++++ src/api/users/get_user.ts | 4 +- src/api/users/get_user_extended.ts | 8 +- src/api/users/get_user_shortlinks.ts | 39 ++++++ src/api/users/update_user_shortlink.ts | 34 +++++ src/index.ts | 10 ++ src/models.ts | 122 ++++++++++++++++++ 28 files changed, 485 insertions(+), 29 deletions(-) create mode 100644 __tests__/gen/orgs-get_org_shortlinks.test.ts create mode 100644 __tests__/gen/users-create_user_shortlink.test.ts create mode 100644 __tests__/gen/users-delete_user_shortlink.test.ts create mode 100644 __tests__/gen/users-get_user_shortlinks.test.ts create mode 100644 __tests__/gen/users-update_user_shortlink.test.ts create mode 100644 src/api/orgs/get_org_shortlinks.ts create mode 100644 src/api/users/create_user_shortlink.ts create mode 100644 src/api/users/delete_user_shortlink.ts create mode 100644 src/api/users/get_user_shortlinks.ts create mode 100644 src/api/users/update_user_shortlink.ts diff --git a/__tests__/gen/api-calls-list_api_calls_for_user.test.ts b/__tests__/gen/api-calls-list_api_calls_for_user.test.ts index 67730e9..c1387f6 100644 --- a/__tests__/gen/api-calls-list_api_calls_for_user.test.ts +++ b/__tests__/gen/api-calls-list_api_calls_for_user.test.ts @@ -2,7 +2,7 @@ import { api_calls } from '../../src/index.js'; async function example() { const response = await api_calls.list_api_calls_for_user({ - id: 'string', + id: '31337', limit: 7, page_token: 'string', sort_by: 'created_at_ascending', diff --git a/__tests__/gen/executor-create_file_execution.test.ts b/__tests__/gen/executor-create_file_execution.test.ts index 1d508ad..00e3828 100644 --- a/__tests__/gen/executor-create_file_execution.test.ts +++ b/__tests__/gen/executor-create_file_execution.test.ts @@ -5,7 +5,7 @@ async function example() { const response = await executor.create_file_execution({ lang: 'go', output: 'string', - body: await fsp.readFile('./example', 'base64'), + body: await fsp.readFile('./example.go', 'base64'), }); if ('error_code' in response) throw response; diff --git a/__tests__/gen/orgs-get_org_shortlinks.test.ts b/__tests__/gen/orgs-get_org_shortlinks.test.ts new file mode 100644 index 0000000..1c6082a --- /dev/null +++ b/__tests__/gen/orgs-get_org_shortlinks.test.ts @@ -0,0 +1,18 @@ +import { orgs } from '../../src/index.js'; + +async function example() { + const response = await orgs.get_org_shortlinks({ + limit: 7, + page_token: 'string', + sort_by: 'created_at_ascending', + }); + if ('error_code' in response) throw response; + + return response; +} + +describe('Testing orgs.get_org_shortlinks', () => { + it('should be truthy or throw', async () => { + expect(await example()).toBeTruthy(); + }); +}); diff --git a/__tests__/gen/payments-create_org_subscription.test.ts b/__tests__/gen/payments-create_org_subscription.test.ts index 0dc9f26..873c17f 100644 --- a/__tests__/gen/payments-create_org_subscription.test.ts +++ b/__tests__/gen/payments-create_org_subscription.test.ts @@ -2,7 +2,7 @@ import { payments } from '../../src/index.js'; async function example() { const response = await payments.create_org_subscription({ - body: { modeling_app: 'team' }, + body: { modeling_app: 'team', pay_annually: true }, }); if ('error_code' in response) throw response; diff --git a/__tests__/gen/payments-create_user_subscription.test.ts b/__tests__/gen/payments-create_user_subscription.test.ts index 822b441..155ef39 100644 --- a/__tests__/gen/payments-create_user_subscription.test.ts +++ b/__tests__/gen/payments-create_user_subscription.test.ts @@ -2,7 +2,7 @@ import { payments } from '../../src/index.js'; async function example() { const response = await payments.create_user_subscription({ - body: { modeling_app: 'free' }, + body: { modeling_app: 'free', pay_annually: true }, }); if ('error_code' in response) throw response; diff --git a/__tests__/gen/payments-get_payment_balance_for_any_user.test.ts b/__tests__/gen/payments-get_payment_balance_for_any_user.test.ts index b4ae1d1..6ebbb17 100644 --- a/__tests__/gen/payments-get_payment_balance_for_any_user.test.ts +++ b/__tests__/gen/payments-get_payment_balance_for_any_user.test.ts @@ -2,7 +2,7 @@ import { payments } from '../../src/index.js'; async function example() { const response = await payments.get_payment_balance_for_any_user({ - id: '00000000-0000-0000-0000-000000000000', + id: '31337', }); if ('error_code' in response) throw response; diff --git a/__tests__/gen/payments-update_org_subscription.test.ts b/__tests__/gen/payments-update_org_subscription.test.ts index a64145f..115cf3a 100644 --- a/__tests__/gen/payments-update_org_subscription.test.ts +++ b/__tests__/gen/payments-update_org_subscription.test.ts @@ -2,7 +2,7 @@ import { payments } from '../../src/index.js'; async function example() { const response = await payments.update_org_subscription({ - body: { modeling_app: 'team' }, + body: { modeling_app: 'team', pay_annually: true }, }); if ('error_code' in response) throw response; diff --git a/__tests__/gen/payments-update_payment_balance_for_any_user.test.ts b/__tests__/gen/payments-update_payment_balance_for_any_user.test.ts index 6e34282..f946010 100644 --- a/__tests__/gen/payments-update_payment_balance_for_any_user.test.ts +++ b/__tests__/gen/payments-update_payment_balance_for_any_user.test.ts @@ -2,7 +2,7 @@ import { payments } from '../../src/index.js'; async function example() { const response = await payments.update_payment_balance_for_any_user({ - id: '00000000-0000-0000-0000-000000000000', + id: '31337', body: { monthly_credits_remaining: 7, pre_pay_cash_remaining: 7, diff --git a/__tests__/gen/payments-update_user_subscription.test.ts b/__tests__/gen/payments-update_user_subscription.test.ts index 984b2c2..0c8a1ea 100644 --- a/__tests__/gen/payments-update_user_subscription.test.ts +++ b/__tests__/gen/payments-update_user_subscription.test.ts @@ -2,7 +2,7 @@ import { payments } from '../../src/index.js'; async function example() { const response = await payments.update_user_subscription({ - body: { modeling_app: 'free' }, + body: { modeling_app: 'free', pay_annually: true }, }); if ('error_code' in response) throw response; diff --git a/__tests__/gen/users-create_user_shortlink.test.ts b/__tests__/gen/users-create_user_shortlink.test.ts new file mode 100644 index 0000000..11835ee --- /dev/null +++ b/__tests__/gen/users-create_user_shortlink.test.ts @@ -0,0 +1,21 @@ +import { users } from '../../src/index.js'; + +async function example() { + const response = await users.create_user_shortlink({ + body: { + password: + 'The password for the shortlink, if you want to restrict access to it. This can only be set if your subscription allows for it. Otherwise, it will return an error. When you access the link it will be required to enter this password through basic auth. The username will be `{anything}` and the password will be the password you set here.', + restrict_to_org: true, + url: 'The URL to redirect back to.', + }, + }); + if ('error_code' in response) throw response; + + return response; +} + +describe('Testing users.create_user_shortlink', () => { + it('should be truthy or throw', async () => { + expect(await example()).toBeTruthy(); + }); +}); diff --git a/__tests__/gen/users-delete_user_shortlink.test.ts b/__tests__/gen/users-delete_user_shortlink.test.ts new file mode 100644 index 0000000..16b3157 --- /dev/null +++ b/__tests__/gen/users-delete_user_shortlink.test.ts @@ -0,0 +1,18 @@ +import { users } from '../../src/index.js'; + +async function example() { + const response = await users.delete_user_shortlink({ key: 'string' }); + if ('error_code' in response) throw response; + + return response; +} + +describe('Testing users.delete_user_shortlink', () => { + it('should be truthy or throw', async () => { + try { + await example(); + } catch (err) { + expect(err).toBeTruthy(); // eslint-disable-line jest/no-conditional-expect + } + }); +}); diff --git a/__tests__/gen/users-get_user.test.ts b/__tests__/gen/users-get_user.test.ts index 3e1fca3..eff3114 100644 --- a/__tests__/gen/users-get_user.test.ts +++ b/__tests__/gen/users-get_user.test.ts @@ -1,7 +1,7 @@ import { users } from '../../src/index.js'; async function example() { - const response = await users.get_user({ id: 'string' }); + const response = await users.get_user({ id: '31337' }); if ('error_code' in response) throw response; return response; diff --git a/__tests__/gen/users-get_user_extended.test.ts b/__tests__/gen/users-get_user_extended.test.ts index a9fbafa..beb6723 100644 --- a/__tests__/gen/users-get_user_extended.test.ts +++ b/__tests__/gen/users-get_user_extended.test.ts @@ -1,7 +1,7 @@ import { users } from '../../src/index.js'; async function example() { - const response = await users.get_user_extended({ id: 'string' }); + const response = await users.get_user_extended({ id: '31337' }); if ('error_code' in response) throw response; return response; diff --git a/__tests__/gen/users-get_user_shortlinks.test.ts b/__tests__/gen/users-get_user_shortlinks.test.ts new file mode 100644 index 0000000..ea29e12 --- /dev/null +++ b/__tests__/gen/users-get_user_shortlinks.test.ts @@ -0,0 +1,18 @@ +import { users } from '../../src/index.js'; + +async function example() { + const response = await users.get_user_shortlinks({ + limit: 7, + page_token: 'string', + sort_by: 'created_at_ascending', + }); + if ('error_code' in response) throw response; + + return response; +} + +describe('Testing users.get_user_shortlinks', () => { + it('should be truthy or throw', async () => { + expect(await example()).toBeTruthy(); + }); +}); diff --git a/__tests__/gen/users-update_user_shortlink.test.ts b/__tests__/gen/users-update_user_shortlink.test.ts new file mode 100644 index 0000000..5c4e385 --- /dev/null +++ b/__tests__/gen/users-update_user_shortlink.test.ts @@ -0,0 +1,21 @@ +import { users } from '../../src/index.js'; + +async function example() { + const response = await users.update_user_shortlink({ + key: 'string', + body: { + password: + 'The password for the shortlink, if you want to restrict access to it. This can only be set if your subscription allows for it. Otherwise, it will return an error. When you access the link it will be required to enter this password through basic auth. The username will be `{anything}` and the password will be the password you set here.', + restrict_to_org: true, + }, + }); + if ('error_code' in response) throw response; + + return response; +} + +describe('Testing users.update_user_shortlink', () => { + it('should be truthy or throw', async () => { + expect(await example()).toBeTruthy(); + }); +}); diff --git a/kittycad.ts.patch.json b/kittycad.ts.patch.json index 22b4bf1..d2c12ec 100644 --- a/kittycad.ts.patch.json +++ b/kittycad.ts.patch.json @@ -19,7 +19,7 @@ "op": "add", "path": "/paths/~1users~1{id}~1payment~1balance/put/x-typescript", "value": { - "example": "import { payments } from '@kittycad/lib'\n\nasync function example() {\n const response = await payments.update_payment_balance_for_any_user({\n id: '00000000-0000-0000-0000-000000000000',\n body: {\n monthly_credits_remaining: 7,\n pre_pay_cash_remaining: 7,\n pre_pay_credits_remaining: 7,\n },\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n", + "example": "import { payments } from '@kittycad/lib'\n\nasync function example() {\n const response = await payments.update_payment_balance_for_any_user({\n id: '31337',\n body: {\n monthly_credits_remaining: 7,\n pre_pay_cash_remaining: 7,\n pre_pay_credits_remaining: 7,\n },\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n", "libDocsLink": "" } }, @@ -27,7 +27,7 @@ "op": "add", "path": "/paths/~1users~1{id}~1payment~1balance/get/x-typescript", "value": { - "example": "import { payments } from '@kittycad/lib'\n\nasync function example() {\n const response = await payments.get_payment_balance_for_any_user({\n id: '00000000-0000-0000-0000-000000000000',\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n", + "example": "import { payments } from '@kittycad/lib'\n\nasync function example() {\n const response = await payments.get_payment_balance_for_any_user({\n id: '31337',\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n", "libDocsLink": "" } }, @@ -35,7 +35,7 @@ "op": "add", "path": "/paths/~1users~1{id}~1api-calls/get/x-typescript", "value": { - "example": "import { api_calls } from '@kittycad/lib'\n\nasync function example() {\n const response = await api_calls.list_api_calls_for_user({\n id: 'string',\n limit: 7,\n page_token: 'string',\n sort_by: 'created_at_ascending',\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n", + "example": "import { api_calls } from '@kittycad/lib'\n\nasync function example() {\n const response = await api_calls.list_api_calls_for_user({\n id: '31337',\n limit: 7,\n page_token: 'string',\n sort_by: 'created_at_ascending',\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n", "libDocsLink": "" } }, @@ -43,7 +43,7 @@ "op": "add", "path": "/paths/~1users~1{id}/get/x-typescript", "value": { - "example": "import { users } from '@kittycad/lib'\n\nasync function example() {\n const response = await users.get_user({ id: 'string' })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n", + "example": "import { users } from '@kittycad/lib'\n\nasync function example() {\n const response = await users.get_user({ id: '31337' })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n", "libDocsLink": "" } }, @@ -51,7 +51,7 @@ "op": "add", "path": "/paths/~1users-extended~1{id}/get/x-typescript", "value": { - "example": "import { users } from '@kittycad/lib'\n\nasync function example() {\n const response = await users.get_user_extended({ id: 'string' })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n", + "example": "import { users } from '@kittycad/lib'\n\nasync function example() {\n const response = await users.get_user_extended({ id: '31337' })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n", "libDocsLink": "" } }, @@ -95,6 +95,38 @@ "libDocsLink": "" } }, + { + "op": "add", + "path": "/paths/~1user~1shortlinks~1{key}/delete/x-typescript", + "value": { + "example": "import { users } from '@kittycad/lib'\n\nasync function example() {\n const response = await users.delete_user_shortlink({ key: 'string' })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n", + "libDocsLink": "" + } + }, + { + "op": "add", + "path": "/paths/~1user~1shortlinks~1{key}/put/x-typescript", + "value": { + "example": "import { users } from '@kittycad/lib'\n\nasync function example() {\n const response = await users.update_user_shortlink({\n key: 'string',\n body: {\n password:\n 'The password for the shortlink, if you want to restrict access to it. This can only be set if your subscription allows for it. Otherwise, it will return an error. When you access the link it will be required to enter this password through basic auth. The username will be `{anything}` and the password will be the password you set here.',\n restrict_to_org: true,\n },\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n", + "libDocsLink": "" + } + }, + { + "op": "add", + "path": "/paths/~1user~1shortlinks/post/x-typescript", + "value": { + "example": "import { users } from '@kittycad/lib'\n\nasync function example() {\n const response = await users.create_user_shortlink({\n body: {\n password:\n 'The password for the shortlink, if you want to restrict access to it. This can only be set if your subscription allows for it. Otherwise, it will return an error. When you access the link it will be required to enter this password through basic auth. The username will be `{anything}` and the password will be the password you set here.',\n restrict_to_org: true,\n url: 'The URL to redirect back to.',\n },\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n", + "libDocsLink": "" + } + }, + { + "op": "add", + "path": "/paths/~1user~1shortlinks/get/x-typescript", + "value": { + "example": "import { users } from '@kittycad/lib'\n\nasync function example() {\n const response = await users.get_user_shortlinks({\n limit: 7,\n page_token: 'string',\n sort_by: 'created_at_ascending',\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n", + "libDocsLink": "" + } + }, { "op": "add", "path": "/paths/~1user~1session~1{token}/get/x-typescript", @@ -131,7 +163,7 @@ "op": "add", "path": "/paths/~1user~1payment~1subscriptions/post/x-typescript", "value": { - "example": "import { payments } from '@kittycad/lib'\n\nasync function example() {\n const response = await payments.create_user_subscription({\n body: { modeling_app: 'free' },\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n", + "example": "import { payments } from '@kittycad/lib'\n\nasync function example() {\n const response = await payments.create_user_subscription({\n body: { modeling_app: 'free', pay_annually: true },\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n", "libDocsLink": "" } }, @@ -139,7 +171,7 @@ "op": "add", "path": "/paths/~1user~1payment~1subscriptions/put/x-typescript", "value": { - "example": "import { payments } from '@kittycad/lib'\n\nasync function example() {\n const response = await payments.update_user_subscription({\n body: { modeling_app: 'free' },\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n", + "example": "import { payments } from '@kittycad/lib'\n\nasync function example() {\n const response = await payments.update_user_subscription({\n body: { modeling_app: 'free', pay_annually: true },\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n", "libDocsLink": "" } }, @@ -495,6 +527,14 @@ "libDocsLink": "" } }, + { + "op": "add", + "path": "/paths/~1org~1shortlinks/get/x-typescript", + "value": { + "example": "import { orgs } from '@kittycad/lib'\n\nasync function example() {\n const response = await orgs.get_org_shortlinks({\n limit: 7,\n page_token: 'string',\n sort_by: 'created_at_ascending',\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n", + "libDocsLink": "" + } + }, { "op": "add", "path": "/paths/~1org~1service-accounts~1{token}/delete/x-typescript", @@ -587,7 +627,7 @@ "op": "add", "path": "/paths/~1org~1payment~1subscriptions/post/x-typescript", "value": { - "example": "import { payments } from '@kittycad/lib'\n\nasync function example() {\n const response = await payments.create_org_subscription({\n body: { modeling_app: 'team' },\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n", + "example": "import { payments } from '@kittycad/lib'\n\nasync function example() {\n const response = await payments.create_org_subscription({\n body: { modeling_app: 'team', pay_annually: true },\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n", "libDocsLink": "" } }, @@ -595,7 +635,7 @@ "op": "add", "path": "/paths/~1org~1payment~1subscriptions/put/x-typescript", "value": { - "example": "import { payments } from '@kittycad/lib'\n\nasync function example() {\n const response = await payments.update_org_subscription({\n body: { modeling_app: 'team' },\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n", + "example": "import { payments } from '@kittycad/lib'\n\nasync function example() {\n const response = await payments.update_org_subscription({\n body: { modeling_app: 'team', pay_annually: true },\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n", "libDocsLink": "" } }, @@ -899,7 +939,7 @@ "op": "add", "path": "/paths/~1file~1execute~1{lang}/post/x-typescript", "value": { - "example": "import fsp from 'fs/promises'\nimport { executor } from '@kittycad/lib'\n\nasync function example() {\n const response = await executor.create_file_execution({\n lang: 'go',\n output: 'string',\n body: await fsp.readFile('./example', 'base64'),\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n", + "example": "import fsp from 'fs/promises'\nimport { executor } from '@kittycad/lib'\n\nasync function example() {\n const response = await executor.create_file_execution({\n lang: 'go',\n output: 'string',\n body: await fsp.readFile('./example.go', 'base64'),\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n", "libDocsLink": "" } }, diff --git a/src/api/api-calls/list_api_calls_for_user.ts b/src/api/api-calls/list_api_calls_for_user.ts index 58675ff..723ea7b 100644 --- a/src/api/api-calls/list_api_calls_for_user.ts +++ b/src/api/api-calls/list_api_calls_for_user.ts @@ -1,13 +1,14 @@ import { ApiCallWithPriceResultsPage_type, Error_type, + UserIdentifier_type, CreatedAtSortMode_type, } from '../../models.js'; import { Client } from '../../client.js'; interface List_api_calls_for_user_params { client?: Client; - id: string; + id: UserIdentifier_type; limit: number; page_token: string; sort_by: CreatedAtSortMode_type; diff --git a/src/api/orgs/get_org_shortlinks.ts b/src/api/orgs/get_org_shortlinks.ts new file mode 100644 index 0000000..7eb13b4 --- /dev/null +++ b/src/api/orgs/get_org_shortlinks.ts @@ -0,0 +1,39 @@ +import { + ShortlinkResultsPage_type, + Error_type, + CreatedAtSortMode_type, +} from '../../models.js'; +import { Client } from '../../client.js'; + +interface Get_org_shortlinks_params { + client?: Client; + limit: number; + page_token: string; + sort_by: CreatedAtSortMode_type; +} + +type Get_org_shortlinks_return = ShortlinkResultsPage_type | Error_type; + +export default async function get_org_shortlinks({ + client, + limit, + page_token, + sort_by, +}: Get_org_shortlinks_params): Promise { + const url = `/org/shortlinks?limit=${limit}&page_token=${page_token}&sort_by=${sort_by}`; + const urlBase = process?.env?.BASE_URL || 'https://api.zoo.dev'; + const fullUrl = urlBase + url; + const kittycadToken = client + ? client.token + : process.env.KITTYCAD_TOKEN || ''; + const headers = { + Authorization: `Bearer ${kittycadToken}`, + }; + const fetchOptions = { + method: 'GET', + headers, + }; + const response = await fetch(fullUrl, fetchOptions); + const result = (await response.json()) as Get_org_shortlinks_return; + return result; +} diff --git a/src/api/payments/get_payment_balance_for_any_user.ts b/src/api/payments/get_payment_balance_for_any_user.ts index f684cd1..ef582f7 100644 --- a/src/api/payments/get_payment_balance_for_any_user.ts +++ b/src/api/payments/get_payment_balance_for_any_user.ts @@ -1,9 +1,13 @@ -import { CustomerBalance_type, Error_type, Uuid_type } from '../../models.js'; +import { + CustomerBalance_type, + Error_type, + UserIdentifier_type, +} from '../../models.js'; import { Client } from '../../client.js'; interface Get_payment_balance_for_any_user_params { client?: Client; - id: Uuid_type; + id: UserIdentifier_type; } type Get_payment_balance_for_any_user_return = diff --git a/src/api/payments/update_payment_balance_for_any_user.ts b/src/api/payments/update_payment_balance_for_any_user.ts index d635808..4d902af 100644 --- a/src/api/payments/update_payment_balance_for_any_user.ts +++ b/src/api/payments/update_payment_balance_for_any_user.ts @@ -1,14 +1,14 @@ import { CustomerBalance_type, Error_type, - Uuid_type, + UserIdentifier_type, UpdatePaymentBalance_type, } from '../../models.js'; import { Client } from '../../client.js'; interface Update_payment_balance_for_any_user_params { client?: Client; - id: Uuid_type; + id: UserIdentifier_type; body: UpdatePaymentBalance_type; } diff --git a/src/api/users/create_user_shortlink.ts b/src/api/users/create_user_shortlink.ts new file mode 100644 index 0000000..7b4979e --- /dev/null +++ b/src/api/users/create_user_shortlink.ts @@ -0,0 +1,36 @@ +import { + CreateShortlinkResponse_type, + Error_type, + CreateShortlinkRequest_type, +} from '../../models.js'; +import { Client } from '../../client.js'; + +interface Create_user_shortlink_params { + client?: Client; + body: CreateShortlinkRequest_type; +} + +type Create_user_shortlink_return = CreateShortlinkResponse_type | Error_type; + +export default async function create_user_shortlink({ + client, + body, +}: Create_user_shortlink_params): Promise { + const url = `/user/shortlinks`; + const urlBase = process?.env?.BASE_URL || 'https://api.zoo.dev'; + const fullUrl = urlBase + url; + const kittycadToken = client + ? client.token + : process.env.KITTYCAD_TOKEN || ''; + const headers = { + Authorization: `Bearer ${kittycadToken}`, + }; + const fetchOptions = { + method: 'POST', + headers, + body: JSON.stringify(body), + }; + const response = await fetch(fullUrl, fetchOptions); + const result = (await response.json()) as Create_user_shortlink_return; + return result; +} diff --git a/src/api/users/delete_user_shortlink.ts b/src/api/users/delete_user_shortlink.ts new file mode 100644 index 0000000..cee9ac3 --- /dev/null +++ b/src/api/users/delete_user_shortlink.ts @@ -0,0 +1,31 @@ +import { Error_type } from '../../models.js'; +import { Client } from '../../client.js'; + +interface Delete_user_shortlink_params { + client?: Client; + key: string; +} + +type Delete_user_shortlink_return = Error_type; + +export default async function delete_user_shortlink({ + client, + key, +}: Delete_user_shortlink_params): Promise { + const url = `/user/shortlinks/${key}`; + const urlBase = process?.env?.BASE_URL || 'https://api.zoo.dev'; + const fullUrl = urlBase + url; + const kittycadToken = client + ? client.token + : process.env.KITTYCAD_TOKEN || ''; + const headers = { + Authorization: `Bearer ${kittycadToken}`, + }; + const fetchOptions = { + method: 'DELETE', + headers, + }; + const response = await fetch(fullUrl, fetchOptions); + const result = (await response.json()) as Delete_user_shortlink_return; + return result; +} diff --git a/src/api/users/get_user.ts b/src/api/users/get_user.ts index 3d54d41..34fa74e 100644 --- a/src/api/users/get_user.ts +++ b/src/api/users/get_user.ts @@ -1,9 +1,9 @@ -import { User_type, Error_type } from '../../models.js'; +import { User_type, Error_type, UserIdentifier_type } from '../../models.js'; import { Client } from '../../client.js'; interface Get_user_params { client?: Client; - id: string; + id: UserIdentifier_type; } type Get_user_return = User_type | Error_type; diff --git a/src/api/users/get_user_extended.ts b/src/api/users/get_user_extended.ts index 5401117..474319d 100644 --- a/src/api/users/get_user_extended.ts +++ b/src/api/users/get_user_extended.ts @@ -1,9 +1,13 @@ -import { ExtendedUser_type, Error_type } from '../../models.js'; +import { + ExtendedUser_type, + Error_type, + UserIdentifier_type, +} from '../../models.js'; import { Client } from '../../client.js'; interface Get_user_extended_params { client?: Client; - id: string; + id: UserIdentifier_type; } type Get_user_extended_return = ExtendedUser_type | Error_type; diff --git a/src/api/users/get_user_shortlinks.ts b/src/api/users/get_user_shortlinks.ts new file mode 100644 index 0000000..f4e8d49 --- /dev/null +++ b/src/api/users/get_user_shortlinks.ts @@ -0,0 +1,39 @@ +import { + ShortlinkResultsPage_type, + Error_type, + CreatedAtSortMode_type, +} from '../../models.js'; +import { Client } from '../../client.js'; + +interface Get_user_shortlinks_params { + client?: Client; + limit: number; + page_token: string; + sort_by: CreatedAtSortMode_type; +} + +type Get_user_shortlinks_return = ShortlinkResultsPage_type | Error_type; + +export default async function get_user_shortlinks({ + client, + limit, + page_token, + sort_by, +}: Get_user_shortlinks_params): Promise { + const url = `/user/shortlinks?limit=${limit}&page_token=${page_token}&sort_by=${sort_by}`; + const urlBase = process?.env?.BASE_URL || 'https://api.zoo.dev'; + const fullUrl = urlBase + url; + const kittycadToken = client + ? client.token + : process.env.KITTYCAD_TOKEN || ''; + const headers = { + Authorization: `Bearer ${kittycadToken}`, + }; + const fetchOptions = { + method: 'GET', + headers, + }; + const response = await fetch(fullUrl, fetchOptions); + const result = (await response.json()) as Get_user_shortlinks_return; + return result; +} diff --git a/src/api/users/update_user_shortlink.ts b/src/api/users/update_user_shortlink.ts new file mode 100644 index 0000000..9af9fb8 --- /dev/null +++ b/src/api/users/update_user_shortlink.ts @@ -0,0 +1,34 @@ +import { Error_type, UpdateShortlinkRequest_type } from '../../models.js'; +import { Client } from '../../client.js'; + +interface Update_user_shortlink_params { + client?: Client; + key: string; + body: UpdateShortlinkRequest_type; +} + +type Update_user_shortlink_return = Error_type; + +export default async function update_user_shortlink({ + client, + key, + body, +}: Update_user_shortlink_params): Promise { + const url = `/user/shortlinks/${key}`; + const urlBase = process?.env?.BASE_URL || 'https://api.zoo.dev'; + const fullUrl = urlBase + url; + const kittycadToken = client + ? client.token + : process.env.KITTYCAD_TOKEN || ''; + const headers = { + Authorization: `Bearer ${kittycadToken}`, + }; + const fetchOptions = { + method: 'PUT', + headers, + body: JSON.stringify(body), + }; + const response = await fetch(fullUrl, fetchOptions); + const result = (await response.json()) as Update_user_shortlink_return; + return result; +} diff --git a/src/index.ts b/src/index.ts index 4ab6fcf..000ec3e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -128,6 +128,7 @@ import get_org from './api/orgs/get_org.js'; import get_org_member from './api/orgs/get_org_member.js'; import get_org_privacy_settings from './api/orgs/get_org_privacy_settings.js'; import get_org_saml_idp from './api/orgs/get_org_saml_idp.js'; +import get_org_shortlinks from './api/orgs/get_org_shortlinks.js'; import get_user_org from './api/orgs/get_user_org.js'; import list_org_members from './api/orgs/list_org_members.js'; import list_orgs from './api/orgs/list_orgs.js'; @@ -148,6 +149,7 @@ export const orgs = { get_org_member, get_org_privacy_settings, get_org_saml_idp, + get_org_shortlinks, get_user_org, list_org_members, list_orgs, @@ -264,7 +266,9 @@ export const unit = { get_volume_unit_conversion, }; +import create_user_shortlink from './api/users/create_user_shortlink.js'; import delete_user_self from './api/users/delete_user_self.js'; +import delete_user_shortlink from './api/users/delete_user_shortlink.js'; import get_oauth2_providers_for_user from './api/users/get_oauth2_providers_for_user.js'; import get_session_for_user from './api/users/get_session_for_user.js'; import get_user from './api/users/get_user.js'; @@ -273,12 +277,16 @@ import get_user_onboarding_self from './api/users/get_user_onboarding_self.js'; import get_user_privacy_settings from './api/users/get_user_privacy_settings.js'; import get_user_self from './api/users/get_user_self.js'; import get_user_self_extended from './api/users/get_user_self_extended.js'; +import get_user_shortlinks from './api/users/get_user_shortlinks.js'; import list_users from './api/users/list_users.js'; import list_users_extended from './api/users/list_users_extended.js'; import update_user_privacy_settings from './api/users/update_user_privacy_settings.js'; import update_user_self from './api/users/update_user_self.js'; +import update_user_shortlink from './api/users/update_user_shortlink.js'; export const users = { + create_user_shortlink, delete_user_self, + delete_user_shortlink, get_oauth2_providers_for_user, get_session_for_user, get_user, @@ -287,10 +295,12 @@ export const users = { get_user_privacy_settings, get_user_self, get_user_self_extended, + get_user_shortlinks, list_users, list_users_extended, update_user_privacy_settings, update_user_self, + update_user_shortlink, }; export type { Models } from './models.js'; diff --git a/src/models.ts b/src/models.ts index 0cdffc1..fd998a4 100644 --- a/src/models.ts +++ b/src/models.ts @@ -910,6 +910,27 @@ export interface Coupon_type { percent_off?: number; } +export interface CreateShortlinkRequest_type { + /*{ + "nullable": true, + "description": "The password for the shortlink, if you want to restrict access to it. This can only be set if your subscription allows for it. Otherwise, it will return an error. When you access the link it will be required to enter this password through basic auth. The username will be `{anything}` and the password will be the password you set here." +}*/ + password?: string; + /*{ + "default": false, + "description": "If the shortlink should be restricted to the user's organization to view. This only applies to org shortlinks. If you are creating a user shortlink and you are not a member of a team or enterprise and you try to set this to true, it will fail." +}*/ + restrict_to_org: boolean; + /* format:uri, description:The URL to redirect back to. */ + url: string; +} + +export interface CreateShortlinkResponse_type { + key: string /* The key for this url. This is what you use to update or delete the specific shortlink. */; + /* format:uri, description:The shortened url. */ + url: string; +} + export type CreatedAtSortMode_type = | 'created_at_ascending' | 'created_at_descending'; @@ -2172,7 +2193,19 @@ export type ModelingAppOrganizationSubscriptionTier_type = | 'team' | 'enterprise'; +export type ModelingAppShareLinks_type = + | 'public' + | 'password_protected' + | 'organization_only'; + export interface ModelingAppSubscriptionTier_type { + /*{ + "nullable": true, + "format": "uint", + "minimum": 0, + "description": "Annual discount. The percentage off the monthly price if the user pays annually." +}*/ + annual_discount?: number; description: string /* A description of the tier. */; /* minItems:0, maxItems:15, description:Features that are included in the subscription. */ features: SubscriptionTierFeature_type[]; @@ -2184,6 +2217,7 @@ export interface ModelingAppSubscriptionTier_type { }*/ pay_as_you_go_credits: number; price: SubscriptionTierPrice_type /* The price of the tier per month. If this is for an individual, this is the price they pay. If this is for an organization, this is the price the organization pays per member in the org. This is in USD. */; + share_links: ModelingAppShareLinks_type[] /* The options for sharable links through the modeling app. */; support_tier: SupportTier_type /* The support tier the subscription provides. */; training_data_behavior: SubscriptionTrainingDataBehavior_type /* The behavior of the users data (can it be used for training, etc). */; type: SubscriptionTierType_type /* If the tier is offered for an individual or an org. */; @@ -2600,6 +2634,15 @@ export type ModelingCmd_type = object_id: string; type: 'solid3d_get_prev_adjacent_edge'; } + | { + /*{ + "format": "uuid" +}*/ + face_ids: string[]; + /* format:uuid, description:Which object is being queried. */ + object_id: string; + type: 'solid3d_get_common_edge'; + } | { /* default:fillet, description:How to apply the cut. */ cut_type: CutType_type; @@ -3549,6 +3592,13 @@ export type OkModelingCmdResponse_type = } | { /*{ + "$ref": "#/components/schemas/Solid3dGetCommonEdge" +}*/ + data: Solid3dGetCommonEdge_type; + type: 'solid3d_get_common_edge'; + } + | { + /*{ "$ref": "#/components/schemas/GetEntityType" }*/ data: GetEntityType_type; @@ -4450,6 +4500,36 @@ export interface SetSelectionType_type {} /* Empty object */ export interface SetTool_type {} /* Empty object */ +export interface Shortlink_type { + /* title:DateTime, format:date-time, description:The date and time the shortlink was created. */ + created_at: string; + id: Uuid_type /* The unique identifier for the shortlink. */; + key: string /* The key of the shortlink. This is the short part of the URL. */; + /* nullable:true, description:The organization ID of the shortlink. */ + org_id?: Uuid_type; + /* nullable:true, description:The hash of the password for the shortlink. */ + password_hash?: string; + /*{ + "default": false, + "description": "If the shortlink should be restricted to the organization. This only applies to org shortlinks. If you are creating a user shortlink and you are not a member of a team or enterprise and you try to set this to true, it will fail." +}*/ + restrict_to_org: boolean; + /* title:DateTime, format:date-time, description:The date and time the shortlink was last updated. */ + updated_at: string; + user_id: Uuid_type /* The ID of the user that made the shortlink. */; + /* title:String, format:uri, description:The URL the shortlink redirects to. */ + value: string; +} + +export interface ShortlinkResultsPage_type { + items: Shortlink_type[] /* list of items on this page of results */; + /*{ + "nullable": true, + "description": "token used to fetch the next page of results (if any)" +}*/ + next_page?: string; +} + export interface SketchModeDisable_type {} /* Empty object */ export interface Solid2dAddHole_type {} /* Empty object */ @@ -4470,6 +4550,11 @@ export interface Solid3dGetAllOppositeEdges_type { edges: string[]; } +export interface Solid3dGetCommonEdge_type { + /* nullable:true, format:uuid, description:The UUID of the common edge, if any. */ + edge?: string; +} + export interface Solid3dGetExtrusionFaceInfo_type { faces: ExtrusionFaceInfo_type[] /* Details of each face. */; } @@ -5320,6 +5405,15 @@ export interface UpdatePaymentBalance_type { pre_pay_credits_remaining?: number; } +export interface UpdateShortlinkRequest_type { + /*{ + "nullable": true, + "description": "The password for the shortlink, if you want to restrict access to it. This can only be set if your subscription allows for it. Otherwise, it will return an error. When you access the link it will be required to enter this password through basic auth. The username will be `{anything}` and the password will be the password you set here." +}*/ + password?: string; + restrict_to_org: boolean /* If the shortlink should be restricted to the user's organization to view. This only applies to org shortlinks. If you are creating a user shortlink and you are not a member of a team or enterprise and you try to set this to true, it will fail. */; +} + export interface UpdateUser_type { company: string /* The user's company. */; discord: string /* The user's Discord handle. */; @@ -5382,6 +5476,8 @@ export interface User_type { updated_at: string; } +export type UserIdentifier_type = string; + export interface UserOrgInfo_type { /*{ "nullable": true, @@ -5535,6 +5631,13 @@ export type WebSocketResponse_type = }; export type ZooProductSubscription_type = { + /*{ + "nullable": true, + "format": "uint", + "minimum": 0, + "description": "Annual discount. The percentage off the monthly price if the user pays annually." +}*/ + annual_discount?: number; description: string /* A description of the tier. */; /* minItems:0, maxItems:15, description:Features that are included in the subscription. */ features: SubscriptionTierFeature_type[]; @@ -5546,6 +5649,7 @@ export type ZooProductSubscription_type = { }*/ pay_as_you_go_credits: number; price: SubscriptionTierPrice_type /* The price of the tier per month. If this is for an individual, this is the price they pay. If this is for an organization, this is the price the organization pays per member in the org. This is in USD. */; + share_links: ModelingAppShareLinks_type[] /* The options for sharable links through the modeling app. */; support_tier: SupportTier_type /* The support tier the subscription provides. */; training_data_behavior: SubscriptionTrainingDataBehavior_type /* The behavior of the users data (can it be used for training, etc). */; type: SubscriptionTierType_type /* If the tier is offered for an individual or an org. */; @@ -5559,11 +5663,21 @@ export interface ZooProductSubscriptions_type { export interface ZooProductSubscriptionsOrgRequest_type { /* default:team, description:A modeling app subscription. */ modeling_app: ModelingAppOrganizationSubscriptionTier_type; + /*{ + "nullable": true, + "description": "If the customer chooses to pay annually or monthly, we can add that here. The annual discount will apply if there is a discount for the subscription." +}*/ + pay_annually?: boolean; } export interface ZooProductSubscriptionsUserRequest_type { /* default:free, description:A modeling app subscription. */ modeling_app: ModelingAppIndividualSubscriptionTier_type; + /*{ + "nullable": true, + "description": "If the customer chooses to pay annually or monthly, we can add that here. The annual discount will apply if there is a discount for the subscription." +}*/ + pay_annually?: boolean; } export type ZooTool_type = @@ -5624,6 +5738,8 @@ export interface Models { Connection_type: Connection_type; CountryCode_type: CountryCode_type; Coupon_type: Coupon_type; + CreateShortlinkRequest_type: CreateShortlinkRequest_type; + CreateShortlinkResponse_type: CreateShortlinkResponse_type; CreatedAtSortMode_type: CreatedAtSortMode_type; Currency_type: Currency_type; CurveGetControlPoints_type: CurveGetControlPoints_type; @@ -5746,6 +5862,7 @@ export interface Models { ModelingAppEventType_type: ModelingAppEventType_type; ModelingAppIndividualSubscriptionTier_type: ModelingAppIndividualSubscriptionTier_type; ModelingAppOrganizationSubscriptionTier_type: ModelingAppOrganizationSubscriptionTier_type; + ModelingAppShareLinks_type: ModelingAppShareLinks_type; ModelingAppSubscriptionTier_type: ModelingAppSubscriptionTier_type; ModelingAppSubscriptionTierName_type: ModelingAppSubscriptionTierName_type; ModelingCmd_type: ModelingCmd_type; @@ -5832,11 +5949,14 @@ export interface Models { SetSelectionFilter_type: SetSelectionFilter_type; SetSelectionType_type: SetSelectionType_type; SetTool_type: SetTool_type; + Shortlink_type: Shortlink_type; + ShortlinkResultsPage_type: ShortlinkResultsPage_type; SketchModeDisable_type: SketchModeDisable_type; Solid2dAddHole_type: Solid2dAddHole_type; Solid3dFilletEdge_type: Solid3dFilletEdge_type; Solid3dGetAllEdgeFaces_type: Solid3dGetAllEdgeFaces_type; Solid3dGetAllOppositeEdges_type: Solid3dGetAllOppositeEdges_type; + Solid3dGetCommonEdge_type: Solid3dGetCommonEdge_type; Solid3dGetExtrusionFaceInfo_type: Solid3dGetExtrusionFaceInfo_type; Solid3dGetNextAdjacentEdge_type: Solid3dGetNextAdjacentEdge_type; Solid3dGetOppositeEdge_type: Solid3dGetOppositeEdge_type; @@ -5895,8 +6015,10 @@ export interface Models { UpdateAnnotation_type: UpdateAnnotation_type; UpdateMemberToOrgBody_type: UpdateMemberToOrgBody_type; UpdatePaymentBalance_type: UpdatePaymentBalance_type; + UpdateShortlinkRequest_type: UpdateShortlinkRequest_type; UpdateUser_type: UpdateUser_type; User_type: User_type; + UserIdentifier_type: UserIdentifier_type; UserOrgInfo_type: UserOrgInfo_type; UserOrgRole_type: UserOrgRole_type; UserResultsPage_type: UserResultsPage_type; From c2dd666e446526b35a4dcbb00c71dabce199b329 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 11 Oct 2024 16:43:21 +0000 Subject: [PATCH 8/8] 2.0.8 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8b4388c..26acc52 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@kittycad/lib", - "version": "2.0.7", + "version": "2.0.8", "description": "Javascript library for KittyCAD API", "type": "module", "keywords": [