superb-ai-onprem 0.3.3__py3-none-any.whl → 0.3.5__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.
Potentially problematic release.
This version of superb-ai-onprem might be problematic. Click here for more details.
- spb_onprem/__init__.py +5 -0
- spb_onprem/_version.py +2 -2
- spb_onprem/contents/queries.py +27 -5
- spb_onprem/contents/service.py +21 -3
- spb_onprem/entities.py +2 -0
- {superb_ai_onprem-0.3.3.dist-info → superb_ai_onprem-0.3.5.dist-info}/METADATA +1 -1
- {superb_ai_onprem-0.3.3.dist-info → superb_ai_onprem-0.3.5.dist-info}/RECORD +10 -10
- {superb_ai_onprem-0.3.3.dist-info → superb_ai_onprem-0.3.5.dist-info}/WHEEL +0 -0
- {superb_ai_onprem-0.3.3.dist-info → superb_ai_onprem-0.3.5.dist-info}/licenses/LICENSE +0 -0
- {superb_ai_onprem-0.3.3.dist-info → superb_ai_onprem-0.3.5.dist-info}/top_level.txt +0 -0
spb_onprem/__init__.py
CHANGED
|
@@ -9,6 +9,7 @@ from .data.service import DataService
|
|
|
9
9
|
from .slices.service import SliceService
|
|
10
10
|
from .activities.service import ActivityService
|
|
11
11
|
from .exports.service import ExportService
|
|
12
|
+
from .contents.service import ContentService
|
|
12
13
|
|
|
13
14
|
# Core Entities and Enums
|
|
14
15
|
from .entities import (
|
|
@@ -24,6 +25,7 @@ from .entities import (
|
|
|
24
25
|
Activity,
|
|
25
26
|
ActivityHistory,
|
|
26
27
|
Export,
|
|
28
|
+
Content,
|
|
27
29
|
|
|
28
30
|
# Enums
|
|
29
31
|
DataType,
|
|
@@ -57,6 +59,7 @@ __all__ = (
|
|
|
57
59
|
"SliceService",
|
|
58
60
|
"ActivityService",
|
|
59
61
|
"ExportService",
|
|
62
|
+
"ContentService",
|
|
60
63
|
|
|
61
64
|
# Core Entities
|
|
62
65
|
"Data",
|
|
@@ -70,6 +73,8 @@ __all__ = (
|
|
|
70
73
|
"Activity",
|
|
71
74
|
"ActivityHistory",
|
|
72
75
|
"Export",
|
|
76
|
+
"Content",
|
|
77
|
+
|
|
73
78
|
# Enums
|
|
74
79
|
"DataType",
|
|
75
80
|
"SceneType",
|
spb_onprem/_version.py
CHANGED
spb_onprem/contents/queries.py
CHANGED
|
@@ -13,17 +13,21 @@ class Queries:
|
|
|
13
13
|
@staticmethod
|
|
14
14
|
def create_variables(
|
|
15
15
|
key: Union[str, UndefinedType] = Undefined,
|
|
16
|
+
content_type: Union[str, UndefinedType] = Undefined,
|
|
16
17
|
):
|
|
18
|
+
params = {}
|
|
19
|
+
|
|
17
20
|
if key is not Undefined:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
params["key"] = key
|
|
22
|
+
if content_type is not Undefined:
|
|
23
|
+
params["contentType"] = content_type
|
|
24
|
+
return params
|
|
21
25
|
|
|
22
26
|
CREATE = {
|
|
23
27
|
"name": "createContent",
|
|
24
28
|
"query": '''
|
|
25
|
-
mutation CreateContent($key: String) {
|
|
26
|
-
createContent(key: $key) {
|
|
29
|
+
mutation CreateContent($key: String, $content_type: String) {
|
|
30
|
+
createContent(key: $key, contentType: $content_type) {
|
|
27
31
|
content {
|
|
28
32
|
id
|
|
29
33
|
key
|
|
@@ -37,3 +41,21 @@ class Queries:
|
|
|
37
41
|
''',
|
|
38
42
|
"variables": create_variables
|
|
39
43
|
}
|
|
44
|
+
|
|
45
|
+
@staticmethod
|
|
46
|
+
def get_download_url_params(
|
|
47
|
+
content_id: str,
|
|
48
|
+
):
|
|
49
|
+
return {
|
|
50
|
+
"id": content_id
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
GET_DOWNLOAD_URL = {
|
|
54
|
+
"name": "generateContentDownloadURL",
|
|
55
|
+
"query": '''
|
|
56
|
+
mutation GenerateContentDownloadURL($id: ID!) {
|
|
57
|
+
generateContentDownloadURL(id: $id)
|
|
58
|
+
}
|
|
59
|
+
''',
|
|
60
|
+
"variables": get_download_url_params
|
|
61
|
+
}
|
spb_onprem/contents/service.py
CHANGED
|
@@ -39,7 +39,7 @@ class ContentService(BaseService):
|
|
|
39
39
|
file = f.read()
|
|
40
40
|
response = self.request_gql(
|
|
41
41
|
query=Queries.CREATE,
|
|
42
|
-
variables=Queries.CREATE["variables"](key)
|
|
42
|
+
variables=Queries.CREATE["variables"](key, mimetypes.guess_type(file_path)[0])
|
|
43
43
|
)
|
|
44
44
|
upload_url = response['uploadURL']
|
|
45
45
|
|
|
@@ -73,7 +73,7 @@ class ContentService(BaseService):
|
|
|
73
73
|
'''
|
|
74
74
|
response = self.request_gql(
|
|
75
75
|
query=Queries.CREATE,
|
|
76
|
-
variables=Queries.CREATE["variables"](key) if key else None
|
|
76
|
+
variables=Queries.CREATE["variables"](key, "application/json") if key else None
|
|
77
77
|
)
|
|
78
78
|
upload_url = response['uploadURL']
|
|
79
79
|
self.request(
|
|
@@ -113,7 +113,7 @@ class ContentService(BaseService):
|
|
|
113
113
|
# Request to get the upload URL
|
|
114
114
|
response = self.request_gql(
|
|
115
115
|
query=Queries.CREATE,
|
|
116
|
-
variables=Queries.CREATE["variables"](key)
|
|
116
|
+
variables=Queries.CREATE["variables"](key, content_type)
|
|
117
117
|
)
|
|
118
118
|
upload_url = response['uploadURL']
|
|
119
119
|
|
|
@@ -130,3 +130,21 @@ class ContentService(BaseService):
|
|
|
130
130
|
# Retrieve the uploaded content details
|
|
131
131
|
content = response['content']
|
|
132
132
|
return BaseContent.model_validate(content)
|
|
133
|
+
|
|
134
|
+
def get_download_url(
|
|
135
|
+
self,
|
|
136
|
+
content_id: str,
|
|
137
|
+
) -> str:
|
|
138
|
+
'''
|
|
139
|
+
Gets the content from the server.
|
|
140
|
+
Args:
|
|
141
|
+
content_id (str): The ID of the content to get.
|
|
142
|
+
Returns:
|
|
143
|
+
Content: The content object.
|
|
144
|
+
'''
|
|
145
|
+
|
|
146
|
+
response = self.request_gql(
|
|
147
|
+
query=Queries.GET_DOWNLOAD_URL,
|
|
148
|
+
variables=Queries.GET_DOWNLOAD_URL["variables"](content_id)
|
|
149
|
+
)
|
|
150
|
+
return response
|
spb_onprem/entities.py
CHANGED
|
@@ -22,6 +22,7 @@ from .activities.entities import (
|
|
|
22
22
|
SchemaType,
|
|
23
23
|
)
|
|
24
24
|
from .exports.entities import Export
|
|
25
|
+
from .contents.entities import Content
|
|
25
26
|
|
|
26
27
|
__all__ = [
|
|
27
28
|
# Core Entities
|
|
@@ -36,6 +37,7 @@ __all__ = [
|
|
|
36
37
|
"Activity",
|
|
37
38
|
"ActivityHistory",
|
|
38
39
|
"Export",
|
|
40
|
+
"Content",
|
|
39
41
|
|
|
40
42
|
# Enums
|
|
41
43
|
"DataType",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
spb_onprem/__init__.py,sha256=
|
|
2
|
-
spb_onprem/_version.py,sha256=
|
|
1
|
+
spb_onprem/__init__.py,sha256=luroRpOs-soHW_qKNeRzkpRR64KXxKPfcpC-wQO4h60,1861
|
|
2
|
+
spb_onprem/_version.py,sha256=qmTn4w-xTKk8dVv-032b430C-ilxMTkr9Q0HieU18N8,511
|
|
3
3
|
spb_onprem/base_model.py,sha256=XLtyoxRBs68LrvbFH8V4EvQGPc2W17koC310MnS37jc,442
|
|
4
4
|
spb_onprem/base_service.py,sha256=dPfr3mGXYlqadOXycu6RBFX1HcZ1qzEsskLoOxERLOU,5737
|
|
5
5
|
spb_onprem/base_types.py,sha256=5HO6uy6qf08b4KSElwIaGy7UkoQG2KqVO6gcHbsqqSo,269
|
|
6
|
-
spb_onprem/entities.py,sha256=
|
|
6
|
+
spb_onprem/entities.py,sha256=VOFosKVcj85xk8N8SLFYGxZv4EtDAnzzmE3NBj144Tk,877
|
|
7
7
|
spb_onprem/exceptions.py,sha256=jx5rTGsVZ5shOdbgQzk8GcSyMWFtb_3xhPq6Sylwc5o,478
|
|
8
8
|
spb_onprem/searches.py,sha256=VRj9vpvKU8iOdBJUA6BwfvOjUbWrKBo9fPJvNlRmKr0,750
|
|
9
9
|
spb_onprem/activities/__init__.py,sha256=iTHUza8mtiBd_QEPH-0tzrOsd_VSwSQNMbzVWfebQ6c,175
|
|
@@ -22,8 +22,8 @@ spb_onprem/activities/params/start_activity.py,sha256=uBf78FYkjGkM5g8shIoMgz8qoC
|
|
|
22
22
|
spb_onprem/activities/params/update_activity.py,sha256=QU3h2YkPFkqHEHXv6078V2PWEa272h60ST6FYPPZLWU,2615
|
|
23
23
|
spb_onprem/activities/params/update_activity_history.py,sha256=ScWxOG7pZ-7WcTzvJleZIm-TsZVTRkwNrTCyNDyyVSc,1620
|
|
24
24
|
spb_onprem/contents/__init__.py,sha256=9EfIMQxbJuUZVUqsTa3Ji-yDidFPQQB5gnJI4R01YWI,74
|
|
25
|
-
spb_onprem/contents/queries.py,sha256=
|
|
26
|
-
spb_onprem/contents/service.py,sha256=
|
|
25
|
+
spb_onprem/contents/queries.py,sha256=lNoLTlYKouv9KIhVnM3ZQBkCx3u6DHAy3PwF31VVXj4,1501
|
|
26
|
+
spb_onprem/contents/service.py,sha256=kgZmiRnJKH4nKoYs_V71JVlvzVoQe2KljAvtE-j7wZY,4146
|
|
27
27
|
spb_onprem/contents/entities/__init__.py,sha256=HsQ9J8UDxCx4xYTdMKQto7HCVUQilNozQCkIsceWezk,117
|
|
28
28
|
spb_onprem/contents/entities/base_content.py,sha256=nM7NALpeRjtUKPv7eU0-hlqT1rPtD2mwB6Bvv_2Zc1E,346
|
|
29
29
|
spb_onprem/contents/entities/content.py,sha256=YhTGHE9ykiOgFjvxbnLzSLg2665jPYrDATteB9PbGPE,534
|
|
@@ -93,7 +93,7 @@ spb_onprem/slices/params/update_slice.py,sha256=kryOmCnRTQ_OU0qDKgugppLrpeUpuLwm
|
|
|
93
93
|
spb_onprem/users/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
94
94
|
spb_onprem/users/entities/__init__.py,sha256=X8HZsCTlQnuPszok3AwI-i7bsQi0Ehul5L_2jZaol5E,57
|
|
95
95
|
spb_onprem/users/entities/auth.py,sha256=_KP-7yUErBxhJMm-dE3ObprPEG6e0JI2qNg6g8aK1qM,3371
|
|
96
|
-
superb_ai_onprem-0.3.
|
|
96
|
+
superb_ai_onprem-0.3.5.dist-info/licenses/LICENSE,sha256=CdinbFiHKGkGl6cPde6WgXhMuzyUXEG6tzy2-7udZ8o,1066
|
|
97
97
|
tests/__init__.py,sha256=Nqnn8clbgv-5l0PgxcTOldg8mkMKrFn4TvPL-rYUUGg,1
|
|
98
98
|
tests/activities/__init__.py,sha256=Nqnn8clbgv-5l0PgxcTOldg8mkMKrFn4TvPL-rYUUGg,1
|
|
99
99
|
tests/activities/real_test.py,sha256=0gQHg7rIEuZndGZyNHMWSD5nUZPMsUGigfCjWFxMthQ,1786
|
|
@@ -106,7 +106,7 @@ tests/exports/test_entities.py,sha256=hG7G4kVkyHKT3mv4lvrzUqOW8ILeHiYj87QZjQcmg9
|
|
|
106
106
|
tests/exports/test_integration.py,sha256=cCcEgwIIHyQRlc04EAXSKz7RcblQvhI2GBR3uVaOOq8,6201
|
|
107
107
|
tests/exports/test_params.py,sha256=oRRa6nEru_FImlB3TrmFiBidz6ZstCx4rVaCK-EMGfQ,11070
|
|
108
108
|
tests/exports/test_service.py,sha256=IDcKxrmByh00jk9142P2ThuGureMoijTHNdU0rERGG8,14628
|
|
109
|
-
superb_ai_onprem-0.3.
|
|
110
|
-
superb_ai_onprem-0.3.
|
|
111
|
-
superb_ai_onprem-0.3.
|
|
112
|
-
superb_ai_onprem-0.3.
|
|
109
|
+
superb_ai_onprem-0.3.5.dist-info/METADATA,sha256=S3dm3FhxXQLiiVMppXlSEvhPq79ptJ59lrF26FfX6lA,5817
|
|
110
|
+
superb_ai_onprem-0.3.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
111
|
+
superb_ai_onprem-0.3.5.dist-info/top_level.txt,sha256=LbqU6FjWKaxO7FPS5-71e3OIS8VgBi5VrtQMWFOW25Q,17
|
|
112
|
+
superb_ai_onprem-0.3.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|