diff --git a/.github/workflows/update-spec-for-docs.yml b/.github/workflows/update-spec-for-docs.yml index e6c47f7..8d20c45 100644 --- a/.github/workflows/update-spec-for-docs.yml +++ b/.github/workflows/update-spec-for-docs.yml @@ -22,7 +22,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3.5.1 with: - node-version: '16' + node-version: '18' cache: 'yarn' - run: yarn install - run: yarn gen 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" 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": [ 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.", diff --git a/src/apiGen.ts b/src/apiGen.ts index 3fd4048..eff56cb 100644 --- a/src/apiGen.ts +++ b/src/apiGen.ts @@ -144,6 +144,16 @@ 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 ( + reffedSchema.type === 'string' && + refName == 'CodeLanguage' + ) { + inputParamsExamples.push(`${name}: '${'node'}'`); } } else { if (schema.type === 'number' || schema.type === 'integer') { @@ -284,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')`, ); 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', ];