maleo-foundation 0.2.23__tar.gz → 0.2.25__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.
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/PKG-INFO +1 -1
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/enums.py +7 -3
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/managers/service.py +7 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/transfers/results/service/__init__.py +0 -2
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/utils/exceptions.py +0 -31
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation.egg-info/PKG-INFO +1 -1
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation.egg-info/SOURCES.txt +0 -1
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/pyproject.toml +1 -1
- maleo_foundation-0.2.23/maleo_foundation/models/transfers/results/service/query.py +0 -51
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/README.md +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/__init__.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/authentication.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/authorization.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/client/__init__.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/client/manager.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/client/services/__init__.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/client/services/encryption/__init__.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/client/services/encryption/aes.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/client/services/encryption/rsa.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/client/services/hash/__init__.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/client/services/hash/bcrypt.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/client/services/hash/hmac.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/client/services/hash/sha256.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/client/services/key.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/client/services/signature.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/client/services/token.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/constants.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/expanded_types/__init__.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/expanded_types/client.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/expanded_types/encryption/__init__.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/expanded_types/encryption/aes.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/expanded_types/encryption/rsa.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/expanded_types/general.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/expanded_types/hash.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/expanded_types/key.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/expanded_types/query.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/expanded_types/service.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/expanded_types/signature.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/expanded_types/token.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/extended_types.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/managers/__init__.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/managers/cache/__init__.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/managers/cache/redis.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/managers/client/__init__.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/managers/client/base.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/managers/client/google/__init__.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/managers/client/google/base.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/managers/client/google/parameter.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/managers/client/google/secret.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/managers/client/google/storage.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/managers/client/maleo.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/managers/db.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/managers/middleware.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/middlewares/authentication.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/middlewares/base.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/middlewares/cors.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/__init__.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/responses.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/schemas/__init__.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/schemas/encryption.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/schemas/general.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/schemas/hash.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/schemas/key.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/schemas/parameter.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/schemas/result.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/schemas/signature.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/schemas/token.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/table.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/transfers/__init__.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/transfers/general/__init__.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/transfers/general/key.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/transfers/general/signature.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/transfers/general/token.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/transfers/parameters/__init__.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/transfers/parameters/client.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/transfers/parameters/encryption/__init__.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/transfers/parameters/encryption/aes.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/transfers/parameters/encryption/rsa.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/transfers/parameters/general.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/transfers/parameters/hash/__init__.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/transfers/parameters/hash/bcrypt.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/transfers/parameters/hash/hmac.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/transfers/parameters/hash/sha256.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/transfers/parameters/key.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/transfers/parameters/service.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/transfers/parameters/signature.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/transfers/parameters/token.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/transfers/results/__init__.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/transfers/results/client/__init__.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/transfers/results/client/controllers/__init__.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/transfers/results/client/controllers/http.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/transfers/results/client/service.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/transfers/results/encryption/__init__.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/transfers/results/encryption/aes.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/transfers/results/encryption/rsa.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/transfers/results/hash.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/transfers/results/key.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/transfers/results/service/controllers/__init__.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/transfers/results/service/controllers/rest.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/transfers/results/service/general.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/transfers/results/service/repository.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/transfers/results/signature.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/transfers/results/token.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/types.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/utils/__init__.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/utils/controller.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/utils/dependencies/__init__.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/utils/dependencies/auth.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/utils/extractor.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/utils/formatter/__init__.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/utils/formatter/case.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/utils/loaders/__init__.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/utils/loaders/credential/__init__.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/utils/loaders/credential/google.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/utils/loaders/json.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/utils/loaders/key/__init__.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/utils/loaders/key/rsa.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/utils/loaders/yaml.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/utils/logging.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/utils/mergers.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/utils/query.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/utils/repository.py +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation.egg-info/dependency_links.txt +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation.egg-info/requires.txt +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation.egg-info/top_level.txt +0 -0
- {maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/setup.cfg +0 -0
@@ -83,11 +83,13 @@ class BaseEnums:
|
|
83
83
|
AUTHENTICATION = "authentication"
|
84
84
|
|
85
85
|
class ServiceLoggerType(StrEnum):
|
86
|
+
REPOSITORY = "repository"
|
86
87
|
DATABASE = "database"
|
87
88
|
APPLICATION = "application"
|
88
89
|
|
89
90
|
class LoggerType(StrEnum):
|
90
91
|
MIDDLEWARE = "middleware"
|
92
|
+
REPOSITORY = "repository"
|
91
93
|
DATABASE = "database"
|
92
94
|
APPLICATION = "application"
|
93
95
|
CLIENT = "client"
|
@@ -103,7 +105,8 @@ class BaseEnums:
|
|
103
105
|
NOTSET = logging.NOTSET
|
104
106
|
|
105
107
|
class CacheType(StrEnum):
|
106
|
-
|
108
|
+
REPOSITORY = "repository"
|
109
|
+
ROUTER = "router"
|
107
110
|
CLIENT = "client"
|
108
111
|
|
109
112
|
class CacheTTL(IntEnum):
|
@@ -117,6 +120,7 @@ class BaseEnums:
|
|
117
120
|
TTL_6HR = int(6*60*60)
|
118
121
|
TTL_12HR = int(12*60*60)
|
119
122
|
TTL_1DY = int(1*24*60*60)
|
120
|
-
|
123
|
+
TTL_3DY = int(3*24*60*60)
|
121
124
|
TTL_1WK = int(1*24*60*60)
|
122
|
-
|
125
|
+
TTL_2WK = int(2*24*60*60)
|
126
|
+
TTL_1MO = int(1*30*24*60*60)
|
@@ -129,6 +129,7 @@ class Configurations(BaseModel):
|
|
129
129
|
|
130
130
|
class Loggers(BaseModel):
|
131
131
|
application:ServiceLogger = Field(..., description="Application logger")
|
132
|
+
repository:ServiceLogger = Field(..., description="Repository logger")
|
132
133
|
database:ServiceLogger = Field(..., description="Database logger")
|
133
134
|
middleware:MiddlewareLoggers = Field(..., description="Middleware logger")
|
134
135
|
|
@@ -297,6 +298,11 @@ class ServiceManager:
|
|
297
298
|
service_key=self._configs.service.key,
|
298
299
|
**self._log_config.model_dump()
|
299
300
|
)
|
301
|
+
repository = ServiceLogger(
|
302
|
+
type=BaseEnums.LoggerType.REPOSITORY,
|
303
|
+
service_key=self._configs.service.key,
|
304
|
+
**self._log_config.model_dump()
|
305
|
+
)
|
300
306
|
#* Middleware's loggers
|
301
307
|
base = MiddlewareLogger(
|
302
308
|
middleware_type=BaseEnums.MiddlewareLoggerType.BASE,
|
@@ -311,6 +317,7 @@ class ServiceManager:
|
|
311
317
|
middleware = MiddlewareLoggers(base=base, authentication=authentication)
|
312
318
|
self._loggers = Loggers(
|
313
319
|
application=application,
|
320
|
+
repository=repository,
|
314
321
|
database=database,
|
315
322
|
middleware=middleware
|
316
323
|
)
|
@@ -1,11 +1,9 @@
|
|
1
1
|
from __future__ import annotations
|
2
2
|
from .general import BaseServiceGeneralResultsTransfers
|
3
|
-
from .query import BaseServiceQueryResultsTransfers
|
4
3
|
from .repository import BaseServiceRepositoryResultsTransfers
|
5
4
|
from .controllers import BaseServiceControllerResultsTransfers
|
6
5
|
|
7
6
|
class BaseServiceResultsTransfers:
|
8
7
|
General = BaseServiceGeneralResultsTransfers
|
9
|
-
Query = BaseServiceQueryResultsTransfers
|
10
8
|
Repository = BaseServiceRepositoryResultsTransfers
|
11
9
|
Controller = BaseServiceControllerResultsTransfers
|
@@ -10,8 +10,6 @@ from typing import Optional
|
|
10
10
|
from maleo_foundation.models.responses import BaseResponses
|
11
11
|
from maleo_foundation.models.transfers.results.service.general \
|
12
12
|
import BaseServiceGeneralResultsTransfers
|
13
|
-
from maleo_foundation.models.transfers.results.service.query \
|
14
|
-
import BaseServiceQueryResultsTransfers
|
15
13
|
from maleo_foundation.models.transfers.results.service.repository \
|
16
14
|
import BaseServiceRepositoryResultsTransfers
|
17
15
|
from maleo_foundation.utils.logging import BaseLogger
|
@@ -44,35 +42,6 @@ class BaseExceptions:
|
|
44
42
|
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR
|
45
43
|
)
|
46
44
|
|
47
|
-
@staticmethod
|
48
|
-
def database_exception_handler(
|
49
|
-
operation:str,
|
50
|
-
logger:Optional[BaseLogger] = None,
|
51
|
-
fail_result_class:type[BaseServiceQueryResultsTransfers.Fail] = BaseServiceQueryResultsTransfers.Fail
|
52
|
-
):
|
53
|
-
"""Decorator to handle database-related exceptions consistently."""
|
54
|
-
def decorator(func):
|
55
|
-
@wraps(func)
|
56
|
-
def wrapper(*args, **kwargs):
|
57
|
-
try:
|
58
|
-
return func(*args, **kwargs)
|
59
|
-
except SQLAlchemyError as e:
|
60
|
-
logger.error("Database error occurred while %s: '%s'", operation, str(e), exc_info=True)
|
61
|
-
return fail_result_class(
|
62
|
-
message=f"Failed {operation}",
|
63
|
-
description=f"A database error occurred while {operation}. Please try again later or contact administrator.",
|
64
|
-
other="Database operation failed"
|
65
|
-
)
|
66
|
-
except Exception as e:
|
67
|
-
logger.error("Unexpected error occurred while %s: '%s'", operation, str(e), exc_info=True)
|
68
|
-
return fail_result_class(
|
69
|
-
message=f"Failed {operation}",
|
70
|
-
description=f"An unexpected error occurred while {operation}. Please try again later or contact administrator.",
|
71
|
-
other="Internal processing error"
|
72
|
-
)
|
73
|
-
return wrapper
|
74
|
-
return decorator
|
75
|
-
|
76
45
|
@staticmethod
|
77
46
|
def repository_exception_handler(
|
78
47
|
operation:str,
|
@@ -99,7 +99,6 @@ maleo_foundation/models/transfers/results/encryption/aes.py
|
|
99
99
|
maleo_foundation/models/transfers/results/encryption/rsa.py
|
100
100
|
maleo_foundation/models/transfers/results/service/__init__.py
|
101
101
|
maleo_foundation/models/transfers/results/service/general.py
|
102
|
-
maleo_foundation/models/transfers/results/service/query.py
|
103
102
|
maleo_foundation/models/transfers/results/service/repository.py
|
104
103
|
maleo_foundation/models/transfers/results/service/controllers/__init__.py
|
105
104
|
maleo_foundation/models/transfers/results/service/controllers/rest.py
|
@@ -1,51 +0,0 @@
|
|
1
|
-
from __future__ import annotations
|
2
|
-
from pydantic import model_validator
|
3
|
-
from maleo_foundation.models.schemas.general import BaseGeneralSchemas
|
4
|
-
from maleo_foundation.models.schemas.result import BaseResultSchemas
|
5
|
-
|
6
|
-
class BaseServiceQueryResultsTransfers:
|
7
|
-
class Row(
|
8
|
-
BaseGeneralSchemas.Status,
|
9
|
-
BaseGeneralSchemas.Timestamps,
|
10
|
-
BaseGeneralSchemas.Identifiers,
|
11
|
-
BaseResultSchemas.BaseRow
|
12
|
-
): pass
|
13
|
-
|
14
|
-
class Fail(BaseResultSchemas.Fail): pass
|
15
|
-
|
16
|
-
class NotFound(BaseResultSchemas.NotFound): pass
|
17
|
-
|
18
|
-
class NoData(BaseResultSchemas.NoData): pass
|
19
|
-
|
20
|
-
class SingleData(BaseResultSchemas.SingleData):
|
21
|
-
data:BaseServiceQueryResultsTransfers.Row
|
22
|
-
|
23
|
-
class UnpaginatedMultipleData(BaseResultSchemas.UnpaginatedMultipleData):
|
24
|
-
data:list[BaseServiceQueryResultsTransfers.Row]
|
25
|
-
|
26
|
-
class PaginatedMultipleData(BaseResultSchemas.PaginatedMultipleData):
|
27
|
-
data:list[BaseServiceQueryResultsTransfers.Row]
|
28
|
-
|
29
|
-
@model_validator(mode="before")
|
30
|
-
@classmethod
|
31
|
-
def calculate_pagination(cls, values: dict) -> dict:
|
32
|
-
"""Calculates pagination metadata before validation."""
|
33
|
-
total_data = values.get("total_data", 0)
|
34
|
-
data = values.get("data", [])
|
35
|
-
|
36
|
-
#* Get pagination values from inherited SimplePagination
|
37
|
-
page = values.get("page", 1)
|
38
|
-
limit = values.get("limit", 10)
|
39
|
-
|
40
|
-
#* Calculate total pages
|
41
|
-
total_pages = (total_data // limit) + (1 if total_data % limit > 0 else 0)
|
42
|
-
|
43
|
-
#* Assign computed pagination object before validation
|
44
|
-
values["pagination"] = BaseGeneralSchemas.ExtendedPagination(
|
45
|
-
page=page,
|
46
|
-
limit=limit,
|
47
|
-
data_count=len(data),
|
48
|
-
total_data=total_data,
|
49
|
-
total_pages=total_pages
|
50
|
-
)
|
51
|
-
return values
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/client/services/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/client/services/hash/bcrypt.py
RENAMED
File without changes
|
{maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/client/services/hash/hmac.py
RENAMED
File without changes
|
{maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/client/services/hash/sha256.py
RENAMED
File without changes
|
File without changes
|
{maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/client/services/signature.py
RENAMED
File without changes
|
{maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/client/services/token.py
RENAMED
File without changes
|
File without changes
|
{maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/expanded_types/__init__.py
RENAMED
File without changes
|
{maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/expanded_types/client.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/expanded_types/general.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/expanded_types/query.py
RENAMED
File without changes
|
{maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/expanded_types/service.py
RENAMED
File without changes
|
{maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/expanded_types/signature.py
RENAMED
File without changes
|
{maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/expanded_types/token.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/managers/cache/__init__.py
RENAMED
File without changes
|
{maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/managers/cache/redis.py
RENAMED
File without changes
|
{maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/managers/client/__init__.py
RENAMED
File without changes
|
{maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/managers/client/base.py
RENAMED
File without changes
|
File without changes
|
{maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/managers/client/google/base.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/managers/client/maleo.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/middlewares/authentication.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/schemas/__init__.py
RENAMED
File without changes
|
{maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/schemas/encryption.py
RENAMED
File without changes
|
{maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/schemas/general.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/schemas/parameter.py
RENAMED
File without changes
|
{maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/schemas/result.py
RENAMED
File without changes
|
{maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/schemas/signature.py
RENAMED
File without changes
|
{maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/schemas/token.py
RENAMED
File without changes
|
File without changes
|
{maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/transfers/__init__.py
RENAMED
File without changes
|
File without changes
|
{maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/transfers/general/key.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
|
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
|
{maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/models/transfers/results/key.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
|
{maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/utils/dependencies/__init__.py
RENAMED
File without changes
|
{maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/utils/dependencies/auth.py
RENAMED
File without changes
|
File without changes
|
{maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/utils/formatter/__init__.py
RENAMED
File without changes
|
{maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/utils/formatter/case.py
RENAMED
File without changes
|
{maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/utils/loaders/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/utils/loaders/key/__init__.py
RENAMED
File without changes
|
{maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation/utils/loaders/key/rsa.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{maleo_foundation-0.2.23 → maleo_foundation-0.2.25}/maleo_foundation.egg-info/dependency_links.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|