Skip to content

Commit fbcce13

Browse files
authored
Merge pull request #325 from ynput/enhancement/update-api
Update api
2 parents 6ef873d + 53d39e1 commit fbcce13

9 files changed

Lines changed: 901 additions & 15 deletions

File tree

.github/workflows/check_global_api.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- name: Set up Python
1414
uses: actions/setup-python@v5
1515
with:
16-
python-version: '3.9'
16+
python-version: '3.11'
1717

1818
- name: Install dependencies
1919
run: |

automated_api.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ def _get_typehint(annotation, api_globals):
154154
str(annotation)
155155
.replace("NoneType", "None")
156156
)
157+
157158
full_path_regex = re.compile(
158159
r"(?P<full>(?P<name>[a-zA-Z0-9_\.]+))"
159160
)
@@ -181,6 +182,17 @@ def _get_typehint(annotation, api_globals):
181182
name = name.split(".")[-1]
182183
typehint = typehint.replace(groups["full"], name)
183184

185+
if "Literal" in typehint:
186+
for match in re.finditer(
187+
r"(?P<fullcontent>Literal\[(?P<content>[^\]]*)\])", typehint
188+
):
189+
full_content = match.group("fullcontent")
190+
content = match.group("content")
191+
items = [f'"{i.strip()}"' for i in content.split(",")]
192+
new_content = ", ".join(items)
193+
new_full_content = full_content.replace(content, new_content)
194+
typehint = typehint.replace(full_content, new_full_content)
195+
184196
try:
185197
# Test if typehint is valid for known '_api' content
186198
exec(f"_: {typehint} = None", api_globals)

ayon_api/__init__.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,14 @@
6969
patch,
7070
get,
7171
delete,
72+
get_server_config,
73+
set_server_config,
74+
get_server_config_overrides,
75+
get_server_config_value,
76+
download_server_config_file,
77+
download_server_config_file_to_stream,
78+
upload_server_config_file,
79+
upload_server_config_file_from_stream,
7280
download_file_to_stream,
7381
download_file,
7482
upload_project_file,
@@ -116,6 +124,14 @@
116124
create_activity,
117125
update_activity,
118126
delete_activity,
127+
get_raw_activity_categories,
128+
get_activity_categories,
129+
create_activity_reaction,
130+
delete_activity_reaction,
131+
suggest_entity_mention,
132+
get_raw_entity_watchers,
133+
get_entity_watchers,
134+
set_entity_watchers,
119135
send_activities_batch_operations,
120136
get_bundles,
121137
create_bundle,
@@ -151,6 +167,7 @@
151167
reset_attributes_cache,
152168
set_attributes_cache_timeout,
153169
set_attribute_config,
170+
delete_attribute_config,
154171
remove_attribute_config,
155172
get_attributes_for_type,
156173
get_attributes_fields_for_type,
@@ -168,6 +185,13 @@
168185
create_project,
169186
update_project,
170187
delete_project,
188+
get_raw_project_folders,
189+
get_project_folders,
190+
create_project_folder,
191+
update_project_folder,
192+
set_project_folders_order,
193+
assign_projects_to_project_folder,
194+
delete_project_folder,
171195
get_project_root_overrides,
172196
get_project_roots_by_site,
173197
get_project_root_overrides_by_site_id,
@@ -356,6 +380,14 @@
356380
"patch",
357381
"get",
358382
"delete",
383+
"get_server_config",
384+
"set_server_config",
385+
"get_server_config_overrides",
386+
"get_server_config_value",
387+
"download_server_config_file",
388+
"download_server_config_file_to_stream",
389+
"upload_server_config_file",
390+
"upload_server_config_file_from_stream",
359391
"download_file_to_stream",
360392
"download_file",
361393
"upload_project_file",
@@ -403,6 +435,14 @@
403435
"create_activity",
404436
"update_activity",
405437
"delete_activity",
438+
"get_raw_activity_categories",
439+
"get_activity_categories",
440+
"create_activity_reaction",
441+
"delete_activity_reaction",
442+
"suggest_entity_mention",
443+
"get_raw_entity_watchers",
444+
"get_entity_watchers",
445+
"set_entity_watchers",
406446
"send_activities_batch_operations",
407447
"get_bundles",
408448
"create_bundle",
@@ -438,6 +478,7 @@
438478
"reset_attributes_cache",
439479
"set_attributes_cache_timeout",
440480
"set_attribute_config",
481+
"delete_attribute_config",
441482
"remove_attribute_config",
442483
"get_attributes_for_type",
443484
"get_attributes_fields_for_type",
@@ -455,6 +496,13 @@
455496
"create_project",
456497
"update_project",
457498
"delete_project",
499+
"get_raw_project_folders",
500+
"get_project_folders",
501+
"create_project_folder",
502+
"update_project_folder",
503+
"set_project_folders_order",
504+
"assign_projects_to_project_folder",
505+
"delete_project_folder",
458506
"get_project_root_overrides",
459507
"get_project_roots_by_site",
460508
"get_project_root_overrides_by_site_id",

0 commit comments

Comments
 (0)