apexdevkit 1.5.1__tar.gz → 1.5.3__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.
- {apexdevkit-1.5.1 → apexdevkit-1.5.3}/PKG-INFO +1 -1
- {apexdevkit-1.5.1 → apexdevkit-1.5.3}/apexdevkit/fastapi/router.py +14 -2
- {apexdevkit-1.5.1 → apexdevkit-1.5.3}/apexdevkit/fastapi/service.py +4 -10
- {apexdevkit-1.5.1 → apexdevkit-1.5.3}/pyproject.toml +1 -1
- {apexdevkit-1.5.1 → apexdevkit-1.5.3}/LICENSE +0 -0
- {apexdevkit-1.5.1 → apexdevkit-1.5.3}/README.md +0 -0
- {apexdevkit-1.5.1 → apexdevkit-1.5.3}/apexdevkit/__init__.py +0 -0
- {apexdevkit-1.5.1 → apexdevkit-1.5.3}/apexdevkit/annotation/__init__.py +0 -0
- {apexdevkit-1.5.1 → apexdevkit-1.5.3}/apexdevkit/annotation/deprecate.py +0 -0
- {apexdevkit-1.5.1 → apexdevkit-1.5.3}/apexdevkit/error.py +0 -0
- {apexdevkit-1.5.1 → apexdevkit-1.5.3}/apexdevkit/fastapi/__init__.py +0 -0
- {apexdevkit-1.5.1 → apexdevkit-1.5.3}/apexdevkit/fastapi/builder.py +0 -0
- {apexdevkit-1.5.1 → apexdevkit-1.5.3}/apexdevkit/fastapi/dependable.py +0 -0
- {apexdevkit-1.5.1 → apexdevkit-1.5.3}/apexdevkit/fastapi/docs.py +0 -0
- {apexdevkit-1.5.1 → apexdevkit-1.5.3}/apexdevkit/fastapi/response.py +0 -0
- {apexdevkit-1.5.1 → apexdevkit-1.5.3}/apexdevkit/fastapi/schema.py +0 -0
- {apexdevkit-1.5.1 → apexdevkit-1.5.3}/apexdevkit/http/__init__.py +0 -0
- {apexdevkit-1.5.1 → apexdevkit-1.5.3}/apexdevkit/http/fake.py +0 -0
- {apexdevkit-1.5.1 → apexdevkit-1.5.3}/apexdevkit/http/fluent.py +0 -0
- {apexdevkit-1.5.1 → apexdevkit-1.5.3}/apexdevkit/http/httpx.py +0 -0
- {apexdevkit-1.5.1 → apexdevkit-1.5.3}/apexdevkit/http/json.py +0 -0
- {apexdevkit-1.5.1 → apexdevkit-1.5.3}/apexdevkit/http/url.py +0 -0
- {apexdevkit-1.5.1 → apexdevkit-1.5.3}/apexdevkit/py.typed +0 -0
- {apexdevkit-1.5.1 → apexdevkit-1.5.3}/apexdevkit/repository/__init__.py +0 -0
- {apexdevkit-1.5.1 → apexdevkit-1.5.3}/apexdevkit/repository/base.py +0 -0
- {apexdevkit-1.5.1 → apexdevkit-1.5.3}/apexdevkit/repository/connector.py +0 -0
- {apexdevkit-1.5.1 → apexdevkit-1.5.3}/apexdevkit/repository/database.py +0 -0
- {apexdevkit-1.5.1 → apexdevkit-1.5.3}/apexdevkit/repository/in_memory.py +0 -0
- {apexdevkit-1.5.1 → apexdevkit-1.5.3}/apexdevkit/repository/interface.py +0 -0
- {apexdevkit-1.5.1 → apexdevkit-1.5.3}/apexdevkit/testing/__init__.py +0 -0
- {apexdevkit-1.5.1 → apexdevkit-1.5.3}/apexdevkit/testing/database.py +0 -0
- {apexdevkit-1.5.1 → apexdevkit-1.5.3}/apexdevkit/testing/fake.py +0 -0
- {apexdevkit-1.5.1 → apexdevkit-1.5.3}/apexdevkit/testing/rest.py +0 -0
|
@@ -221,6 +221,8 @@ class RestfulRouter:
|
|
|
221
221
|
item = service.create_one(item)
|
|
222
222
|
except ExistsError as e:
|
|
223
223
|
return JSONResponse(self.response.exists(e), 409)
|
|
224
|
+
except ForbiddenError as e:
|
|
225
|
+
return JSONResponse(self.response.forbidden(e), 403)
|
|
224
226
|
|
|
225
227
|
return self.response.created_one(item)
|
|
226
228
|
|
|
@@ -270,6 +272,8 @@ class RestfulRouter:
|
|
|
270
272
|
return self.response.created_many(service.create_many(items))
|
|
271
273
|
except ExistsError as e:
|
|
272
274
|
return JSONResponse(self.response.exists(e), 409)
|
|
275
|
+
except ForbiddenError as e:
|
|
276
|
+
return JSONResponse(self.response.forbidden(e), 403)
|
|
273
277
|
|
|
274
278
|
return endpoint
|
|
275
279
|
|
|
@@ -317,6 +321,8 @@ class RestfulRouter:
|
|
|
317
321
|
return self.response.found_one(service.read_one(item_id))
|
|
318
322
|
except DoesNotExistError as e:
|
|
319
323
|
return JSONResponse(self.response.not_found(e), 404)
|
|
324
|
+
except ForbiddenError as e:
|
|
325
|
+
return JSONResponse(self.response.forbidden(e), 403)
|
|
320
326
|
|
|
321
327
|
return endpoint
|
|
322
328
|
|
|
@@ -355,8 +361,10 @@ class RestfulRouter:
|
|
|
355
361
|
return JSONResponse(
|
|
356
362
|
RestfulResponse(RestfulName(self.parent)).not_found(e), 404
|
|
357
363
|
)
|
|
358
|
-
|
|
359
|
-
|
|
364
|
+
try:
|
|
365
|
+
return self.response.found_many(list(service.read_all()))
|
|
366
|
+
except ForbiddenError as e:
|
|
367
|
+
return JSONResponse(self.response.forbidden(e), 403)
|
|
360
368
|
|
|
361
369
|
return endpoint
|
|
362
370
|
|
|
@@ -462,6 +470,8 @@ class RestfulRouter:
|
|
|
462
470
|
service.update_many(items)
|
|
463
471
|
except DoesNotExistError as e:
|
|
464
472
|
return JSONResponse(self.response.not_found(e), 404)
|
|
473
|
+
except ForbiddenError as e:
|
|
474
|
+
return JSONResponse(self.response.forbidden(e), 403)
|
|
465
475
|
|
|
466
476
|
return self.response.ok()
|
|
467
477
|
|
|
@@ -511,6 +521,8 @@ class RestfulRouter:
|
|
|
511
521
|
service.delete_one(item_id)
|
|
512
522
|
except DoesNotExistError as e:
|
|
513
523
|
return JSONResponse(self.response.not_found(e), 404)
|
|
524
|
+
except ForbiddenError as e:
|
|
525
|
+
return JSONResponse(self.response.forbidden(e), 403)
|
|
514
526
|
|
|
515
527
|
return self.response.ok()
|
|
516
528
|
|
|
@@ -45,18 +45,12 @@ class RestfulRepository(RestfulService):
|
|
|
45
45
|
repository: Repository[Any, Any]
|
|
46
46
|
|
|
47
47
|
def create_one(self, item: RawItem) -> RawItem:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
self.repository.create(result)
|
|
51
|
-
|
|
52
|
-
return _as_raw_item(result)
|
|
48
|
+
return _as_raw_item(self.repository.create(self.resource(**item)))
|
|
53
49
|
|
|
54
50
|
def create_many(self, items: RawCollection) -> RawCollection:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
return _as_raw_collection(result)
|
|
51
|
+
return _as_raw_collection(
|
|
52
|
+
self.repository.create_many([self.resource(**fields) for fields in items])
|
|
53
|
+
)
|
|
60
54
|
|
|
61
55
|
def read_one(self, item_id: str) -> RawItem:
|
|
62
56
|
result = self.repository.read(item_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
|