ayon-python-api 1.2.14.dev0__tar.gz → 1.2.15__tar.gz
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.
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/PKG-INFO +1 -1
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/ayon_api/_api.py +9 -3
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/ayon_api/_api_helpers/events.py +15 -0
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/ayon_api/_api_helpers/projects.py +19 -2
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/ayon_api/graphql_queries.py +2 -0
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/ayon_api/server_api.py +14 -8
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/ayon_api/version.py +1 -1
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/ayon_python_api.egg-info/PKG-INFO +1 -1
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/pyproject.toml +2 -2
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/LICENSE +0 -0
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/README.md +0 -0
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/ayon_api/__init__.py +0 -0
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/ayon_api/_api_helpers/__init__.py +0 -0
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/ayon_api/_api_helpers/actions.py +0 -0
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/ayon_api/_api_helpers/activities.py +0 -0
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/ayon_api/_api_helpers/attributes.py +0 -0
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/ayon_api/_api_helpers/base.py +0 -0
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/ayon_api/_api_helpers/bundles_addons.py +0 -0
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/ayon_api/_api_helpers/dependency_packages.py +0 -0
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/ayon_api/_api_helpers/folders.py +0 -0
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/ayon_api/_api_helpers/installers.py +0 -0
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/ayon_api/_api_helpers/links.py +0 -0
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/ayon_api/_api_helpers/lists.py +0 -0
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/ayon_api/_api_helpers/products.py +0 -0
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/ayon_api/_api_helpers/representations.py +0 -0
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/ayon_api/_api_helpers/secrets.py +0 -0
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/ayon_api/_api_helpers/tasks.py +0 -0
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/ayon_api/_api_helpers/thumbnails.py +0 -0
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/ayon_api/_api_helpers/versions.py +0 -0
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/ayon_api/_api_helpers/workfiles.py +0 -0
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/ayon_api/constants.py +0 -0
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/ayon_api/entity_hub.py +0 -0
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/ayon_api/events.py +0 -0
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/ayon_api/exceptions.py +0 -0
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/ayon_api/graphql.py +0 -0
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/ayon_api/operations.py +0 -0
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/ayon_api/typing.py +0 -0
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/ayon_api/utils.py +0 -0
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/ayon_python_api.egg-info/SOURCES.txt +0 -0
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/ayon_python_api.egg-info/dependency_links.txt +0 -0
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/ayon_python_api.egg-info/requires.txt +0 -0
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/ayon_python_api.egg-info/top_level.txt +0 -0
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/setup.cfg +0 -0
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/setup.py +0 -0
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/tests/test_entity_hub.py +0 -0
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/tests/test_folder_hierarchy.py +0 -0
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/tests/test_get_events.py +0 -0
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/tests/test_graphql_queries.py +0 -0
- {ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/tests/test_server.py +0 -0
|
@@ -1276,7 +1276,6 @@ def upload_reviewable(
|
|
|
1276
1276
|
content_type: Optional[str] = None,
|
|
1277
1277
|
filename: Optional[str] = None,
|
|
1278
1278
|
progress: Optional[TransferProgress] = None,
|
|
1279
|
-
headers: Optional[dict[str, Any]] = None,
|
|
1280
1279
|
**kwargs,
|
|
1281
1280
|
) -> requests.Response:
|
|
1282
1281
|
"""Upload reviewable file to server.
|
|
@@ -1291,7 +1290,6 @@ def upload_reviewable(
|
|
|
1291
1290
|
filename (Optional[str]): User as original filename. Filename from
|
|
1292
1291
|
'filepath' is used when not filled.
|
|
1293
1292
|
progress (Optional[TransferProgress]): Progress.
|
|
1294
|
-
headers (Optional[dict[str, Any]]): Headers.
|
|
1295
1293
|
|
|
1296
1294
|
Returns:
|
|
1297
1295
|
requests.Response: Server response.
|
|
@@ -1306,7 +1304,6 @@ def upload_reviewable(
|
|
|
1306
1304
|
content_type=content_type,
|
|
1307
1305
|
filename=filename,
|
|
1308
1306
|
progress=progress,
|
|
1309
|
-
headers=headers,
|
|
1310
1307
|
**kwargs,
|
|
1311
1308
|
)
|
|
1312
1309
|
|
|
@@ -3248,6 +3245,7 @@ def get_events(
|
|
|
3248
3245
|
project_names: Optional[Iterable[str]] = None,
|
|
3249
3246
|
statuses: Optional[Iterable[EventStatus]] = None,
|
|
3250
3247
|
users: Optional[Iterable[str]] = None,
|
|
3248
|
+
text_filter: Optional[str] = None,
|
|
3251
3249
|
include_logs: Optional[bool] = None,
|
|
3252
3250
|
has_children: Optional[bool] = None,
|
|
3253
3251
|
newer_than: Optional[str] = None,
|
|
@@ -3255,6 +3253,8 @@ def get_events(
|
|
|
3255
3253
|
fields: Optional[Iterable[str]] = None,
|
|
3256
3254
|
limit: Optional[int] = None,
|
|
3257
3255
|
order: Optional[SortOrder] = None,
|
|
3256
|
+
first: Optional[int] = None,
|
|
3257
|
+
last: Optional[int] = None,
|
|
3258
3258
|
states: Optional[Iterable[str]] = None,
|
|
3259
3259
|
) -> Generator[dict[str, Any], None, None]:
|
|
3260
3260
|
"""Get events from server with filtering options.
|
|
@@ -3270,6 +3270,7 @@ def get_events(
|
|
|
3270
3270
|
statuses (Optional[Iterable[EventStatus]]): Filtering by statuses.
|
|
3271
3271
|
users (Optional[Iterable[str]]): Filtering by users
|
|
3272
3272
|
who created/triggered an event.
|
|
3273
|
+
text_filter (Optional[str]): Filtering by text in event payload.
|
|
3273
3274
|
include_logs (Optional[bool]): Query also log events.
|
|
3274
3275
|
has_children (Optional[bool]): Event is with/without children
|
|
3275
3276
|
events. If 'None' then all events are returned, default.
|
|
@@ -3283,6 +3284,8 @@ def get_events(
|
|
|
3283
3284
|
order (Optional[SortOrder]): Order events in ascending
|
|
3284
3285
|
or descending order. It is recommended to set 'limit'
|
|
3285
3286
|
when used descending.
|
|
3287
|
+
first (Optional[int]): Get first n events.
|
|
3288
|
+
last (Optional[int]): Get last n events.
|
|
3286
3289
|
states (Optional[Iterable[str]]): DEPRECATED Filtering by states.
|
|
3287
3290
|
Use 'statuses' instead.
|
|
3288
3291
|
|
|
@@ -3297,6 +3300,7 @@ def get_events(
|
|
|
3297
3300
|
project_names=project_names,
|
|
3298
3301
|
statuses=statuses,
|
|
3299
3302
|
users=users,
|
|
3303
|
+
text_filter=text_filter,
|
|
3300
3304
|
include_logs=include_logs,
|
|
3301
3305
|
has_children=has_children,
|
|
3302
3306
|
newer_than=newer_than,
|
|
@@ -3304,6 +3308,8 @@ def get_events(
|
|
|
3304
3308
|
fields=fields,
|
|
3305
3309
|
limit=limit,
|
|
3306
3310
|
order=order,
|
|
3311
|
+
first=first,
|
|
3312
|
+
last=last,
|
|
3307
3313
|
states=states,
|
|
3308
3314
|
)
|
|
3309
3315
|
|
|
@@ -40,6 +40,7 @@ class EventsAPI(BaseServerAPI):
|
|
|
40
40
|
project_names: Optional[Iterable[str]] = None,
|
|
41
41
|
statuses: Optional[Iterable[EventStatus]] = None,
|
|
42
42
|
users: Optional[Iterable[str]] = None,
|
|
43
|
+
text_filter: Optional[str] = None,
|
|
43
44
|
include_logs: Optional[bool] = None,
|
|
44
45
|
has_children: Optional[bool] = None,
|
|
45
46
|
newer_than: Optional[str] = None,
|
|
@@ -47,6 +48,8 @@ class EventsAPI(BaseServerAPI):
|
|
|
47
48
|
fields: Optional[Iterable[str]] = None,
|
|
48
49
|
limit: Optional[int] = None,
|
|
49
50
|
order: Optional[SortOrder] = None,
|
|
51
|
+
first: Optional[int] = None,
|
|
52
|
+
last: Optional[int] = None,
|
|
50
53
|
states: Optional[Iterable[str]] = None,
|
|
51
54
|
) -> Generator[dict[str, Any], None, None]:
|
|
52
55
|
"""Get events from server with filtering options.
|
|
@@ -62,6 +65,7 @@ class EventsAPI(BaseServerAPI):
|
|
|
62
65
|
statuses (Optional[Iterable[EventStatus]]): Filtering by statuses.
|
|
63
66
|
users (Optional[Iterable[str]]): Filtering by users
|
|
64
67
|
who created/triggered an event.
|
|
68
|
+
text_filter (Optional[str]): Filtering by text in event payload.
|
|
65
69
|
include_logs (Optional[bool]): Query also log events.
|
|
66
70
|
has_children (Optional[bool]): Event is with/without children
|
|
67
71
|
events. If 'None' then all events are returned, default.
|
|
@@ -75,6 +79,8 @@ class EventsAPI(BaseServerAPI):
|
|
|
75
79
|
order (Optional[SortOrder]): Order events in ascending
|
|
76
80
|
or descending order. It is recommended to set 'limit'
|
|
77
81
|
when used descending.
|
|
82
|
+
first (Optional[int]): Get first n events.
|
|
83
|
+
last (Optional[int]): Get last n events.
|
|
78
84
|
states (Optional[Iterable[str]]): DEPRECATED Filtering by states.
|
|
79
85
|
Use 'statuses' instead.
|
|
80
86
|
|
|
@@ -111,6 +117,7 @@ class EventsAPI(BaseServerAPI):
|
|
|
111
117
|
("hasChildrenFilter", has_children),
|
|
112
118
|
("newerThanFilter", newer_than),
|
|
113
119
|
("olderThanFilter", older_than),
|
|
120
|
+
("textFilter", text_filter),
|
|
114
121
|
):
|
|
115
122
|
if filter_value is not None:
|
|
116
123
|
filters[filter_key] = filter_value
|
|
@@ -125,6 +132,14 @@ class EventsAPI(BaseServerAPI):
|
|
|
125
132
|
for attr, filter_value in filters.items():
|
|
126
133
|
query.set_variable_value(attr, filter_value)
|
|
127
134
|
|
|
135
|
+
events_field = query.get_field_by_path("events")
|
|
136
|
+
if last is not None:
|
|
137
|
+
events_field.set_limit(last)
|
|
138
|
+
events_field.set_order(SortOrder.descending)
|
|
139
|
+
elif first is not None:
|
|
140
|
+
events_field.set_limit(first)
|
|
141
|
+
events_field.set_order(SortOrder.ascending)
|
|
142
|
+
|
|
128
143
|
if limit:
|
|
129
144
|
events_field = query.get_field_by_path("events")
|
|
130
145
|
events_field.set_limit(limit)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
import copy
|
|
3
4
|
import json
|
|
4
5
|
import platform
|
|
5
6
|
import warnings
|
|
@@ -810,8 +811,24 @@ class ProjectsAPI(BaseServerAPI):
|
|
|
810
811
|
for project in parsed_data["projects"]:
|
|
811
812
|
if active is not None and active is not project["active"]:
|
|
812
813
|
continue
|
|
813
|
-
|
|
814
|
-
|
|
814
|
+
|
|
815
|
+
if library is not None and library is not project["library"]:
|
|
816
|
+
continue
|
|
817
|
+
|
|
818
|
+
all_attrib = project.get("allAttrib")
|
|
819
|
+
if isinstance(all_attrib, str):
|
|
820
|
+
all_attrib = json.loads(all_attrib)
|
|
821
|
+
project["allAttrib"] = all_attrib
|
|
822
|
+
|
|
823
|
+
if own_attributes and all_attrib:
|
|
824
|
+
own_attrib = {}
|
|
825
|
+
if all_attrib:
|
|
826
|
+
own_attrib = copy.deepcopy(all_attrib)
|
|
827
|
+
attrib = project.get("attrib", {})
|
|
828
|
+
for key in attrib.keys():
|
|
829
|
+
own_attrib.setdefault(key, None)
|
|
830
|
+
project["ownAttrib"] = own_attrib
|
|
831
|
+
|
|
815
832
|
self._fill_project_entity_data(project)
|
|
816
833
|
yield project
|
|
817
834
|
|
|
@@ -593,6 +593,7 @@ def events_graphql_query(fields, order, use_states=False):
|
|
|
593
593
|
has_children_var = query.add_variable("hasChildrenFilter", "Boolean!")
|
|
594
594
|
newer_than_var = query.add_variable("newerThanFilter", "String!")
|
|
595
595
|
older_than_var = query.add_variable("olderThanFilter", "String!")
|
|
596
|
+
text_filter_var = query.add_variable("textFilter", "String!")
|
|
596
597
|
|
|
597
598
|
statuses_filter_name = "statuses"
|
|
598
599
|
if use_states:
|
|
@@ -607,6 +608,7 @@ def events_graphql_query(fields, order, use_states=False):
|
|
|
607
608
|
events_field.set_filter("hasChildren", has_children_var)
|
|
608
609
|
events_field.set_filter("newerThan", newer_than_var)
|
|
609
610
|
events_field.set_filter("olderThan", older_than_var)
|
|
611
|
+
events_field.set_filter("filter", text_filter_var)
|
|
610
612
|
|
|
611
613
|
nested_fields = fields_to_dict(set(fields))
|
|
612
614
|
|
|
@@ -1408,7 +1408,10 @@ class ServerAPI(
|
|
|
1408
1408
|
try:
|
|
1409
1409
|
with get_func(url, **kwargs) as response:
|
|
1410
1410
|
# Auto-fix missing 'api/'
|
|
1411
|
-
if
|
|
1411
|
+
if (
|
|
1412
|
+
response.status_code in (404, 405)
|
|
1413
|
+
and not api_prepended
|
|
1414
|
+
):
|
|
1412
1415
|
api_prepended = True
|
|
1413
1416
|
if (
|
|
1414
1417
|
not endpoint.startswith(self._base_url)
|
|
@@ -1792,7 +1795,10 @@ class ServerAPI(
|
|
|
1792
1795
|
url = self._endpoint_to_url(endpoint, use_rest=False)
|
|
1793
1796
|
progress.set_destination_url(url)
|
|
1794
1797
|
|
|
1795
|
-
headers = kwargs.
|
|
1798
|
+
headers = kwargs.get("headers")
|
|
1799
|
+
if headers is None:
|
|
1800
|
+
kwargs["headers"] = headers = {}
|
|
1801
|
+
|
|
1796
1802
|
headers_keys_by_low_key = {key.lower(): key for key in headers}
|
|
1797
1803
|
if self._session is None:
|
|
1798
1804
|
for key, value in self.get_headers().items():
|
|
@@ -1838,7 +1844,7 @@ class ServerAPI(
|
|
|
1838
1844
|
**kwargs
|
|
1839
1845
|
)
|
|
1840
1846
|
# Auto-fix missing 'api/'
|
|
1841
|
-
if response.status_code
|
|
1847
|
+
if response.status_code in (404, 405) and not api_prepended:
|
|
1842
1848
|
api_prepended = True
|
|
1843
1849
|
if (
|
|
1844
1850
|
not endpoint.startswith(self._base_url)
|
|
@@ -1982,7 +1988,6 @@ class ServerAPI(
|
|
|
1982
1988
|
content_type: Optional[str] = None,
|
|
1983
1989
|
filename: Optional[str] = None,
|
|
1984
1990
|
progress: Optional[TransferProgress] = None,
|
|
1985
|
-
headers: Optional[dict[str, Any]] = None,
|
|
1986
1991
|
**kwargs
|
|
1987
1992
|
) -> requests.Response:
|
|
1988
1993
|
"""Upload reviewable file to server.
|
|
@@ -1997,7 +2002,6 @@ class ServerAPI(
|
|
|
1997
2002
|
filename (Optional[str]): User as original filename. Filename from
|
|
1998
2003
|
'filepath' is used when not filled.
|
|
1999
2004
|
progress (Optional[TransferProgress]): Progress.
|
|
2000
|
-
headers (Optional[dict[str, Any]]): Headers.
|
|
2001
2005
|
|
|
2002
2006
|
Returns:
|
|
2003
2007
|
requests.Response: Server response.
|
|
@@ -2026,7 +2030,6 @@ class ServerAPI(
|
|
|
2026
2030
|
progress=progress,
|
|
2027
2031
|
content_type=content_type,
|
|
2028
2032
|
filename=filename,
|
|
2029
|
-
headers=headers,
|
|
2030
2033
|
request_type=RequestTypes.post,
|
|
2031
2034
|
**kwargs
|
|
2032
2035
|
)
|
|
@@ -2425,8 +2428,11 @@ class ServerAPI(
|
|
|
2425
2428
|
fields.remove("attrib")
|
|
2426
2429
|
fields |= self.get_attributes_fields_for_type(entity_type)
|
|
2427
2430
|
|
|
2428
|
-
if own_attributes
|
|
2429
|
-
|
|
2431
|
+
if own_attributes:
|
|
2432
|
+
if entity_type == "project":
|
|
2433
|
+
fields.add("allAttrib")
|
|
2434
|
+
elif entity_type in {"folder", "task"}:
|
|
2435
|
+
fields.add("ownAttrib")
|
|
2430
2436
|
|
|
2431
2437
|
if entity_type != "project":
|
|
2432
2438
|
return
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"""Package declaring Python API for AYON server."""
|
|
2
|
-
__version__ = "1.2.
|
|
2
|
+
__version__ = "1.2.15"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "ayon_python_api"
|
|
3
|
-
version = "1.2.
|
|
3
|
+
version = "1.2.15"
|
|
4
4
|
description = "AYON Python API"
|
|
5
5
|
license = {file = "LICENSE"}
|
|
6
6
|
readme = {file = "README.md", content-type = "text/markdown"}
|
|
@@ -28,7 +28,7 @@ build-backend = "poetry.core.masonry.api"
|
|
|
28
28
|
|
|
29
29
|
[tool.poetry]
|
|
30
30
|
name = "ayon_python_api"
|
|
31
|
-
version = "1.2.
|
|
31
|
+
version = "1.2.15"
|
|
32
32
|
description = "AYON Python API"
|
|
33
33
|
authors = [
|
|
34
34
|
"ynput.io <info@ynput.io>"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/ayon_api/_api_helpers/bundles_addons.py
RENAMED
|
File without changes
|
{ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/ayon_api/_api_helpers/dependency_packages.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/ayon_api/_api_helpers/representations.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/ayon_python_api.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/ayon_python_api.egg-info/requires.txt
RENAMED
|
File without changes
|
{ayon_python_api-1.2.14.dev0 → ayon_python_api-1.2.15}/ayon_python_api.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|