kscale 0.0.10__py3-none-any.whl → 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- kscale/__init__.py +2 -2
- kscale/api.py +3 -6
- kscale/cli.py +32 -0
- kscale/conf.py +6 -3
- kscale/requirements.txt +17 -1
- kscale/utils/checksum.py +41 -0
- kscale/utils/cli.py +28 -0
- kscale/web/api.py +14 -0
- kscale/web/cli/robot.py +100 -0
- kscale/web/cli/robot_class.py +113 -0
- kscale/web/cli/token.py +33 -0
- kscale/web/cli/user.py +33 -0
- kscale/web/clients/__init__.py +0 -0
- kscale/web/clients/base.py +314 -0
- kscale/web/clients/client.py +11 -0
- kscale/web/clients/robot.py +39 -0
- kscale/web/clients/robot_class.py +114 -0
- kscale/web/clients/user.py +10 -0
- kscale/web/gen/__init__.py +0 -0
- kscale/web/gen/api.py +73 -0
- kscale/web/utils.py +31 -0
- {kscale-0.0.10.dist-info → kscale-0.1.0.dist-info}/METADATA +29 -48
- kscale-0.1.0.dist-info/RECORD +36 -0
- {kscale-0.0.10.dist-info → kscale-0.1.0.dist-info}/WHEEL +1 -1
- kscale-0.1.0.dist-info/entry_points.txt +3 -0
- kscale/store/api.py +0 -64
- kscale/store/cli.py +0 -35
- kscale/store/client.py +0 -82
- kscale/store/gen/api.py +0 -301
- kscale/store/pybullet.py +0 -180
- kscale/store/urdf.py +0 -193
- kscale/store/utils.py +0 -33
- kscale-0.0.10.dist-info/RECORD +0 -26
- kscale-0.0.10.dist-info/entry_points.txt +0 -2
- /kscale/{store → web}/__init__.py +0 -0
- /kscale/{store/gen → web/cli}/__init__.py +0 -0
- {kscale-0.0.10.dist-info → kscale-0.1.0.dist-info}/LICENSE +0 -0
- {kscale-0.0.10.dist-info → kscale-0.1.0.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.2
|
2
2
|
Name: kscale
|
3
|
-
Version: 0.0
|
3
|
+
Version: 0.1.0
|
4
4
|
Summary: The kscale project
|
5
5
|
Home-page: https://github.com/kscalelabs/kscale
|
6
6
|
Author: Benjamin Bolte
|
@@ -8,23 +8,35 @@ Requires-Python: >=3.11
|
|
8
8
|
Description-Content-Type: text/markdown
|
9
9
|
License-File: LICENSE
|
10
10
|
Requires-Dist: omegaconf
|
11
|
-
Requires-Dist:
|
11
|
+
Requires-Dist: email_validator
|
12
|
+
Requires-Dist: colorlogging
|
13
|
+
Requires-Dist: aiohttp
|
14
|
+
Requires-Dist: cryptography
|
12
15
|
Requires-Dist: httpx
|
13
|
-
Requires-Dist: requests
|
14
16
|
Requires-Dist: pydantic
|
17
|
+
Requires-Dist: pyjwt
|
18
|
+
Requires-Dist: requests
|
19
|
+
Requires-Dist: yarl
|
20
|
+
Requires-Dist: aiofiles
|
21
|
+
Requires-Dist: click
|
22
|
+
Requires-Dist: tabulate
|
23
|
+
Requires-Dist: async-lru
|
24
|
+
Requires-Dist: krec
|
15
25
|
Provides-Extra: dev
|
16
|
-
Requires-Dist: black
|
17
|
-
Requires-Dist: darglint
|
18
|
-
Requires-Dist: mypy
|
19
|
-
Requires-Dist: pytest
|
20
|
-
Requires-Dist: ruff
|
21
|
-
Requires-Dist: datamodel-code-generator
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
26
|
+
Requires-Dist: black; extra == "dev"
|
27
|
+
Requires-Dist: darglint; extra == "dev"
|
28
|
+
Requires-Dist: mypy; extra == "dev"
|
29
|
+
Requires-Dist: pytest; extra == "dev"
|
30
|
+
Requires-Dist: ruff; extra == "dev"
|
31
|
+
Requires-Dist: datamodel-code-generator; extra == "dev"
|
32
|
+
Dynamic: author
|
33
|
+
Dynamic: description
|
34
|
+
Dynamic: description-content-type
|
35
|
+
Dynamic: home-page
|
36
|
+
Dynamic: provides-extra
|
37
|
+
Dynamic: requires-dist
|
38
|
+
Dynamic: requires-python
|
39
|
+
Dynamic: summary
|
28
40
|
|
29
41
|
<div align="center">
|
30
42
|
|
@@ -43,41 +55,10 @@ Requires-Dist: datamodel-code-generator ; extra == 'dev'
|
|
43
55
|
|
44
56
|
# K-Scale Command Line Interface
|
45
57
|
|
46
|
-
This is a command line tool for interacting with various services provided by K-Scale Labs,
|
47
|
-
|
48
|
-
- [K-Scale Store](https://kscale.store/)
|
58
|
+
This is a command line tool for interacting with various services provided by K-Scale Labs. For more information, see the [documentation](https://docs.kscale.dev/pkg/intro).
|
49
59
|
|
50
60
|
## Installation
|
51
61
|
|
52
62
|
```bash
|
53
63
|
pip install kscale
|
54
64
|
```
|
55
|
-
|
56
|
-
## Usage
|
57
|
-
|
58
|
-
### CLI
|
59
|
-
|
60
|
-
Download a URDF from the K-Scale Store:
|
61
|
-
|
62
|
-
```bash
|
63
|
-
kscale urdf download <artifact_id>
|
64
|
-
```
|
65
|
-
|
66
|
-
Upload a URDF to the K-Scale Store:
|
67
|
-
|
68
|
-
```bash
|
69
|
-
kscale urdf upload <artifact_id> <root_dir>
|
70
|
-
```
|
71
|
-
|
72
|
-
### Python API
|
73
|
-
|
74
|
-
Reference a URDF by ID from the K-Scale Store:
|
75
|
-
|
76
|
-
```python
|
77
|
-
from kscale import KScale
|
78
|
-
|
79
|
-
async def main():
|
80
|
-
kscale = KScale()
|
81
|
-
urdf_dir_path = await kscale.store.urdf("123456")
|
82
|
-
print(urdf_dir_path)
|
83
|
-
```
|
@@ -0,0 +1,36 @@
|
|
1
|
+
kscale/__init__.py,sha256=2jGtLxds4EdX8FEGT3yA74b0VgrkOEBx_PxiWvoh924,172
|
2
|
+
kscale/api.py,sha256=jmiuFurTN_Gj_-k-6asqxw8wp-_bgJUXgMPFgJ4lqHA,230
|
3
|
+
kscale/cli.py,sha256=PMHLKR5UwdbbReVmqHXpJ-K9-mGHv_0I7KQkwxmFcUA,881
|
4
|
+
kscale/conf.py,sha256=i5gDTs8D73l2OvX4pOlPWtT2PC26MmoKw3PPwf8HM7U,1526
|
5
|
+
kscale/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
|
+
kscale/requirements-dev.txt,sha256=WI7-ea4IRJakmqVMN8QKhOsDGrghwtvk03aIsFaNSIw,130
|
7
|
+
kscale/requirements.txt,sha256=lKDpyebp9nHZ2uHIuS6FQ6SAg7YO_0sDyb67MFmP4h4,214
|
8
|
+
kscale/artifacts/__init__.py,sha256=RK8wdybtCJPgdLLJ8R8-YMi1Ph5ojqAKVJZowHONtgo,232
|
9
|
+
kscale/artifacts/plane.obj,sha256=x59-IIrWpLjhotChiqT2Ul6U8s0RcHkaEeUZb4KXL1c,348
|
10
|
+
kscale/artifacts/plane.urdf,sha256=LCiTk14AyTHjkZ1jvsb0hNaEaJUxDb8Z1JjsgpXu3YM,819
|
11
|
+
kscale/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
12
|
+
kscale/utils/api_base.py,sha256=Kk_WtRDdJHmOg6NtHmVxVrcfARSUkhfr29ypLch_pO0,112
|
13
|
+
kscale/utils/checksum.py,sha256=jt6QmmQND9zrOEnUtOfZpLYROhgto4Gh3OpdUWk4tZA,1093
|
14
|
+
kscale/utils/cli.py,sha256=JoaY5x5SdUx97KmMM9j5AjRRUqqrTlJ9qVckZptEsYA,827
|
15
|
+
kscale/web/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
16
|
+
kscale/web/api.py,sha256=YioIdruq7LCKSBf9SvOGkv914W36_zBmpTzsJqKc0wE,439
|
17
|
+
kscale/web/utils.py,sha256=KFB9lrgn_2BRY38Sfbb_QOKZ8fWyINqIqLPwN0rjbyk,806
|
18
|
+
kscale/web/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
19
|
+
kscale/web/cli/robot.py,sha256=rI-A4_0uvJPeA71Apl4Z3mV5fIfWkgmzT9JRmJYxz3A,3307
|
20
|
+
kscale/web/cli/robot_class.py,sha256=ymC5phUqofvOXv5P6f51b9lMK5eRDaavvnzS0x9rDbU,3574
|
21
|
+
kscale/web/cli/token.py,sha256=1rFC8MYKtqbNsQa2KIqwW1tqpaMtFaxuNsallwejXTU,787
|
22
|
+
kscale/web/cli/user.py,sha256=qO0z2K5uA48hEiOOYEzv6BO2nOlCpITTDZFuiNl6d34,817
|
23
|
+
kscale/web/clients/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
24
|
+
kscale/web/clients/base.py,sha256=NRqRH2JTXjJLUMDM93txKgwFu9bQRYhCYLYy7vE76Ik,11462
|
25
|
+
kscale/web/clients/client.py,sha256=QjBicdHQYNoUG9XRjAYmGu3THae9DzWa_hQox3OO1Gw,214
|
26
|
+
kscale/web/clients/robot.py,sha256=HMfJnkDxaJ_o7X2vdYYS9iob1JRoBG2qiGmQpCQZpAk,1485
|
27
|
+
kscale/web/clients/robot_class.py,sha256=yC0G4pVPDoEskf0QfQLxejyDgHLT8gR1RLJ8ioCGoOM,4236
|
28
|
+
kscale/web/clients/user.py,sha256=9iv8J-ROm_yBIwi-0oqldReLkNBFktdHRv3UCOxBzjY,377
|
29
|
+
kscale/web/gen/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
30
|
+
kscale/web/gen/api.py,sha256=SovcII36JFgK9jd2CXlLPMjiUROGB4vEnapOsYMUrkU,2188
|
31
|
+
kscale-0.1.0.dist-info/LICENSE,sha256=HCN2bImAzUOXldAZZI7JZ9PYq6OwMlDAP_PpX1HnuN0,1071
|
32
|
+
kscale-0.1.0.dist-info/METADATA,sha256=EBGeAHNhtgjRQ38M_3n_mQ1LFlaogmA3qgUsVa45zEA,2340
|
33
|
+
kscale-0.1.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
34
|
+
kscale-0.1.0.dist-info/entry_points.txt,sha256=N_0pCpPnwGDYVzOeuaSOrbJkS5L3lS9d8CxpJF1f8UI,62
|
35
|
+
kscale-0.1.0.dist-info/top_level.txt,sha256=C2ynjYwopg6YjgttnI2dJjasyq3EKNmYp-IfQg9Xms4,7
|
36
|
+
kscale-0.1.0.dist-info/RECORD,,
|
kscale/store/api.py
DELETED
@@ -1,64 +0,0 @@
|
|
1
|
-
"""Defines a common interface for the K-Scale Store API."""
|
2
|
-
|
3
|
-
from pathlib import Path
|
4
|
-
from typing import overload
|
5
|
-
|
6
|
-
from kscale.store.gen.api import UploadArtifactResponse
|
7
|
-
from kscale.store.urdf import download_urdf, upload_urdf
|
8
|
-
from kscale.utils.api_base import APIBase
|
9
|
-
|
10
|
-
|
11
|
-
class StoreAPI(APIBase):
|
12
|
-
def __init__(
|
13
|
-
self,
|
14
|
-
*,
|
15
|
-
api_key: str | None = None,
|
16
|
-
) -> None:
|
17
|
-
super().__init__()
|
18
|
-
|
19
|
-
self.api_key = api_key
|
20
|
-
|
21
|
-
async def artifact_root(self, artifact_id: str) -> Path:
|
22
|
-
return await download_urdf(artifact_id)
|
23
|
-
|
24
|
-
@overload
|
25
|
-
async def urdf_path(self, artifact_id: str) -> Path: ...
|
26
|
-
|
27
|
-
@overload
|
28
|
-
async def urdf_path(self, artifact_id: str, *, throw_if_missing: bool = True) -> Path | None: ...
|
29
|
-
|
30
|
-
async def urdf_path(self, artifact_id: str, *, throw_if_missing: bool = True) -> Path | None:
|
31
|
-
root_dir = await self.artifact_root(artifact_id)
|
32
|
-
urdf_path = next(root_dir.glob("*.urdf"), None)
|
33
|
-
if urdf_path is None and throw_if_missing:
|
34
|
-
raise FileNotFoundError(f"No URDF found for artifact {artifact_id}")
|
35
|
-
return urdf_path
|
36
|
-
|
37
|
-
@overload
|
38
|
-
async def mjcf_path(self, artifact_id: str) -> Path: ...
|
39
|
-
|
40
|
-
@overload
|
41
|
-
async def mjcf_path(self, artifact_id: str, *, throw_if_missing: bool = True) -> Path | None: ...
|
42
|
-
|
43
|
-
async def mjcf_path(self, artifact_id: str, *, throw_if_missing: bool = True) -> Path | None:
|
44
|
-
root_dir = await self.artifact_root(artifact_id)
|
45
|
-
mjcf_path = next(root_dir.glob("*.mjcf"), None)
|
46
|
-
if mjcf_path is None and throw_if_missing:
|
47
|
-
raise FileNotFoundError(f"No MJCF found for artifact {artifact_id}")
|
48
|
-
return mjcf_path
|
49
|
-
|
50
|
-
@overload
|
51
|
-
async def xml_path(self, artifact_id: str) -> Path: ...
|
52
|
-
|
53
|
-
@overload
|
54
|
-
async def xml_path(self, artifact_id: str, *, throw_if_missing: bool = True) -> Path | None: ...
|
55
|
-
|
56
|
-
async def xml_path(self, artifact_id: str, *, throw_if_missing: bool = True) -> Path | None:
|
57
|
-
root_dir = await self.artifact_root(artifact_id)
|
58
|
-
xml_path = next(root_dir.glob("*.xml"), None)
|
59
|
-
if xml_path is None and throw_if_missing:
|
60
|
-
raise FileNotFoundError(f"No XML found for artifact {artifact_id}")
|
61
|
-
return xml_path
|
62
|
-
|
63
|
-
async def upload_urdf(self, listing_id: str, root_dir: Path) -> UploadArtifactResponse:
|
64
|
-
return await upload_urdf(listing_id, root_dir)
|
kscale/store/cli.py
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
"""Defines the top-level KOL CLI."""
|
2
|
-
|
3
|
-
import argparse
|
4
|
-
import asyncio
|
5
|
-
from typing import Sequence
|
6
|
-
|
7
|
-
from kscale.store import pybullet, urdf
|
8
|
-
|
9
|
-
|
10
|
-
async def main(args: Sequence[str] | None = None) -> None:
|
11
|
-
parser = argparse.ArgumentParser(description="K-Scale OnShape Library", add_help=False)
|
12
|
-
parser.add_argument(
|
13
|
-
"subcommand",
|
14
|
-
choices=[
|
15
|
-
"urdf",
|
16
|
-
"pybullet",
|
17
|
-
],
|
18
|
-
help="The subcommand to run",
|
19
|
-
)
|
20
|
-
parsed_args, remaining_args = parser.parse_known_args(args)
|
21
|
-
|
22
|
-
match parsed_args.subcommand:
|
23
|
-
case "urdf":
|
24
|
-
await urdf.main(remaining_args)
|
25
|
-
case "pybullet":
|
26
|
-
await pybullet.main(remaining_args)
|
27
|
-
|
28
|
-
|
29
|
-
def sync_main(args: Sequence[str] | None = None) -> None:
|
30
|
-
asyncio.run(main(args))
|
31
|
-
|
32
|
-
|
33
|
-
if __name__ == "__main__":
|
34
|
-
# python3 -m kscale.store.cli
|
35
|
-
sync_main()
|
kscale/store/client.py
DELETED
@@ -1,82 +0,0 @@
|
|
1
|
-
"""Defines a typed client for the K-Scale Store API."""
|
2
|
-
|
3
|
-
import logging
|
4
|
-
from pathlib import Path
|
5
|
-
from types import TracebackType
|
6
|
-
from typing import Any, Dict, Type
|
7
|
-
from urllib.parse import urljoin
|
8
|
-
|
9
|
-
import httpx
|
10
|
-
from pydantic import BaseModel
|
11
|
-
|
12
|
-
from kscale.store.gen.api import (
|
13
|
-
NewListingRequest,
|
14
|
-
NewListingResponse,
|
15
|
-
SingleArtifactResponse,
|
16
|
-
UploadArtifactResponse,
|
17
|
-
)
|
18
|
-
from kscale.store.utils import get_api_key, get_api_root
|
19
|
-
|
20
|
-
logger = logging.getLogger(__name__)
|
21
|
-
|
22
|
-
|
23
|
-
class KScaleStoreClient:
|
24
|
-
def __init__(self, base_url: str = get_api_root()) -> None:
|
25
|
-
self.base_url = base_url
|
26
|
-
self.client = httpx.AsyncClient(
|
27
|
-
base_url=self.base_url,
|
28
|
-
headers={"Authorization": f"Bearer {get_api_key()}"},
|
29
|
-
timeout=httpx.Timeout(30.0),
|
30
|
-
)
|
31
|
-
|
32
|
-
async def _request(
|
33
|
-
self,
|
34
|
-
method: str,
|
35
|
-
endpoint: str,
|
36
|
-
*,
|
37
|
-
params: Dict[str, Any] | None = None,
|
38
|
-
data: BaseModel | None = None,
|
39
|
-
files: Dict[str, Any] | None = None,
|
40
|
-
) -> Dict[str, Any]:
|
41
|
-
url = urljoin(self.base_url, endpoint)
|
42
|
-
kwargs: Dict[str, Any] = {"params": params}
|
43
|
-
|
44
|
-
if data:
|
45
|
-
kwargs["json"] = data.dict(exclude_unset=True)
|
46
|
-
if files:
|
47
|
-
kwargs["files"] = files
|
48
|
-
|
49
|
-
response = await self.client.request(method, url, **kwargs)
|
50
|
-
if response.is_error:
|
51
|
-
logger.error(f"Error response from K-Scale Store: {response.text}")
|
52
|
-
response.raise_for_status()
|
53
|
-
return response.json()
|
54
|
-
|
55
|
-
async def get_artifact_info(self, artifact_id: str) -> SingleArtifactResponse:
|
56
|
-
data = await self._request("GET", f"/artifacts/info/{artifact_id}")
|
57
|
-
return SingleArtifactResponse(**data)
|
58
|
-
|
59
|
-
async def upload_artifact(self, listing_id: str, file_path: str) -> UploadArtifactResponse:
|
60
|
-
file_name = Path(file_path).name
|
61
|
-
with open(file_path, "rb") as f:
|
62
|
-
files = {"files": (file_name, f, "application/gzip")}
|
63
|
-
data = await self._request("POST", f"/artifacts/upload/{listing_id}", files=files)
|
64
|
-
return UploadArtifactResponse(**data)
|
65
|
-
|
66
|
-
async def create_listing(self, request: NewListingRequest) -> NewListingResponse:
|
67
|
-
data = await self._request("POST", "/listings", data=request)
|
68
|
-
return NewListingResponse(**data)
|
69
|
-
|
70
|
-
async def close(self) -> None:
|
71
|
-
await self.client.aclose()
|
72
|
-
|
73
|
-
async def __aenter__(self) -> "KScaleStoreClient":
|
74
|
-
return self
|
75
|
-
|
76
|
-
async def __aexit__(
|
77
|
-
self,
|
78
|
-
exc_type: Type[BaseException] | None,
|
79
|
-
exc_val: BaseException | None,
|
80
|
-
exc_tb: TracebackType | None,
|
81
|
-
) -> None:
|
82
|
-
await self.close()
|
kscale/store/gen/api.py
DELETED
@@ -1,301 +0,0 @@
|
|
1
|
-
"""Auto-generated by generate.sh script."""
|
2
|
-
|
3
|
-
# generated by datamodel-codegen:
|
4
|
-
# filename: openapi.json
|
5
|
-
# timestamp: 2024-09-04T04:33:58+00:00
|
6
|
-
|
7
|
-
from __future__ import annotations
|
8
|
-
|
9
|
-
from enum import Enum
|
10
|
-
from typing import Dict, List, Optional, Union
|
11
|
-
|
12
|
-
from pydantic import BaseModel, EmailStr, Field
|
13
|
-
|
14
|
-
|
15
|
-
class ArtifactUrls(BaseModel):
|
16
|
-
small: Optional[str] = Field(None, title="Small")
|
17
|
-
large: str = Field(..., title="Large")
|
18
|
-
|
19
|
-
|
20
|
-
class AuthResponse(BaseModel):
|
21
|
-
api_key: str = Field(..., title="Api Key")
|
22
|
-
|
23
|
-
|
24
|
-
class BodyPullOnshapeDocumentOnshapePullListingIdGet(BaseModel):
|
25
|
-
suffix_to_joint_effort: Optional[Dict[str, float]] = Field(None, title="Suffix To Joint Effort")
|
26
|
-
suffix_to_joint_velocity: Optional[Dict[str, float]] = Field(None, title="Suffix To Joint Velocity")
|
27
|
-
|
28
|
-
|
29
|
-
class BodyUploadArtifactsUploadListingIdPost(BaseModel):
|
30
|
-
files: List[bytes] = Field(..., title="Files")
|
31
|
-
|
32
|
-
|
33
|
-
class ClientIdResponse(BaseModel):
|
34
|
-
client_id: str = Field(..., title="Client Id")
|
35
|
-
|
36
|
-
|
37
|
-
class DeleteTokenResponse(BaseModel):
|
38
|
-
message: str = Field(..., title="Message")
|
39
|
-
|
40
|
-
|
41
|
-
class EmailSignUpRequest(BaseModel):
|
42
|
-
email: EmailStr = Field(..., title="Email")
|
43
|
-
|
44
|
-
|
45
|
-
class EmailSignUpResponse(BaseModel):
|
46
|
-
message: str = Field(..., title="Message")
|
47
|
-
|
48
|
-
|
49
|
-
class GetListingResponse(BaseModel):
|
50
|
-
id: str = Field(..., title="Id")
|
51
|
-
name: str = Field(..., title="Name")
|
52
|
-
description: Optional[str] = Field(..., title="Description")
|
53
|
-
child_ids: List[str] = Field(..., title="Child Ids")
|
54
|
-
tags: List[str] = Field(..., title="Tags")
|
55
|
-
onshape_url: Optional[str] = Field(..., title="Onshape Url")
|
56
|
-
can_edit: bool = Field(..., title="Can Edit")
|
57
|
-
created_at: int = Field(..., title="Created At")
|
58
|
-
views: int = Field(..., title="Views")
|
59
|
-
score: int = Field(..., title="Score")
|
60
|
-
user_vote: Optional[bool] = Field(..., title="User Vote")
|
61
|
-
creator_id: str = Field(..., title="Creator Id")
|
62
|
-
|
63
|
-
|
64
|
-
class GetTokenResponse(BaseModel):
|
65
|
-
id: str = Field(..., title="Id")
|
66
|
-
email: str = Field(..., title="Email")
|
67
|
-
|
68
|
-
|
69
|
-
class GithubAuthRequest(BaseModel):
|
70
|
-
code: str = Field(..., title="Code")
|
71
|
-
|
72
|
-
|
73
|
-
class GithubAuthResponse(BaseModel):
|
74
|
-
api_key: str = Field(..., title="Api Key")
|
75
|
-
|
76
|
-
|
77
|
-
class GoogleLogin(BaseModel):
|
78
|
-
token: str = Field(..., title="Token")
|
79
|
-
|
80
|
-
|
81
|
-
class Permission(Enum):
|
82
|
-
read = "read"
|
83
|
-
write = "write"
|
84
|
-
admin = "admin"
|
85
|
-
|
86
|
-
|
87
|
-
class KeysResponseItem(BaseModel):
|
88
|
-
token: str = Field(..., title="Token")
|
89
|
-
permissions: Optional[List[Permission]] = Field(..., title="Permissions")
|
90
|
-
|
91
|
-
|
92
|
-
class ListKeysResponse(BaseModel):
|
93
|
-
keys: List[KeysResponseItem] = Field(..., title="Keys")
|
94
|
-
|
95
|
-
|
96
|
-
class ListListingsResponse(BaseModel):
|
97
|
-
listing_ids: List[str] = Field(..., title="Listing Ids")
|
98
|
-
has_next: Optional[bool] = Field(False, title="Has Next")
|
99
|
-
|
100
|
-
|
101
|
-
class Listing(BaseModel):
|
102
|
-
id: str = Field(..., title="Id")
|
103
|
-
user_id: str = Field(..., title="User Id")
|
104
|
-
created_at: int = Field(..., title="Created At")
|
105
|
-
updated_at: int = Field(..., title="Updated At")
|
106
|
-
name: str = Field(..., title="Name")
|
107
|
-
child_ids: List[str] = Field(..., title="Child Ids")
|
108
|
-
description: Optional[str] = Field(None, title="Description")
|
109
|
-
onshape_url: Optional[str] = Field(None, title="Onshape Url")
|
110
|
-
views: Optional[int] = Field(0, title="Views")
|
111
|
-
upvotes: Optional[int] = Field(0, title="Upvotes")
|
112
|
-
downvotes: Optional[int] = Field(0, title="Downvotes")
|
113
|
-
score: Optional[int] = Field(0, title="Score")
|
114
|
-
|
115
|
-
|
116
|
-
class ListingInfoResponse(BaseModel):
|
117
|
-
id: str = Field(..., title="Id")
|
118
|
-
name: str = Field(..., title="Name")
|
119
|
-
description: Optional[str] = Field(..., title="Description")
|
120
|
-
child_ids: List[str] = Field(..., title="Child Ids")
|
121
|
-
image_url: Optional[str] = Field(..., title="Image Url")
|
122
|
-
onshape_url: Optional[str] = Field(..., title="Onshape Url")
|
123
|
-
created_at: int = Field(..., title="Created At")
|
124
|
-
views: int = Field(..., title="Views")
|
125
|
-
score: int = Field(..., title="Score")
|
126
|
-
user_vote: Optional[bool] = Field(..., title="User Vote")
|
127
|
-
|
128
|
-
|
129
|
-
class LoginRequest(BaseModel):
|
130
|
-
email: EmailStr = Field(..., title="Email")
|
131
|
-
password: str = Field(..., title="Password")
|
132
|
-
|
133
|
-
|
134
|
-
class LoginResponse(BaseModel):
|
135
|
-
user_id: str = Field(..., title="User Id")
|
136
|
-
token: str = Field(..., title="Token")
|
137
|
-
|
138
|
-
|
139
|
-
class Permission1(Enum):
|
140
|
-
is_admin = "is_admin"
|
141
|
-
|
142
|
-
|
143
|
-
class MyUserInfoResponse(BaseModel):
|
144
|
-
user_id: str = Field(..., title="User Id")
|
145
|
-
email: str = Field(..., title="Email")
|
146
|
-
github_id: Optional[str] = Field(..., title="Github Id")
|
147
|
-
google_id: Optional[str] = Field(..., title="Google Id")
|
148
|
-
permissions: Optional[List[Permission1]] = Field(..., title="Permissions")
|
149
|
-
first_name: Optional[str] = Field(..., title="First Name")
|
150
|
-
last_name: Optional[str] = Field(..., title="Last Name")
|
151
|
-
name: Optional[str] = Field(..., title="Name")
|
152
|
-
bio: Optional[str] = Field(..., title="Bio")
|
153
|
-
|
154
|
-
|
155
|
-
class NewKeyRequest(BaseModel):
|
156
|
-
readonly: Optional[bool] = Field(True, title="Readonly")
|
157
|
-
|
158
|
-
|
159
|
-
class NewKeyResponse(BaseModel):
|
160
|
-
user_id: str = Field(..., title="User Id")
|
161
|
-
key: KeysResponseItem
|
162
|
-
|
163
|
-
|
164
|
-
class NewListingRequest(BaseModel):
|
165
|
-
name: str = Field(..., title="Name")
|
166
|
-
child_ids: List[str] = Field(..., title="Child Ids")
|
167
|
-
description: Optional[str] = Field(..., title="Description")
|
168
|
-
|
169
|
-
|
170
|
-
class NewListingResponse(BaseModel):
|
171
|
-
listing_id: str = Field(..., title="Listing Id")
|
172
|
-
|
173
|
-
|
174
|
-
class PublicUserInfoResponseItem(BaseModel):
|
175
|
-
id: str = Field(..., title="Id")
|
176
|
-
email: str = Field(..., title="Email")
|
177
|
-
permissions: Optional[List[Permission1]] = Field(None, title="Permissions")
|
178
|
-
created_at: Optional[int] = Field(None, title="Created At")
|
179
|
-
updated_at: Optional[int] = Field(None, title="Updated At")
|
180
|
-
first_name: Optional[str] = Field(None, title="First Name")
|
181
|
-
last_name: Optional[str] = Field(None, title="Last Name")
|
182
|
-
name: Optional[str] = Field(None, title="Name")
|
183
|
-
bio: Optional[str] = Field(None, title="Bio")
|
184
|
-
|
185
|
-
|
186
|
-
class PublicUsersInfoResponse(BaseModel):
|
187
|
-
users: List[PublicUserInfoResponseItem] = Field(..., title="Users")
|
188
|
-
|
189
|
-
|
190
|
-
class SetRequest(BaseModel):
|
191
|
-
onshape_url: Optional[str] = Field(..., title="Onshape Url")
|
192
|
-
|
193
|
-
|
194
|
-
class ArtifactType(Enum):
|
195
|
-
image = "image"
|
196
|
-
|
197
|
-
|
198
|
-
class ArtifactType1(Enum):
|
199
|
-
urdf = "urdf"
|
200
|
-
mjcf = "mjcf"
|
201
|
-
|
202
|
-
|
203
|
-
class ArtifactType2(Enum):
|
204
|
-
stl = "stl"
|
205
|
-
obj = "obj"
|
206
|
-
dae = "dae"
|
207
|
-
ply = "ply"
|
208
|
-
|
209
|
-
|
210
|
-
class ArtifactType3(Enum):
|
211
|
-
tgz = "tgz"
|
212
|
-
zip = "zip"
|
213
|
-
|
214
|
-
|
215
|
-
class SingleArtifactResponse(BaseModel):
|
216
|
-
artifact_id: str = Field(..., title="Artifact Id")
|
217
|
-
listing_id: str = Field(..., title="Listing Id")
|
218
|
-
name: str = Field(..., title="Name")
|
219
|
-
artifact_type: Union[ArtifactType, ArtifactType1, ArtifactType2, ArtifactType3] = Field(..., title="Artifact Type")
|
220
|
-
description: Optional[str] = Field(..., title="Description")
|
221
|
-
timestamp: int = Field(..., title="Timestamp")
|
222
|
-
urls: ArtifactUrls
|
223
|
-
is_new: Optional[bool] = Field(None, title="Is New")
|
224
|
-
|
225
|
-
|
226
|
-
class SortOption(Enum):
|
227
|
-
newest = "newest"
|
228
|
-
most_viewed = "most_viewed"
|
229
|
-
most_upvoted = "most_upvoted"
|
230
|
-
|
231
|
-
|
232
|
-
class UpdateArtifactRequest(BaseModel):
|
233
|
-
name: Optional[str] = Field(None, title="Name")
|
234
|
-
description: Optional[str] = Field(None, title="Description")
|
235
|
-
|
236
|
-
|
237
|
-
class UpdateListingRequest(BaseModel):
|
238
|
-
name: Optional[str] = Field(None, title="Name")
|
239
|
-
child_ids: Optional[List[str]] = Field(None, title="Child Ids")
|
240
|
-
description: Optional[str] = Field(None, title="Description")
|
241
|
-
tags: Optional[List[str]] = Field(None, title="Tags")
|
242
|
-
|
243
|
-
|
244
|
-
class UpdateUserRequest(BaseModel):
|
245
|
-
email: Optional[str] = Field(None, title="Email")
|
246
|
-
password: Optional[str] = Field(None, title="Password")
|
247
|
-
github_id: Optional[str] = Field(None, title="Github Id")
|
248
|
-
google_id: Optional[str] = Field(None, title="Google Id")
|
249
|
-
first_name: Optional[str] = Field(None, title="First Name")
|
250
|
-
last_name: Optional[str] = Field(None, title="Last Name")
|
251
|
-
name: Optional[str] = Field(None, title="Name")
|
252
|
-
bio: Optional[str] = Field(None, title="Bio")
|
253
|
-
|
254
|
-
|
255
|
-
class UploadArtifactResponse(BaseModel):
|
256
|
-
artifacts: List[SingleArtifactResponse] = Field(..., title="Artifacts")
|
257
|
-
|
258
|
-
|
259
|
-
class UserInfoResponseItem(BaseModel):
|
260
|
-
id: str = Field(..., title="Id")
|
261
|
-
email: str = Field(..., title="Email")
|
262
|
-
|
263
|
-
|
264
|
-
class UserPublic(BaseModel):
|
265
|
-
id: str = Field(..., title="Id")
|
266
|
-
email: str = Field(..., title="Email")
|
267
|
-
permissions: Optional[List[Permission1]] = Field(None, title="Permissions")
|
268
|
-
created_at: int = Field(..., title="Created At")
|
269
|
-
updated_at: Optional[int] = Field(None, title="Updated At")
|
270
|
-
first_name: Optional[str] = Field(None, title="First Name")
|
271
|
-
last_name: Optional[str] = Field(None, title="Last Name")
|
272
|
-
name: Optional[str] = Field(None, title="Name")
|
273
|
-
bio: Optional[str] = Field(None, title="Bio")
|
274
|
-
|
275
|
-
|
276
|
-
class UserSignup(BaseModel):
|
277
|
-
signup_token_id: str = Field(..., title="Signup Token Id")
|
278
|
-
email: str = Field(..., title="Email")
|
279
|
-
password: str = Field(..., title="Password")
|
280
|
-
|
281
|
-
|
282
|
-
class ValidationError(BaseModel):
|
283
|
-
loc: List[Union[str, int]] = Field(..., title="Location")
|
284
|
-
msg: str = Field(..., title="Message")
|
285
|
-
type: str = Field(..., title="Error Type")
|
286
|
-
|
287
|
-
|
288
|
-
class DumpListingsResponse(BaseModel):
|
289
|
-
listings: List[Listing] = Field(..., title="Listings")
|
290
|
-
|
291
|
-
|
292
|
-
class GetBatchListingsResponse(BaseModel):
|
293
|
-
listings: List[ListingInfoResponse] = Field(..., title="Listings")
|
294
|
-
|
295
|
-
|
296
|
-
class HTTPValidationError(BaseModel):
|
297
|
-
detail: Optional[List[ValidationError]] = Field(None, title="Detail")
|
298
|
-
|
299
|
-
|
300
|
-
class ListArtifactsResponse(BaseModel):
|
301
|
-
artifacts: List[SingleArtifactResponse] = Field(..., title="Artifacts")
|