apexdevkit 1.25.2__tar.gz → 1.25.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.25.2 → apexdevkit-1.25.3}/PKG-INFO +1 -1
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/fastapi/builder.py +17 -4
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/pyproject.toml +1 -1
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/LICENSE +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/README.md +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/__init__.py +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/annotation/__init__.py +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/annotation/deprecate.py +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/date.py +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/environment.py +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/error.py +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/fastapi/__init__.py +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/fastapi/dependable.py +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/fastapi/docs.py +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/fastapi/name.py +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/fastapi/resource.py +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/fastapi/response.py +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/fastapi/router.py +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/fastapi/schema.py +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/fastapi/service.py +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/fluent.py +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/formatter.py +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/http/__init__.py +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/http/fake.py +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/http/fluent.py +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/http/httpx/__init__.py +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/http/httpx/client.py +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/http/httpx/hooks.py +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/http/json.py +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/http/url.py +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/id.py +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/key_fn.py +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/py.typed +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/query/__init__.py +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/query/generator.py +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/query/query.py +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/repository/__init__.py +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/repository/base.py +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/repository/connector.py +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/repository/database.py +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/repository/decorator.py +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/repository/in_memory.py +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/repository/interface.py +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/repository/mssql.py +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/repository/repository.py +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/repository/sql.py +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/repository/sqlite.py +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/server.py +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/synchronization.py +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/testing/__init__.py +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/testing/database.py +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/testing/fake.py +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/testing/rest.py +0 -0
- {apexdevkit-1.25.2 → apexdevkit-1.25.3}/apexdevkit/value.py +0 -0
|
@@ -6,8 +6,8 @@ from dataclasses import dataclass, field
|
|
|
6
6
|
from typing import Any, Self
|
|
7
7
|
|
|
8
8
|
from fastapi import APIRouter, FastAPI
|
|
9
|
-
from
|
|
10
|
-
from
|
|
9
|
+
from fastapi.middleware.cors import CORSMiddleware
|
|
10
|
+
from fastapi.responses import JSONResponse
|
|
11
11
|
|
|
12
12
|
from apexdevkit.error import ApiError
|
|
13
13
|
from apexdevkit.fastapi.service import RestfulService
|
|
@@ -51,14 +51,16 @@ class FastApiBuilder:
|
|
|
51
51
|
def with_routes(self, values: Mapping[str, APIRouter]) -> Self:
|
|
52
52
|
for key, value in values.items():
|
|
53
53
|
self.app.include_router(
|
|
54
|
-
value,
|
|
54
|
+
value,
|
|
55
|
+
prefix=_Endpoint(key).normilized(),
|
|
56
|
+
tags=value.tags or [key.title()],
|
|
55
57
|
)
|
|
56
58
|
|
|
57
59
|
return self
|
|
58
60
|
|
|
59
61
|
def with_mounted(self, **apps: FastAPI) -> Self:
|
|
60
62
|
for path, app in apps.items():
|
|
61
|
-
self.app.mount(
|
|
63
|
+
self.app.mount(_Endpoint(path).normilized(), app)
|
|
62
64
|
|
|
63
65
|
return self
|
|
64
66
|
|
|
@@ -105,3 +107,14 @@ class PreBuilt(RestfulServiceBuilder): # pragma: no cover
|
|
|
105
107
|
|
|
106
108
|
def build(self) -> RestfulService:
|
|
107
109
|
return self.service
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
@dataclass(frozen=True)
|
|
113
|
+
class _Endpoint:
|
|
114
|
+
raw: str
|
|
115
|
+
|
|
116
|
+
def normilized(self) -> str:
|
|
117
|
+
return f"/{self.raw.replace('_', '-')}"
|
|
118
|
+
|
|
119
|
+
def __str__(self) -> str:
|
|
120
|
+
return self.normilized()
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|