hexkit 3.0.1__tar.gz → 3.0.2__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.
- {hexkit-3.0.1/src/hexkit.egg-info → hexkit-3.0.2}/PKG-INFO +1 -1
- {hexkit-3.0.1 → hexkit-3.0.2}/pyproject.toml +1 -1
- {hexkit-3.0.1 → hexkit-3.0.2}/src/hexkit/custom_types.py +1 -1
- {hexkit-3.0.1 → hexkit-3.0.2}/src/hexkit/protocols/dao.py +1 -1
- {hexkit-3.0.1 → hexkit-3.0.2}/src/hexkit/providers/mongodb/provider.py +1 -1
- {hexkit-3.0.1 → hexkit-3.0.2}/src/hexkit/providers/mongokafka/provider.py +16 -7
- {hexkit-3.0.1 → hexkit-3.0.2/src/hexkit.egg-info}/PKG-INFO +1 -1
- {hexkit-3.0.1 → hexkit-3.0.2}/LICENSE +0 -0
- {hexkit-3.0.1 → hexkit-3.0.2}/MANIFEST.in +0 -0
- {hexkit-3.0.1 → hexkit-3.0.2}/README.md +0 -0
- {hexkit-3.0.1 → hexkit-3.0.2}/setup.cfg +0 -0
- {hexkit-3.0.1 → hexkit-3.0.2}/src/hexkit/__init__.py +0 -0
- {hexkit-3.0.1 → hexkit-3.0.2}/src/hexkit/__main__.py +0 -0
- {hexkit-3.0.1 → hexkit-3.0.2}/src/hexkit/base.py +0 -0
- {hexkit-3.0.1 → hexkit-3.0.2}/src/hexkit/config.py +0 -0
- {hexkit-3.0.1 → hexkit-3.0.2}/src/hexkit/correlation.py +0 -0
- {hexkit-3.0.1 → hexkit-3.0.2}/src/hexkit/log.py +0 -0
- {hexkit-3.0.1 → hexkit-3.0.2}/src/hexkit/protocols/__init__.py +0 -0
- {hexkit-3.0.1 → hexkit-3.0.2}/src/hexkit/protocols/daopub.py +0 -0
- {hexkit-3.0.1 → hexkit-3.0.2}/src/hexkit/protocols/daosub.py +0 -0
- {hexkit-3.0.1 → hexkit-3.0.2}/src/hexkit/protocols/eventpub.py +0 -0
- {hexkit-3.0.1 → hexkit-3.0.2}/src/hexkit/protocols/eventsub.py +0 -0
- {hexkit-3.0.1 → hexkit-3.0.2}/src/hexkit/protocols/objstorage.py +0 -0
- {hexkit-3.0.1 → hexkit-3.0.2}/src/hexkit/providers/__init__.py +0 -0
- {hexkit-3.0.1 → hexkit-3.0.2}/src/hexkit/providers/akafka/__init__.py +0 -0
- {hexkit-3.0.1 → hexkit-3.0.2}/src/hexkit/providers/akafka/config.py +0 -0
- {hexkit-3.0.1 → hexkit-3.0.2}/src/hexkit/providers/akafka/provider/__init__.py +0 -0
- {hexkit-3.0.1 → hexkit-3.0.2}/src/hexkit/providers/akafka/provider/daosub.py +0 -0
- {hexkit-3.0.1 → hexkit-3.0.2}/src/hexkit/providers/akafka/provider/eventpub.py +0 -0
- {hexkit-3.0.1 → hexkit-3.0.2}/src/hexkit/providers/akafka/provider/eventsub.py +0 -0
- {hexkit-3.0.1 → hexkit-3.0.2}/src/hexkit/providers/akafka/provider/utils.py +0 -0
- {hexkit-3.0.1 → hexkit-3.0.2}/src/hexkit/providers/akafka/testcontainer.py +0 -0
- {hexkit-3.0.1 → hexkit-3.0.2}/src/hexkit/providers/akafka/testutils.py +0 -0
- {hexkit-3.0.1 → hexkit-3.0.2}/src/hexkit/providers/mongodb/__init__.py +0 -0
- {hexkit-3.0.1 → hexkit-3.0.2}/src/hexkit/providers/mongodb/testutils.py +0 -0
- {hexkit-3.0.1 → hexkit-3.0.2}/src/hexkit/providers/mongokafka/__init__.py +0 -0
- {hexkit-3.0.1 → hexkit-3.0.2}/src/hexkit/providers/s3/__init__.py +0 -0
- {hexkit-3.0.1 → hexkit-3.0.2}/src/hexkit/providers/s3/provider.py +0 -0
- {hexkit-3.0.1 → hexkit-3.0.2}/src/hexkit/providers/s3/test_files/__init__.py +0 -0
- {hexkit-3.0.1 → hexkit-3.0.2}/src/hexkit/providers/s3/test_files/test_file1.yaml +0 -0
- {hexkit-3.0.1 → hexkit-3.0.2}/src/hexkit/providers/s3/test_files/test_file2.yaml +0 -0
- {hexkit-3.0.1 → hexkit-3.0.2}/src/hexkit/providers/s3/test_files/test_file3.yaml +0 -0
- {hexkit-3.0.1 → hexkit-3.0.2}/src/hexkit/providers/s3/test_files/test_file4.yaml +0 -0
- {hexkit-3.0.1 → hexkit-3.0.2}/src/hexkit/providers/s3/testutils.py +0 -0
- {hexkit-3.0.1 → hexkit-3.0.2}/src/hexkit/providers/testing/__init__.py +0 -0
- {hexkit-3.0.1 → hexkit-3.0.2}/src/hexkit/providers/testing/eventpub.py +0 -0
- {hexkit-3.0.1 → hexkit-3.0.2}/src/hexkit/py.typed +0 -0
- {hexkit-3.0.1 → hexkit-3.0.2}/src/hexkit/utils.py +0 -0
- {hexkit-3.0.1 → hexkit-3.0.2}/src/hexkit.egg-info/SOURCES.txt +0 -0
- {hexkit-3.0.1 → hexkit-3.0.2}/src/hexkit.egg-info/dependency_links.txt +0 -0
- {hexkit-3.0.1 → hexkit-3.0.2}/src/hexkit.egg-info/requires.txt +0 -0
- {hexkit-3.0.1 → hexkit-3.0.2}/src/hexkit.egg-info/top_level.txt +0 -0
|
@@ -22,7 +22,7 @@ from typing import Any, Literal, Union
|
|
|
22
22
|
# This is intended to type objects that could be a potential output of `json.loads`.
|
|
23
23
|
# (Scalar types as well as arrays are excluded from the above assumption.)
|
|
24
24
|
JsonObject = Mapping[
|
|
25
|
-
str, Union[int, float, str, bool, Sequence[Any], Mapping[str, Any]]
|
|
25
|
+
str, Union[int, float, str, bool, Sequence[Any], Mapping[str, Any], None]
|
|
26
26
|
]
|
|
27
27
|
|
|
28
28
|
|
|
@@ -201,7 +201,7 @@ class MongoDbDaoBase(ABC, Generic[Dto]):
|
|
|
201
201
|
# (trusting MongoDB that matching on the _id field can only yield one or
|
|
202
202
|
# zero matches)
|
|
203
203
|
|
|
204
|
-
async def delete(self,
|
|
204
|
+
async def delete(self, id_: str) -> None:
|
|
205
205
|
"""Delete a resource by providing its ID.
|
|
206
206
|
|
|
207
207
|
Args:
|
|
@@ -135,7 +135,7 @@ def get_delete_publish_func(
|
|
|
135
135
|
)
|
|
136
136
|
|
|
137
137
|
document = {"_id": id_, "__metadata__": {"deleted": True, "published": True}}
|
|
138
|
-
await collection.replace_one({"_id": document["_id"]}, document
|
|
138
|
+
await collection.replace_one({"_id": document["_id"]}, document)
|
|
139
139
|
|
|
140
140
|
return publish_deletion
|
|
141
141
|
|
|
@@ -233,13 +233,17 @@ class MongoKafkaDaoPublisher(Generic[Dto]):
|
|
|
233
233
|
ResourceNotFoundError:
|
|
234
234
|
when resource with the id specified in the dto was not found
|
|
235
235
|
"""
|
|
236
|
-
|
|
237
|
-
|
|
236
|
+
document = self._dao._dto_to_document(dto)
|
|
237
|
+
result = await self._collection.replace_one(
|
|
238
|
+
{"_id": document["_id"], "__metadata__.deleted": False}, document
|
|
239
|
+
)
|
|
240
|
+
if result.matched_count == 0:
|
|
241
|
+
raise ResourceNotFoundError(id_=document["_id"])
|
|
238
242
|
|
|
239
243
|
if self._autopublish:
|
|
240
244
|
await self._publish_change(dto)
|
|
241
245
|
|
|
242
|
-
async def delete(self,
|
|
246
|
+
async def delete(self, id_: str) -> None:
|
|
243
247
|
"""Delete a resource by providing its ID.
|
|
244
248
|
|
|
245
249
|
Args:
|
|
@@ -248,10 +252,15 @@ class MongoKafkaDaoPublisher(Generic[Dto]):
|
|
|
248
252
|
Raises:
|
|
249
253
|
ResourceNotFoundError: when resource with the specified id_ was not found
|
|
250
254
|
"""
|
|
251
|
-
document = {
|
|
252
|
-
|
|
253
|
-
{"
|
|
255
|
+
document = {
|
|
256
|
+
"_id": id_,
|
|
257
|
+
"__metadata__": {"deleted": True, "published": False},
|
|
258
|
+
}
|
|
259
|
+
result = await self._collection.replace_one(
|
|
260
|
+
{"_id": document["_id"], "__metadata__.deleted": False}, document
|
|
254
261
|
)
|
|
262
|
+
if result.matched_count == 0:
|
|
263
|
+
raise ResourceNotFoundError(id_=id_)
|
|
255
264
|
|
|
256
265
|
if self._autopublish:
|
|
257
266
|
await self._publish_delete(id_)
|
|
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
|
|
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
|
|
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
|