elody 0.0.216__tar.gz → 0.0.218__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.
- {elody-0.0.216 → elody-0.0.218}/PKG-INFO +1 -1
- {elody-0.0.216 → elody-0.0.218}/pyproject.toml +1 -1
- {elody-0.0.216 → elody-0.0.218}/src/elody/job.py +3 -40
- {elody-0.0.216 → elody-0.0.218}/src/elody/object_configurations/base_object_configuration.py +1 -0
- {elody-0.0.216 → elody-0.0.218}/src/elody/object_configurations/job_configuration.py +0 -14
- {elody-0.0.216 → elody-0.0.218}/src/elody.egg-info/PKG-INFO +1 -1
- {elody-0.0.216 → elody-0.0.218}/LICENSE +0 -0
- {elody-0.0.216 → elody-0.0.218}/README.md +0 -0
- {elody-0.0.216 → elody-0.0.218}/setup.cfg +0 -0
- {elody-0.0.216 → elody-0.0.218}/src/__init__.py +0 -0
- {elody-0.0.216 → elody-0.0.218}/src/elody/__init__.py +0 -0
- {elody-0.0.216 → elody-0.0.218}/src/elody/client.py +0 -0
- {elody-0.0.216 → elody-0.0.218}/src/elody/csv.py +0 -0
- {elody-0.0.216 → elody-0.0.218}/src/elody/error_codes.py +0 -0
- {elody-0.0.216 → elody-0.0.218}/src/elody/exceptions.py +0 -0
- {elody-0.0.216 → elody-0.0.218}/src/elody/loader.py +0 -0
- {elody-0.0.216 → elody-0.0.218}/src/elody/migration/__init__.py +0 -0
- {elody-0.0.216 → elody-0.0.218}/src/elody/migration/base_object_migrator.py +0 -0
- {elody-0.0.216 → elody-0.0.218}/src/elody/object_configurations/__init__.py +0 -0
- {elody-0.0.216 → elody-0.0.218}/src/elody/object_configurations/elody_configuration.py +0 -0
- {elody-0.0.216 → elody-0.0.218}/src/elody/object_configurations/saved_search_configuration.py +0 -0
- {elody-0.0.216 → elody-0.0.218}/src/elody/policies/__init__.py +0 -0
- {elody-0.0.216 → elody-0.0.218}/src/elody/policies/authentication/__init__.py +0 -0
- {elody-0.0.216 → elody-0.0.218}/src/elody/policies/authentication/base_user_tenant_validation_policy.py +0 -0
- {elody-0.0.216 → elody-0.0.218}/src/elody/policies/authentication/multi_tenant_policy.py +0 -0
- {elody-0.0.216 → elody-0.0.218}/src/elody/policies/authorization/__init__.py +0 -0
- {elody-0.0.216 → elody-0.0.218}/src/elody/policies/authorization/filter_generic_objects_policy.py +0 -0
- {elody-0.0.216 → elody-0.0.218}/src/elody/policies/authorization/filter_generic_objects_policy_v2.py +0 -0
- {elody-0.0.216 → elody-0.0.218}/src/elody/policies/authorization/generic_object_detail_policy.py +0 -0
- {elody-0.0.216 → elody-0.0.218}/src/elody/policies/authorization/generic_object_mediafiles_policy.py +0 -0
- {elody-0.0.216 → elody-0.0.218}/src/elody/policies/authorization/generic_object_metadata_policy.py +0 -0
- {elody-0.0.216 → elody-0.0.218}/src/elody/policies/authorization/generic_object_relations_policy.py +0 -0
- {elody-0.0.216 → elody-0.0.218}/src/elody/policies/authorization/generic_object_request_policy.py +0 -0
- {elody-0.0.216 → elody-0.0.218}/src/elody/policies/authorization/generic_object_request_policy_v2.py +0 -0
- {elody-0.0.216 → elody-0.0.218}/src/elody/policies/authorization/mediafile_derivatives_policy.py +0 -0
- {elody-0.0.216 → elody-0.0.218}/src/elody/policies/authorization/mediafile_download_policy.py +0 -0
- {elody-0.0.216 → elody-0.0.218}/src/elody/policies/authorization/multi_tenant_policy.py +0 -0
- {elody-0.0.216 → elody-0.0.218}/src/elody/policies/authorization/tenant_request_policy.py +0 -0
- {elody-0.0.216 → elody-0.0.218}/src/elody/policies/helpers.py +0 -0
- {elody-0.0.216 → elody-0.0.218}/src/elody/policies/permission_handler.py +0 -0
- {elody-0.0.216 → elody-0.0.218}/src/elody/schemas.py +0 -0
- {elody-0.0.216 → elody-0.0.218}/src/elody/util.py +0 -0
- {elody-0.0.216 → elody-0.0.218}/src/elody/validator.py +0 -0
- {elody-0.0.216 → elody-0.0.218}/src/elody.egg-info/SOURCES.txt +0 -0
- {elody-0.0.216 → elody-0.0.218}/src/elody.egg-info/dependency_links.txt +0 -0
- {elody-0.0.216 → elody-0.0.218}/src/elody.egg-info/requires.txt +0 -0
- {elody-0.0.216 → elody-0.0.218}/src/elody.egg-info/top_level.txt +0 -0
- {elody-0.0.216 → elody-0.0.218}/src/tests/__init_.py +0 -0
- {elody-0.0.216 → elody-0.0.218}/src/tests/data.py +0 -0
- {elody-0.0.216 → elody-0.0.218}/src/tests/unit/__init__.py +0 -0
- {elody-0.0.216 → elody-0.0.218}/src/tests/unit/test_csv.py +0 -0
- {elody-0.0.216 → elody-0.0.218}/src/tests/unit/test_utils.py +0 -0
|
@@ -9,12 +9,11 @@ _post_crud_hook = _config.crud()["post_crud_hook"]
|
|
|
9
9
|
def add_document_to_job(
|
|
10
10
|
id,
|
|
11
11
|
id_of_document_job_was_initiated_for,
|
|
12
|
-
type_of_document_job_was_initiated_for,
|
|
13
12
|
*,
|
|
14
13
|
get_rabbit,
|
|
15
14
|
):
|
|
16
15
|
relations = []
|
|
17
|
-
if id_of_document_job_was_initiated_for
|
|
16
|
+
if id_of_document_job_was_initiated_for:
|
|
18
17
|
relations.append(
|
|
19
18
|
{"key": id_of_document_job_was_initiated_for, "type": "isJobFor"}
|
|
20
19
|
)
|
|
@@ -25,12 +24,6 @@ def add_document_to_job(
|
|
|
25
24
|
},
|
|
26
25
|
}
|
|
27
26
|
_post_crud_hook(crud="update", document=document, get_rabbit=get_rabbit)
|
|
28
|
-
__patch_document_job_was_initiated_for(
|
|
29
|
-
id,
|
|
30
|
-
id_of_document_job_was_initiated_for,
|
|
31
|
-
type_of_document_job_was_initiated_for,
|
|
32
|
-
get_rabbit,
|
|
33
|
-
)
|
|
34
27
|
|
|
35
28
|
|
|
36
29
|
def init_job(
|
|
@@ -42,14 +35,13 @@ def init_job(
|
|
|
42
35
|
user_email=None,
|
|
43
36
|
parent_id=None,
|
|
44
37
|
id_of_document_job_was_initiated_for=None,
|
|
45
|
-
type_of_document_job_was_initiated_for=None,
|
|
46
38
|
) -> str:
|
|
47
39
|
relations = []
|
|
48
40
|
if parent_id:
|
|
49
41
|
relations.append({"key": parent_id, "type": "hasParentJob"})
|
|
50
|
-
if id_of_document_job_was_initiated_for
|
|
42
|
+
if id_of_document_job_was_initiated_for:
|
|
51
43
|
relations.append(
|
|
52
|
-
{"key": id_of_document_job_was_initiated_for, "type": "
|
|
44
|
+
{"key": id_of_document_job_was_initiated_for, "type": "isJobFor"}
|
|
53
45
|
)
|
|
54
46
|
|
|
55
47
|
job = _create(
|
|
@@ -69,19 +61,12 @@ def init_job(
|
|
|
69
61
|
_post_crud_hook(
|
|
70
62
|
crud="create", document=job, parent_id=parent_id, get_rabbit=get_rabbit
|
|
71
63
|
)
|
|
72
|
-
__patch_document_job_was_initiated_for(
|
|
73
|
-
job["_id"],
|
|
74
|
-
id_of_document_job_was_initiated_for,
|
|
75
|
-
type_of_document_job_was_initiated_for,
|
|
76
|
-
get_rabbit,
|
|
77
|
-
)
|
|
78
64
|
return job["_id"]
|
|
79
65
|
|
|
80
66
|
|
|
81
67
|
def start_job(
|
|
82
68
|
id,
|
|
83
69
|
id_of_document_job_was_initiated_for=None,
|
|
84
|
-
type_of_document_job_was_initiated_for=None,
|
|
85
70
|
*,
|
|
86
71
|
get_rabbit,
|
|
87
72
|
):
|
|
@@ -94,18 +79,11 @@ def start_job(
|
|
|
94
79
|
},
|
|
95
80
|
}
|
|
96
81
|
_post_crud_hook(crud="update", document=document, get_rabbit=get_rabbit)
|
|
97
|
-
__patch_document_job_was_initiated_for(
|
|
98
|
-
id,
|
|
99
|
-
id_of_document_job_was_initiated_for,
|
|
100
|
-
type_of_document_job_was_initiated_for,
|
|
101
|
-
get_rabbit,
|
|
102
|
-
)
|
|
103
82
|
|
|
104
83
|
|
|
105
84
|
def finish_job(
|
|
106
85
|
id,
|
|
107
86
|
id_of_document_job_was_initiated_for=None,
|
|
108
|
-
type_of_document_job_was_initiated_for=None,
|
|
109
87
|
*,
|
|
110
88
|
get_rabbit,
|
|
111
89
|
):
|
|
@@ -117,12 +95,6 @@ def finish_job(
|
|
|
117
95
|
},
|
|
118
96
|
}
|
|
119
97
|
_post_crud_hook(crud="update", document=document, get_rabbit=get_rabbit)
|
|
120
|
-
__patch_document_job_was_initiated_for(
|
|
121
|
-
id,
|
|
122
|
-
id_of_document_job_was_initiated_for,
|
|
123
|
-
type_of_document_job_was_initiated_for,
|
|
124
|
-
get_rabbit,
|
|
125
|
-
)
|
|
126
98
|
|
|
127
99
|
|
|
128
100
|
def fail_job(id, exception_message, *, get_rabbit):
|
|
@@ -136,12 +108,3 @@ def fail_job(id, exception_message, *, get_rabbit):
|
|
|
136
108
|
},
|
|
137
109
|
}
|
|
138
110
|
_post_crud_hook(crud="update", document=document, get_rabbit=get_rabbit)
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
def __patch_document_job_was_initiated_for(job_id, document_id, type, get_rabbit):
|
|
142
|
-
if id and type:
|
|
143
|
-
document = {
|
|
144
|
-
"document_info_job_was_initiated_for": {"id": document_id, "type": type},
|
|
145
|
-
"patch": {"relations": [{"key": job_id, "type": "hasJob"}]},
|
|
146
|
-
}
|
|
147
|
-
_post_crud_hook(crud="update", document=document, get_rabbit=get_rabbit)
|
{elody-0.0.216 → elody-0.0.218}/src/elody/object_configurations/base_object_configuration.py
RENAMED
|
@@ -10,6 +10,7 @@ class BaseObjectConfiguration(ABC):
|
|
|
10
10
|
@abstractmethod
|
|
11
11
|
def crud(self):
|
|
12
12
|
return {
|
|
13
|
+
"creation_preparer": lambda post_body, **kwargs: post_body,
|
|
13
14
|
"creator": lambda post_body, **kwargs: post_body,
|
|
14
15
|
"document_content_patcher": lambda *, document, content, overwrite=False, **kwargs: self._document_content_patcher(
|
|
15
16
|
document=document,
|
|
@@ -42,20 +42,6 @@ class JobConfiguration(ElodyConfiguration):
|
|
|
42
42
|
"dams.job_created",
|
|
43
43
|
document,
|
|
44
44
|
)
|
|
45
|
-
if parent_id := kwargs.get("parent_id"):
|
|
46
|
-
send_cloudevent(
|
|
47
|
-
get_rabbit(),
|
|
48
|
-
getenv("MQ_EXCHANGE", "dams"),
|
|
49
|
-
"dams.job_changed",
|
|
50
|
-
{
|
|
51
|
-
"id": parent_id,
|
|
52
|
-
"patch": {
|
|
53
|
-
"relations": [
|
|
54
|
-
{"key": document["_id"], "type": "isParentJobOf"}
|
|
55
|
-
]
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
)
|
|
59
45
|
elif crud == "update":
|
|
60
46
|
send_cloudevent(
|
|
61
47
|
get_rabbit(),
|
|
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
|
{elody-0.0.216 → elody-0.0.218}/src/elody/object_configurations/saved_search_configuration.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{elody-0.0.216 → elody-0.0.218}/src/elody/policies/authorization/filter_generic_objects_policy.py
RENAMED
|
File without changes
|
{elody-0.0.216 → elody-0.0.218}/src/elody/policies/authorization/filter_generic_objects_policy_v2.py
RENAMED
|
File without changes
|
{elody-0.0.216 → elody-0.0.218}/src/elody/policies/authorization/generic_object_detail_policy.py
RENAMED
|
File without changes
|
{elody-0.0.216 → elody-0.0.218}/src/elody/policies/authorization/generic_object_mediafiles_policy.py
RENAMED
|
File without changes
|
{elody-0.0.216 → elody-0.0.218}/src/elody/policies/authorization/generic_object_metadata_policy.py
RENAMED
|
File without changes
|
{elody-0.0.216 → elody-0.0.218}/src/elody/policies/authorization/generic_object_relations_policy.py
RENAMED
|
File without changes
|
{elody-0.0.216 → elody-0.0.218}/src/elody/policies/authorization/generic_object_request_policy.py
RENAMED
|
File without changes
|
{elody-0.0.216 → elody-0.0.218}/src/elody/policies/authorization/generic_object_request_policy_v2.py
RENAMED
|
File without changes
|
{elody-0.0.216 → elody-0.0.218}/src/elody/policies/authorization/mediafile_derivatives_policy.py
RENAMED
|
File without changes
|
{elody-0.0.216 → elody-0.0.218}/src/elody/policies/authorization/mediafile_download_policy.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
|
|
File without changes
|
|
File without changes
|