orionis 0.663.0__py3-none-any.whl → 0.665.0__py3-none-any.whl
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.
- orionis/failure/entities/throwable.py +4 -4
- orionis/foundation/application.py +22 -22
- orionis/foundation/config/app/entities/app.py +1 -1
- orionis/foundation/config/database/entities/mysql.py +1 -1
- orionis/foundation/config/database/entities/oracle.py +1 -1
- orionis/foundation/config/database/entities/pgsql.py +1 -1
- orionis/foundation/config/database/entities/sqlite.py +1 -1
- orionis/foundation/config/logging/entities/chunked.py +0 -2
- orionis/foundation/config/logging/entities/daily.py +0 -2
- orionis/foundation/config/logging/entities/hourly.py +0 -2
- orionis/foundation/config/logging/entities/monthly.py +0 -2
- orionis/foundation/config/logging/entities/stack.py +1 -3
- orionis/foundation/config/logging/entities/weekly.py +0 -2
- orionis/foundation/config/mail/entities/smtp.py +6 -4
- orionis/foundation/config/queue/entities/database.py +1 -1
- orionis/foundation/config/session/entities/session.py +1 -1
- orionis/foundation/config/startup.py +1 -1
- orionis/foundation/config/testing/entities/testing.py +1 -1
- orionis/foundation/contracts/application.py +1 -1
- orionis/metadata/framework.py +1 -1
- orionis/metadata/package.py +5 -4
- {orionis-0.663.0.dist-info → orionis-0.665.0.dist-info}/METADATA +1 -1
- {orionis-0.663.0.dist-info → orionis-0.665.0.dist-info}/RECORD +26 -36
- orionis/container/validators/__init__.py +0 -21
- orionis/container/validators/implements.py +0 -73
- orionis/container/validators/is_abstract_class.py +0 -34
- orionis/container/validators/is_callable.py +0 -30
- orionis/container/validators/is_concrete_class.py +0 -34
- orionis/container/validators/is_instance.py +0 -32
- orionis/container/validators/is_not_subclass.py +0 -32
- orionis/container/validators/is_subclass.py +0 -32
- orionis/container/validators/is_valid_alias.py +0 -42
- orionis/container/validators/lifetime.py +0 -53
- {orionis-0.663.0.dist-info → orionis-0.665.0.dist-info}/WHEEL +0 -0
- {orionis-0.663.0.dist-info → orionis-0.665.0.dist-info}/licenses/LICENCE +0 -0
- {orionis-0.663.0.dist-info → orionis-0.665.0.dist-info}/top_level.txt +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from dataclasses import dataclass
|
|
2
|
+
from typing import Optional
|
|
2
3
|
|
|
3
4
|
@dataclass(kw_only=True, frozen=True)
|
|
4
5
|
class Throwable:
|
|
@@ -27,7 +28,6 @@ class Throwable:
|
|
|
27
28
|
throughout the framework, making error handling and logging more consistent.
|
|
28
29
|
"""
|
|
29
30
|
|
|
30
|
-
classtype: type
|
|
31
|
-
message: str
|
|
32
|
-
|
|
33
|
-
traceback: str = None # Optional traceback information as a string
|
|
31
|
+
classtype: type # The type of the throwable (e.g., Exception class)
|
|
32
|
+
message: str # The error message associated with the throwable
|
|
33
|
+
traceback: Optional[str] = None # Optional traceback information as a string
|
|
@@ -2,7 +2,7 @@ import asyncio
|
|
|
2
2
|
import copy
|
|
3
3
|
import time
|
|
4
4
|
from pathlib import Path
|
|
5
|
-
from typing import Any, List, Type, Dict
|
|
5
|
+
from typing import Any, List, Type, Dict, Optional
|
|
6
6
|
from orionis.console.contracts.base_scheduler import IBaseScheduler
|
|
7
7
|
from orionis.console.base.scheduler import BaseScheduler
|
|
8
8
|
from orionis.container.container import Container
|
|
@@ -25,7 +25,6 @@ from orionis.foundation.config.testing.entities.testing import Testing
|
|
|
25
25
|
from orionis.foundation.contracts.application import IApplication
|
|
26
26
|
from orionis.foundation.exceptions import OrionisTypeError, OrionisRuntimeError, OrionisValueError
|
|
27
27
|
from orionis.services.environment.env import Env
|
|
28
|
-
from orionis.services.log.contracts.log_service import ILogger
|
|
29
28
|
from orionis.support.wrapper.dataclass import DataClass
|
|
30
29
|
|
|
31
30
|
class Application(Container, IApplication):
|
|
@@ -67,6 +66,8 @@ class Application(Container, IApplication):
|
|
|
67
66
|
Read-only property containing the timestamp (epoch) when the application was started.
|
|
68
67
|
"""
|
|
69
68
|
|
|
69
|
+
CONFIGURATION_LOCKED_ERROR_MESSAGE = "Cannot modify configuration after application has been booted."
|
|
70
|
+
|
|
70
71
|
@property
|
|
71
72
|
def isBooted(
|
|
72
73
|
self
|
|
@@ -142,13 +143,13 @@ class Application(Container, IApplication):
|
|
|
142
143
|
self.__runtime_path_config: dict = {}
|
|
143
144
|
|
|
144
145
|
# Property to store the scheduler instance
|
|
145
|
-
self.__scheduler: IBaseScheduler = None
|
|
146
|
+
self.__scheduler: Optional[IBaseScheduler] = None
|
|
146
147
|
|
|
147
148
|
# Property to store the exception handler class
|
|
148
|
-
self.__exception_handler: Type[IBaseExceptionHandler] = None
|
|
149
|
+
self.__exception_handler: Optional[Type[IBaseExceptionHandler]] = None
|
|
149
150
|
|
|
150
151
|
# Flag to prevent re-initialization
|
|
151
|
-
self.__initialized = True
|
|
152
|
+
self.__initialized = True # NOSONAR
|
|
152
153
|
|
|
153
154
|
# === Native Kernels and Providers for Orionis Framework ===
|
|
154
155
|
# Responsible for loading the native kernels and service providers of the Orionis framework.
|
|
@@ -776,7 +777,7 @@ class Application(Container, IApplication):
|
|
|
776
777
|
|
|
777
778
|
# Prevent modification if the application has already been booted
|
|
778
779
|
if self.__booted:
|
|
779
|
-
raise OrionisValueError(
|
|
780
|
+
raise OrionisValueError(self.CONFIGURATION_LOCKED_ERROR_MESSAGE)
|
|
780
781
|
|
|
781
782
|
# Convert class type to dict using DataClass wrapper
|
|
782
783
|
if (isinstance(app, type) and issubclass(app, App)):
|
|
@@ -876,7 +877,7 @@ class Application(Container, IApplication):
|
|
|
876
877
|
|
|
877
878
|
# Prevent modification if the application has already been booted
|
|
878
879
|
if self.__booted:
|
|
879
|
-
raise OrionisValueError(
|
|
880
|
+
raise OrionisValueError(self.CONFIGURATION_LOCKED_ERROR_MESSAGE)
|
|
880
881
|
|
|
881
882
|
# Convert class type to dict using DataClass wrapper
|
|
882
883
|
if (isinstance(auth, type) and issubclass(auth, Auth)):
|
|
@@ -976,7 +977,7 @@ class Application(Container, IApplication):
|
|
|
976
977
|
|
|
977
978
|
# Prevent modification if the application has already been booted
|
|
978
979
|
if self.__booted:
|
|
979
|
-
raise OrionisValueError(
|
|
980
|
+
raise OrionisValueError(self.CONFIGURATION_LOCKED_ERROR_MESSAGE)
|
|
980
981
|
|
|
981
982
|
# Convert class type to dict using DataClass wrapper
|
|
982
983
|
if (isinstance(cache, type) and issubclass(cache, Cache)):
|
|
@@ -1076,7 +1077,7 @@ class Application(Container, IApplication):
|
|
|
1076
1077
|
|
|
1077
1078
|
# Prevent modification if the application has already been booted
|
|
1078
1079
|
if self.__booted:
|
|
1079
|
-
raise OrionisValueError(
|
|
1080
|
+
raise OrionisValueError(self.CONFIGURATION_LOCKED_ERROR_MESSAGE)
|
|
1080
1081
|
|
|
1081
1082
|
# Convert class type to dict using DataClass wrapper
|
|
1082
1083
|
if (isinstance(cors, type) and issubclass(cors, Cors)):
|
|
@@ -1176,7 +1177,7 @@ class Application(Container, IApplication):
|
|
|
1176
1177
|
|
|
1177
1178
|
# Prevent modification if the application has already been booted
|
|
1178
1179
|
if self.__booted:
|
|
1179
|
-
raise OrionisValueError(
|
|
1180
|
+
raise OrionisValueError(self.CONFIGURATION_LOCKED_ERROR_MESSAGE)
|
|
1180
1181
|
|
|
1181
1182
|
# Convert class type to dict using DataClass wrapper
|
|
1182
1183
|
if (isinstance(database, type) and issubclass(database, Database)):
|
|
@@ -1276,7 +1277,7 @@ class Application(Container, IApplication):
|
|
|
1276
1277
|
|
|
1277
1278
|
# Prevent modification if the application has already been booted
|
|
1278
1279
|
if self.__booted:
|
|
1279
|
-
raise OrionisValueError(
|
|
1280
|
+
raise OrionisValueError(self.CONFIGURATION_LOCKED_ERROR_MESSAGE)
|
|
1280
1281
|
|
|
1281
1282
|
# Convert class type to dict using DataClass wrapper
|
|
1282
1283
|
if (isinstance(filesystems, type) and issubclass(filesystems, Filesystems)):
|
|
@@ -1376,7 +1377,7 @@ class Application(Container, IApplication):
|
|
|
1376
1377
|
|
|
1377
1378
|
# Prevent modification if the application has already been booted
|
|
1378
1379
|
if self.__booted:
|
|
1379
|
-
raise OrionisValueError(
|
|
1380
|
+
raise OrionisValueError(self.CONFIGURATION_LOCKED_ERROR_MESSAGE)
|
|
1380
1381
|
|
|
1381
1382
|
# Convert class type to dict using DataClass wrapper
|
|
1382
1383
|
if (isinstance(logging, type) and issubclass(logging, Logging)):
|
|
@@ -1476,7 +1477,7 @@ class Application(Container, IApplication):
|
|
|
1476
1477
|
|
|
1477
1478
|
# Prevent modification if the application has already been booted
|
|
1478
1479
|
if self.__booted:
|
|
1479
|
-
raise OrionisValueError(
|
|
1480
|
+
raise OrionisValueError(self.CONFIGURATION_LOCKED_ERROR_MESSAGE)
|
|
1480
1481
|
|
|
1481
1482
|
# Convert class type to dict using DataClass wrapper
|
|
1482
1483
|
if (isinstance(mail, type) and issubclass(mail, Mail)):
|
|
@@ -1576,7 +1577,7 @@ class Application(Container, IApplication):
|
|
|
1576
1577
|
|
|
1577
1578
|
# Prevent modification if the application has already been booted
|
|
1578
1579
|
if self.__booted:
|
|
1579
|
-
raise OrionisValueError(
|
|
1580
|
+
raise OrionisValueError(self.CONFIGURATION_LOCKED_ERROR_MESSAGE)
|
|
1580
1581
|
|
|
1581
1582
|
# Convert class type to dict using DataClass wrapper
|
|
1582
1583
|
if (isinstance(queue, type) and issubclass(queue, Queue)):
|
|
@@ -1676,7 +1677,7 @@ class Application(Container, IApplication):
|
|
|
1676
1677
|
|
|
1677
1678
|
# Prevent modification if the application has already been booted
|
|
1678
1679
|
if self.__booted:
|
|
1679
|
-
raise OrionisValueError(
|
|
1680
|
+
raise OrionisValueError(self.CONFIGURATION_LOCKED_ERROR_MESSAGE)
|
|
1680
1681
|
|
|
1681
1682
|
# Convert class type to dict using DataClass wrapper
|
|
1682
1683
|
if (isinstance(session, type) and issubclass(session, Session)):
|
|
@@ -1776,7 +1777,7 @@ class Application(Container, IApplication):
|
|
|
1776
1777
|
|
|
1777
1778
|
# Prevent modification if the application has already been booted
|
|
1778
1779
|
if self.__booted:
|
|
1779
|
-
raise OrionisValueError(
|
|
1780
|
+
raise OrionisValueError(self.CONFIGURATION_LOCKED_ERROR_MESSAGE)
|
|
1780
1781
|
|
|
1781
1782
|
# Convert class type to dict using DataClass wrapper
|
|
1782
1783
|
if (isinstance(testing, type) and issubclass(testing, Testing)):
|
|
@@ -1801,8 +1802,7 @@ class Application(Container, IApplication):
|
|
|
1801
1802
|
return self
|
|
1802
1803
|
|
|
1803
1804
|
def setConfigPaths(
|
|
1804
|
-
self,
|
|
1805
|
-
*,
|
|
1805
|
+
self, # NOSONAR
|
|
1806
1806
|
root: str | Path = str(Path.cwd().resolve()),
|
|
1807
1807
|
app: str | Path = str((Path.cwd() / 'app').resolve()),
|
|
1808
1808
|
console: str | Path = str((Path.cwd() / 'app' / 'console').resolve()),
|
|
@@ -1912,7 +1912,7 @@ class Application(Container, IApplication):
|
|
|
1912
1912
|
|
|
1913
1913
|
# Prevent modification if the application has already been booted
|
|
1914
1914
|
if self.__booted:
|
|
1915
|
-
raise OrionisValueError(
|
|
1915
|
+
raise OrionisValueError(self.CONFIGURATION_LOCKED_ERROR_MESSAGE)
|
|
1916
1916
|
|
|
1917
1917
|
# Convert class type to dict using DataClass wrapper
|
|
1918
1918
|
if (isinstance(paths, type) and issubclass(paths, Paths)):
|
|
@@ -1977,7 +1977,7 @@ class Application(Container, IApplication):
|
|
|
1977
1977
|
# Copy contains only the 'path' key
|
|
1978
1978
|
self.__runtime_path_config = local_config_copy.get('path', {})
|
|
1979
1979
|
|
|
1980
|
-
except
|
|
1980
|
+
except Exception as e:
|
|
1981
1981
|
|
|
1982
1982
|
# Handle any exceptions during configuration loading
|
|
1983
1983
|
raise OrionisRuntimeError(f"Failed to load application configuration: {str(e)}")
|
|
@@ -1988,7 +1988,7 @@ class Application(Container, IApplication):
|
|
|
1988
1988
|
# You can obtain a specific configuration value by providing a key,
|
|
1989
1989
|
# or retrieve the entire configuration dictionary by omitting the key.
|
|
1990
1990
|
|
|
1991
|
-
def config(
|
|
1991
|
+
def config( # NOSONAR
|
|
1992
1992
|
self,
|
|
1993
1993
|
key: str = None,
|
|
1994
1994
|
value: Any = None
|
|
@@ -2097,7 +2097,7 @@ class Application(Container, IApplication):
|
|
|
2097
2097
|
def path(
|
|
2098
2098
|
self,
|
|
2099
2099
|
key: str = None
|
|
2100
|
-
) -> Path | dict:
|
|
2100
|
+
) -> Path | dict | None:
|
|
2101
2101
|
"""
|
|
2102
2102
|
Retrieve application path configuration values using dot notation.
|
|
2103
2103
|
|
|
@@ -84,8 +84,6 @@ class Chunked(BaseEntity):
|
|
|
84
84
|
self.level = self.level.value
|
|
85
85
|
elif isinstance(self.level, str):
|
|
86
86
|
self.level = Level[self.level.strip().upper()].value
|
|
87
|
-
elif isinstance(self.level, int):
|
|
88
|
-
self.level = self.level
|
|
89
87
|
|
|
90
88
|
# Validate 'mb_size'
|
|
91
89
|
if not isinstance(self.mb_size, int):
|
|
@@ -69,8 +69,6 @@ class Daily(BaseEntity):
|
|
|
69
69
|
self.level = self.level.value
|
|
70
70
|
elif isinstance(self.level, str):
|
|
71
71
|
self.level = Level[self.level.strip().upper()].value
|
|
72
|
-
elif isinstance(self.level, int):
|
|
73
|
-
self.level = self.level
|
|
74
72
|
|
|
75
73
|
# Validate 'retention_days'
|
|
76
74
|
if not isinstance(self.retention_days, int):
|
|
@@ -62,8 +62,6 @@ class Hourly(BaseEntity):
|
|
|
62
62
|
self.level = self.level.value
|
|
63
63
|
elif isinstance(self.level, str):
|
|
64
64
|
self.level = Level[self.level.strip().upper()].value
|
|
65
|
-
elif isinstance(self.level, int):
|
|
66
|
-
self.level = self.level
|
|
67
65
|
|
|
68
66
|
# Validate 'retention_hours'
|
|
69
67
|
if not isinstance(self.retention_hours, int) or self.retention_hours < 0:
|
|
@@ -61,8 +61,6 @@ class Monthly(BaseEntity):
|
|
|
61
61
|
self.level = self.level.value
|
|
62
62
|
elif isinstance(self.level, str):
|
|
63
63
|
self.level = Level[self.level.strip().upper()].value
|
|
64
|
-
elif isinstance(self.level, int):
|
|
65
|
-
self.level = self.level
|
|
66
64
|
|
|
67
65
|
# Validate 'retention_months'
|
|
68
66
|
if not isinstance(self.retention_months, int):
|
|
@@ -44,6 +44,4 @@ class Stack(BaseEntity):
|
|
|
44
44
|
if isinstance(self.level, Level):
|
|
45
45
|
self.level = self.level.value
|
|
46
46
|
elif isinstance(self.level, str):
|
|
47
|
-
self.level = Level[self.level.strip().upper()].value
|
|
48
|
-
elif isinstance(self.level, int):
|
|
49
|
-
self.level = self.level
|
|
47
|
+
self.level = Level[self.level.strip().upper()].value
|
|
@@ -63,8 +63,6 @@ class Weekly(BaseEntity):
|
|
|
63
63
|
self.level = self.level.value
|
|
64
64
|
elif isinstance(self.level, str):
|
|
65
65
|
self.level = Level[self.level.strip().upper()].value
|
|
66
|
-
elif isinstance(self.level, int):
|
|
67
|
-
self.level = self.level
|
|
68
66
|
|
|
69
67
|
# Validate 'retention_weeks'
|
|
70
68
|
if not isinstance(self.retention_weeks, int):
|
|
@@ -3,6 +3,8 @@ from typing import Optional
|
|
|
3
3
|
from orionis.foundation.exceptions import OrionisIntegrityException
|
|
4
4
|
from orionis.support.entities.base import BaseEntity
|
|
5
5
|
|
|
6
|
+
DEFAULT_SMTP_URL = "smtp.mailtrap.io"
|
|
7
|
+
|
|
6
8
|
@dataclass(unsafe_hash=True, kw_only=True)
|
|
7
9
|
class Smtp(BaseEntity):
|
|
8
10
|
"""
|
|
@@ -27,18 +29,18 @@ class Smtp(BaseEntity):
|
|
|
27
29
|
"""
|
|
28
30
|
|
|
29
31
|
url: str = field(
|
|
30
|
-
default =
|
|
32
|
+
default = DEFAULT_SMTP_URL,
|
|
31
33
|
metadata = {
|
|
32
34
|
"description": "The full URL for the SMTP service.",
|
|
33
|
-
"default":
|
|
35
|
+
"default": DEFAULT_SMTP_URL
|
|
34
36
|
}
|
|
35
37
|
)
|
|
36
38
|
|
|
37
39
|
host: str = field(
|
|
38
|
-
default =
|
|
40
|
+
default = DEFAULT_SMTP_URL,
|
|
39
41
|
metadata = {
|
|
40
42
|
"description": "The hostname of the SMTP server.",
|
|
41
|
-
"default":
|
|
43
|
+
"default": DEFAULT_SMTP_URL
|
|
42
44
|
}
|
|
43
45
|
)
|
|
44
46
|
|
|
@@ -75,7 +75,7 @@ class Database(BaseEntity):
|
|
|
75
75
|
# Validate `table` attribute
|
|
76
76
|
if not isinstance(self.table, str):
|
|
77
77
|
raise OrionisIntegrityException("The 'table' property must be a string.")
|
|
78
|
-
if not re.fullmatch(r'[a-z_]
|
|
78
|
+
if not re.fullmatch(r'[a-z_]+', self.table):
|
|
79
79
|
raise OrionisIntegrityException(
|
|
80
80
|
"The 'table' property must be a valid table name: start with a lowercase letter or underscore, contain only lowercase letters or underscores (no numbers allowed)."
|
|
81
81
|
)
|
orionis/metadata/framework.py
CHANGED
orionis/metadata/package.py
CHANGED
|
@@ -45,7 +45,7 @@ class PypiOrionisPackage:
|
|
|
45
45
|
The metadata is retrieved using the PyPI JSON API and stored in the `_info` attribute.
|
|
46
46
|
If the request fails, an exception will be raised during initialization.
|
|
47
47
|
"""
|
|
48
|
-
self.
|
|
48
|
+
self._base_url = API # Set the base URL for the PyPI API endpoint
|
|
49
49
|
self._info = {} # Initialize the dictionary to store package metadata
|
|
50
50
|
self.getAllData() # Fetch and populate metadata from PyPI
|
|
51
51
|
|
|
@@ -80,7 +80,7 @@ class PypiOrionisPackage:
|
|
|
80
80
|
"""
|
|
81
81
|
try:
|
|
82
82
|
# Send a GET request to the PyPI API endpoint
|
|
83
|
-
response = requests.get(self.
|
|
83
|
+
response = requests.get(self._base_url, timeout=10)
|
|
84
84
|
|
|
85
85
|
# Raise an error for non-200 status codes
|
|
86
86
|
response.raise_for_status()
|
|
@@ -101,14 +101,15 @@ class PypiOrionisPackage:
|
|
|
101
101
|
except requests.RequestException as e:
|
|
102
102
|
|
|
103
103
|
# Handle network or HTTP errors
|
|
104
|
-
raise
|
|
104
|
+
raise ConnectionError(
|
|
105
105
|
f"Error fetching data from PyPI: {e}. "
|
|
106
106
|
"Please check your internet connection or try again later."
|
|
107
107
|
)
|
|
108
|
+
|
|
108
109
|
except ValueError as ve:
|
|
109
110
|
|
|
110
111
|
# Handle invalid response structure
|
|
111
|
-
raise
|
|
112
|
+
raise ValueError(
|
|
112
113
|
f"Invalid response structure from PyPI: {ve}"
|
|
113
114
|
)
|
|
114
115
|
|
|
@@ -84,16 +84,6 @@ orionis/container/facades/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJW
|
|
|
84
84
|
orionis/container/facades/facade.py,sha256=c9V4ywJCdux1oluzVc7ph_8-TY2Nc85k3_UeQSBkiQY,3674
|
|
85
85
|
orionis/container/providers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
86
86
|
orionis/container/providers/service_provider.py,sha256=OlqmBIkZSDZHJ_JZvwhNiMMrn-GzeIoCgR-HdsqGOVM,2385
|
|
87
|
-
orionis/container/validators/__init__.py,sha256=iJ_cY8U0EkpnZOU4_LANGKHFkvHeV0vH5bjbYr1fdSg,609
|
|
88
|
-
orionis/container/validators/implements.py,sha256=6q6abRSXxpByIGGb_C5P3qGkvyX5zogOceFt9DPzUdI,3110
|
|
89
|
-
orionis/container/validators/is_abstract_class.py,sha256=vJqUPn610YZS0sEkV8c_gPZskIgWmFHjg3D3MF2OTs8,1141
|
|
90
|
-
orionis/container/validators/is_callable.py,sha256=ZW-e3ljJGXbD9GUEfPNqVcyBbpVHFlfYaTf9rSmJmBk,824
|
|
91
|
-
orionis/container/validators/is_concrete_class.py,sha256=CLStCMuf40amVLvg1x0utlUz64xJnp9guc8j50J95d8,1187
|
|
92
|
-
orionis/container/validators/is_instance.py,sha256=IkpSyd81jTc3WnmQyrh6TmQb-4suD38h03ckhjfrI90,971
|
|
93
|
-
orionis/container/validators/is_not_subclass.py,sha256=xq2NI-ZJjSAnq2C_tEOyncadY4i9vjj9Pa2MKVow3Ek,1149
|
|
94
|
-
orionis/container/validators/is_subclass.py,sha256=4sBaGLoRs8nUhuWjlP0VJqyTwVHYqIVB8zXVN-bYnBI,1117
|
|
95
|
-
orionis/container/validators/is_valid_alias.py,sha256=4uAYcq8xov7jZbXnpKpjNkxcZtlTNnL5RRctVPMwJes,1424
|
|
96
|
-
orionis/container/validators/lifetime.py,sha256=IQ43fDNrxYHMlZH2zlYDJnlkLO_eS4U7Fs3UJgQBidI,1844
|
|
97
87
|
orionis/failure/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
98
88
|
orionis/failure/catch.py,sha256=O6C_KsSPI-ZZb8upzwGagkJMhQ6FWX7J2q9BWweMgQE,3286
|
|
99
89
|
orionis/failure/base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -102,14 +92,14 @@ orionis/failure/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJW
|
|
|
102
92
|
orionis/failure/contracts/catch.py,sha256=me7o9QIliD6A62f1nTGjPapbULjhC1ZRh136s1HpF24,1193
|
|
103
93
|
orionis/failure/contracts/handler.py,sha256=AeJfkJfD3hTkOIYAtADq6GnQfq-qWgDfUc7bYMdYKAU,2240
|
|
104
94
|
orionis/failure/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
105
|
-
orionis/failure/entities/throwable.py,sha256=
|
|
95
|
+
orionis/failure/entities/throwable.py,sha256=FOMR5y9ARo4xAxxPa7ZlKVf4lS8eP56LmoASZFCyblU,1236
|
|
106
96
|
orionis/foundation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
107
|
-
orionis/foundation/application.py,sha256=
|
|
97
|
+
orionis/foundation/application.py,sha256=33Z6-0iT7pbZw74zHRV_z_6CLUO-huIfkd236zl0wP4,93824
|
|
108
98
|
orionis/foundation/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
109
|
-
orionis/foundation/config/startup.py,sha256=
|
|
99
|
+
orionis/foundation/config/startup.py,sha256=r9Zf3LjMmw3pvidiKgrUm9BDUYQIpCJTwPZkfLNVr_M,9691
|
|
110
100
|
orionis/foundation/config/app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
111
101
|
orionis/foundation/config/app/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
112
|
-
orionis/foundation/config/app/entities/app.py,sha256=
|
|
102
|
+
orionis/foundation/config/app/entities/app.py,sha256=kUqQDDG_d8K7_ou3pd9qlwZ7EdQ7zebrgZKL_MbydZM,10297
|
|
113
103
|
orionis/foundation/config/app/enums/__init__.py,sha256=L0csn3OmlPT4Y4WhTSI2uQRua0Z367MxNs12AcSHsV4,120
|
|
114
104
|
orionis/foundation/config/app/enums/ciphers.py,sha256=R3e9y18pyZNX49TiBQ2_N1TuuyRJouC3Vnk6kFD7daI,738
|
|
115
105
|
orionis/foundation/config/app/enums/environments.py,sha256=W81oUasW__nRDiyhScMfaBpQ65RXkAAvRGd4ShDFTvE,409
|
|
@@ -130,10 +120,10 @@ orionis/foundation/config/database/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQe
|
|
|
130
120
|
orionis/foundation/config/database/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
131
121
|
orionis/foundation/config/database/entities/connections.py,sha256=jouNerG3hueYsmyhtY3wsoZYA5MSgooXS-aHHsn0bac,3797
|
|
132
122
|
orionis/foundation/config/database/entities/database.py,sha256=S3BkRaNsnH-_AlOwtPayT2OO0JPO0BNXoDFG-xfHdKM,2668
|
|
133
|
-
orionis/foundation/config/database/entities/mysql.py,sha256=
|
|
134
|
-
orionis/foundation/config/database/entities/oracle.py,sha256=
|
|
135
|
-
orionis/foundation/config/database/entities/pgsql.py,sha256=
|
|
136
|
-
orionis/foundation/config/database/entities/sqlite.py,sha256=
|
|
123
|
+
orionis/foundation/config/database/entities/mysql.py,sha256=yFp_NSm9jAG9iAdycngRsciYWKQIXTiBSuqRL5HxeAw,10053
|
|
124
|
+
orionis/foundation/config/database/entities/oracle.py,sha256=0JcYeASM73V3M7H4odEVdeYJp4laOOdjguWdobRCrG0,9129
|
|
125
|
+
orionis/foundation/config/database/entities/pgsql.py,sha256=2KVck3oDcJLwJlW_j_33cJHY0FTJwR-m2r93pnG5tts,8017
|
|
126
|
+
orionis/foundation/config/database/entities/sqlite.py,sha256=g2ZoMVnImvS6TmlHMmjHD5GlzNh2gyXnp_Pvbc7owYs,7444
|
|
137
127
|
orionis/foundation/config/database/enums/__init__.py,sha256=wmlUMR0hNRBGZfrPGbPCDO_rpa7OF-2pEXkRnL5iMbM,992
|
|
138
128
|
orionis/foundation/config/database/enums/mysql_charsets.py,sha256=bK-pYPccYi9OKZ7a7SIyShtSwWlkCX2BwVaGBOp7oSo,2770
|
|
139
129
|
orionis/foundation/config/database/enums/mysql_collations.py,sha256=x908jTm68viR7FIa6tNjlmxP5xRI71pzVB60ZT-qqI0,2908
|
|
@@ -156,13 +146,13 @@ orionis/foundation/config/filesystems/entitites/public.py,sha256=bcgp7wOLse_D-_A
|
|
|
156
146
|
orionis/foundation/config/logging/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
157
147
|
orionis/foundation/config/logging/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
158
148
|
orionis/foundation/config/logging/entities/channels.py,sha256=-bguMcxirxwJl1qLtDbFkRcJ594MaH9bo8jYk-RC3Ec,4928
|
|
159
|
-
orionis/foundation/config/logging/entities/chunked.py,sha256=
|
|
160
|
-
orionis/foundation/config/logging/entities/daily.py,sha256=
|
|
161
|
-
orionis/foundation/config/logging/entities/hourly.py,sha256=
|
|
149
|
+
orionis/foundation/config/logging/entities/chunked.py,sha256=6EfjNxfEOkv9ze4T9MmW3-J4m0GSF5DcWUfAg54VOTw,3770
|
|
150
|
+
orionis/foundation/config/logging/entities/daily.py,sha256=ALiaN2OduSZQNO-FK-e76MCtUiKYFhKxO3_bON3odOs,3916
|
|
151
|
+
orionis/foundation/config/logging/entities/hourly.py,sha256=9BnwiqZR5yCsoyxgO1AYK6j-qgz8UaZbm8OJ-3nXVQo,2870
|
|
162
152
|
orionis/foundation/config/logging/entities/logging.py,sha256=Y6BZ1cnsKeeGUgK2zEMs0srFKI_AHBIghK58efZWj60,2569
|
|
163
|
-
orionis/foundation/config/logging/entities/monthly.py,sha256=
|
|
164
|
-
orionis/foundation/config/logging/entities/stack.py,sha256=
|
|
165
|
-
orionis/foundation/config/logging/entities/weekly.py,sha256=
|
|
153
|
+
orionis/foundation/config/logging/entities/monthly.py,sha256=2HC9yCabapw5V6kcuphOfrsAHVnQlpNiuVdao1cZKfA,2861
|
|
154
|
+
orionis/foundation/config/logging/entities/stack.py,sha256=LuzgrY3YAbgxuujhgLZBPRtBwdvH-6cx9o_VzMRC8bI,1654
|
|
155
|
+
orionis/foundation/config/logging/entities/weekly.py,sha256=LSvTVBnROZYuhHGAS3V1pK-tCzwzd7UcdIn3iZdXOoo,2805
|
|
166
156
|
orionis/foundation/config/logging/enums/__init__.py,sha256=QUTGa3iIds08ycR7d-Oqa11P07G-djFLGco9ziJjg0E,57
|
|
167
157
|
orionis/foundation/config/logging/enums/levels.py,sha256=9ELSmWnlaB14uqp5OsKXltsF5aVbxwdLQxYp8pjQAbk,872
|
|
168
158
|
orionis/foundation/config/logging/validators/__init__.py,sha256=ZJmPiObyJgbGCgFFz20Ryu4CX5z-cPW9ZWxirQrJoZ0,121
|
|
@@ -173,11 +163,11 @@ orionis/foundation/config/mail/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5J
|
|
|
173
163
|
orionis/foundation/config/mail/entities/file.py,sha256=U0M8QBX9PMaedbZwlOweeuUI6JnmVX2P4JTYYjdoY-c,1323
|
|
174
164
|
orionis/foundation/config/mail/entities/mail.py,sha256=wHztg5zn3Xz1aqhA0JuGti_K3BoMSPtnW1RFFTd47QY,2428
|
|
175
165
|
orionis/foundation/config/mail/entities/mailers.py,sha256=cEPKkft0soOYRTswPtfuvLM3NNQyJnUb28mBtuN-iBA,2406
|
|
176
|
-
orionis/foundation/config/mail/entities/smtp.py,sha256=
|
|
166
|
+
orionis/foundation/config/mail/entities/smtp.py,sha256=buj3w5rrP5c1T2QHN0WUYdWAD60cwTjUE1PYdttHG2I,4772
|
|
177
167
|
orionis/foundation/config/queue/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
178
168
|
orionis/foundation/config/queue/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
179
169
|
orionis/foundation/config/queue/entities/brokers.py,sha256=OV2wQDHcTm0JRDCAqCpETJ5Io_NetCIkSANec29ZteU,2046
|
|
180
|
-
orionis/foundation/config/queue/entities/database.py,sha256=
|
|
170
|
+
orionis/foundation/config/queue/entities/database.py,sha256=yN2laeQjJQ0-exItYUKcxy65qly5CNgwiC8C1Uraxyk,4829
|
|
181
171
|
orionis/foundation/config/queue/entities/queue.py,sha256=YiWPeEg5e0fd_DJM2ogska6RYU5kqr8YYjaq1ggMTMk,2239
|
|
182
172
|
orionis/foundation/config/queue/enums/__init__.py,sha256=oWY8GWwr5mex7szs_bLVqAS1jbyuIAvKl7XFGSlU9A0,64
|
|
183
173
|
orionis/foundation/config/queue/enums/strategy.py,sha256=S_kw7KZtoCk5FTOkbuXepdy_fOl9Eav4uT2K0OyzBa0,602
|
|
@@ -185,20 +175,20 @@ orionis/foundation/config/roots/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm
|
|
|
185
175
|
orionis/foundation/config/roots/paths.py,sha256=rn2134pdSZ8CrK7haYZy_NitA09JZvcf1bkUtC5qP84,6964
|
|
186
176
|
orionis/foundation/config/session/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
187
177
|
orionis/foundation/config/session/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
188
|
-
orionis/foundation/config/session/entities/session.py,sha256=
|
|
178
|
+
orionis/foundation/config/session/entities/session.py,sha256=UgkgX9LvJyatIlosiu5rnAHTfQgsFP8lW-dVcbDxvko,6096
|
|
189
179
|
orionis/foundation/config/session/enums/__init__.py,sha256=bvjCUkQbSfKB0J8V1BwOHSjOyZn6xhOmamH3urhoKCA,84
|
|
190
180
|
orionis/foundation/config/session/enums/same_site_policy.py,sha256=Oo05CJ-5keJWzfflylodyBquofsXqThQPcnar2-ChCw,645
|
|
191
181
|
orionis/foundation/config/session/helpers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
192
182
|
orionis/foundation/config/session/helpers/secret_key.py,sha256=yafjzQ9KVQdXzCQCMthpgizlNCo5F5UTLtAnInipUMk,447
|
|
193
183
|
orionis/foundation/config/testing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
194
184
|
orionis/foundation/config/testing/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
195
|
-
orionis/foundation/config/testing/entities/testing.py,sha256=
|
|
185
|
+
orionis/foundation/config/testing/entities/testing.py,sha256=b7ODA3hBB1y4V_rX4sdHAR2ypsGpT9JJ7dJLDeLLiNQ,11597
|
|
196
186
|
orionis/foundation/config/testing/enums/__init__.py,sha256=aFh5kBxlh5kqHK-9W7qgdykF5-qou5SVRzorRBazqYw,196
|
|
197
187
|
orionis/foundation/config/testing/enums/drivers.py,sha256=mwv47FcKDXEOxydQXAGtkdIY9S6qCAW1cD22oCFy3xw,355
|
|
198
188
|
orionis/foundation/config/testing/enums/mode.py,sha256=IbFpauu7J-iSAfmC8jDbmTEYl8eZr-AexL-lyOh8_74,337
|
|
199
189
|
orionis/foundation/config/testing/enums/verbosity.py,sha256=Z-FQ6C3rxbRwP8HoVibbgRMGcsen2SwTuEy3wnjdIhc,486
|
|
200
190
|
orionis/foundation/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
201
|
-
orionis/foundation/contracts/application.py,sha256=
|
|
191
|
+
orionis/foundation/contracts/application.py,sha256=APxfwRiGhDfwMElcTWEXu-g9h3LSS0FiMTz2AbR5MNM,47894
|
|
202
192
|
orionis/foundation/exceptions/__init__.py,sha256=ufomZK6am2-QAaj9peXW549xy_qflcbwj0ECuZz-1Kc,263
|
|
203
193
|
orionis/foundation/exceptions/application.py,sha256=jeNToFG7msej2Ow6A7Zqj7cNLoI4NVpN2b5fdbhOiCI,1638
|
|
204
194
|
orionis/foundation/providers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -217,8 +207,8 @@ orionis/foundation/providers/scheduler_provider.py,sha256=IrPQJwvQVLRm5Qnz0Cxon4
|
|
|
217
207
|
orionis/foundation/providers/testing_provider.py,sha256=eI1p2lUlxl25b5Z487O4nmqLE31CTDb4c3Q21xFadkE,1615
|
|
218
208
|
orionis/foundation/providers/workers_provider.py,sha256=GdHENYV_yGyqmHJHn0DCyWmWId5xWjD48e6Zq2PGCWY,1674
|
|
219
209
|
orionis/metadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
220
|
-
orionis/metadata/framework.py,sha256=
|
|
221
|
-
orionis/metadata/package.py,sha256=
|
|
210
|
+
orionis/metadata/framework.py,sha256=HS7-j97OokocN3ha_-53BM4uNnfQseTtovS4gW3HutE,4089
|
|
211
|
+
orionis/metadata/package.py,sha256=s1JeGJPwdVh4jO3IOfmpwMuJ_oX6Vf9NL7jgPEQNf5Y,16050
|
|
222
212
|
orionis/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
223
213
|
orionis/services/asynchrony/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
224
214
|
orionis/services/asynchrony/coroutines.py,sha256=M1o4Al5dk8BR85CWHHUgymVQaD_6PgirenQMeITUoZQ,6863
|
|
@@ -404,8 +394,8 @@ orionis/test/validators/workers.py,sha256=rWcdRexINNEmGaO7mnc1MKUxkHKxrTsVuHgbnI
|
|
|
404
394
|
orionis/test/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
405
395
|
orionis/test/view/render.py,sha256=R55ykeRs0wDKcdTf4O1YZ8GDHTFmJ0IK6VQkbJkYUvo,5571
|
|
406
396
|
orionis/test/view/report.stub,sha256=QLqqCdRoENr3ECiritRB3DO_MOjRQvgBh5jxZ3Hs1r0,28189
|
|
407
|
-
orionis-0.
|
|
408
|
-
orionis-0.
|
|
409
|
-
orionis-0.
|
|
410
|
-
orionis-0.
|
|
411
|
-
orionis-0.
|
|
397
|
+
orionis-0.665.0.dist-info/licenses/LICENCE,sha256=JhC-z_9mbpUrCfPjcl3DhDA8trNDMzb57cvRSam1avc,1463
|
|
398
|
+
orionis-0.665.0.dist-info/METADATA,sha256=vVZ-n40guEps4IOFK7ter_-7a2FRU86htofwU41Lkx4,4772
|
|
399
|
+
orionis-0.665.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
400
|
+
orionis-0.665.0.dist-info/top_level.txt,sha256=lyXi6jArpqJ-0zzNqd_uwsH-z9TCEBVBL-pC3Ekv7hU,8
|
|
401
|
+
orionis-0.665.0.dist-info/RECORD,,
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
from .implements import ImplementsAbstractMethods
|
|
2
|
-
from .is_abstract_class import IsAbstractClass
|
|
3
|
-
from .is_concrete_class import IsConcreteClass
|
|
4
|
-
from .is_instance import IsInstance
|
|
5
|
-
from .is_callable import IsCallable
|
|
6
|
-
from .is_subclass import IsSubclass
|
|
7
|
-
from .is_not_subclass import IsNotSubclass
|
|
8
|
-
from .is_valid_alias import IsValidAlias
|
|
9
|
-
from .lifetime import LifetimeValidator
|
|
10
|
-
|
|
11
|
-
__all__ = [
|
|
12
|
-
"ImplementsAbstractMethods",
|
|
13
|
-
"IsAbstractClass",
|
|
14
|
-
"IsConcreteClass",
|
|
15
|
-
"IsInstance",
|
|
16
|
-
"IsCallable",
|
|
17
|
-
"IsSubclass",
|
|
18
|
-
"IsNotSubclass",
|
|
19
|
-
"IsValidAlias",
|
|
20
|
-
"LifetimeValidator",
|
|
21
|
-
]
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
from typing import Callable, Any
|
|
2
|
-
from orionis.services.introspection.objects.types import Type
|
|
3
|
-
from orionis.container.exceptions import OrionisContainerException
|
|
4
|
-
|
|
5
|
-
class __ImplementsAbstractMethods:
|
|
6
|
-
"""
|
|
7
|
-
Validator that ensures a concrete class or instance implements all abstract methods of an abstract class.
|
|
8
|
-
"""
|
|
9
|
-
|
|
10
|
-
def __call__(
|
|
11
|
-
self,
|
|
12
|
-
*,
|
|
13
|
-
abstract: Callable[..., Any] = None,
|
|
14
|
-
concrete: Callable[..., Any] = None,
|
|
15
|
-
instance: Any = None
|
|
16
|
-
) -> None:
|
|
17
|
-
"""
|
|
18
|
-
Validates that a concrete class or instance implements all abstract methods defined in an abstract class.
|
|
19
|
-
|
|
20
|
-
Parameters
|
|
21
|
-
----------
|
|
22
|
-
abstract : Callable[..., Any]
|
|
23
|
-
The abstract base class.
|
|
24
|
-
concrete : Callable[..., Any], optional
|
|
25
|
-
The class expected to implement the abstract methods.
|
|
26
|
-
instance : Any, optional
|
|
27
|
-
The instance expected to implement the abstract methods.
|
|
28
|
-
|
|
29
|
-
Raises
|
|
30
|
-
------
|
|
31
|
-
OrionisContainerException
|
|
32
|
-
If any abstract method is not implemented.
|
|
33
|
-
"""
|
|
34
|
-
|
|
35
|
-
# Validate that the abstract class is provided
|
|
36
|
-
if abstract is None:
|
|
37
|
-
raise OrionisContainerException("Abstract class must be provided for implementation check.")
|
|
38
|
-
|
|
39
|
-
# Check if the abstract class has abstract methods
|
|
40
|
-
abstract_methods = getattr(abstract, '__abstractmethods__', set())
|
|
41
|
-
if not abstract_methods:
|
|
42
|
-
raise OrionisContainerException(
|
|
43
|
-
f"The abstract class '{abstract.__name__}' does not define any abstract methods. "
|
|
44
|
-
"An abstract class must have at least one abstract method."
|
|
45
|
-
)
|
|
46
|
-
|
|
47
|
-
# Determine the target class or instance to check
|
|
48
|
-
target = concrete if concrete is not None else instance
|
|
49
|
-
if target is None:
|
|
50
|
-
raise OrionisContainerException("Either concrete class or instance must be provided for implementation check.")
|
|
51
|
-
|
|
52
|
-
# Validate that the target is a class or instance
|
|
53
|
-
target_class = target if Type(target).isClass() else target.__class__
|
|
54
|
-
target_name = target_class.__name__
|
|
55
|
-
abstract_name = abstract.__name__
|
|
56
|
-
|
|
57
|
-
# Check if the target class implements all abstract methods
|
|
58
|
-
not_implemented = []
|
|
59
|
-
for method in abstract_methods:
|
|
60
|
-
expected_method = str(method).replace(f"_{abstract_name}", f"_{target_name}")
|
|
61
|
-
if expected_method not in target_class.__dict__:
|
|
62
|
-
not_implemented.append(method)
|
|
63
|
-
|
|
64
|
-
# If any abstract methods are not implemented, raise an exception
|
|
65
|
-
if not_implemented:
|
|
66
|
-
formatted = "\n • " + "\n • ".join(not_implemented)
|
|
67
|
-
raise OrionisContainerException(
|
|
68
|
-
f"'{target_name}' does not implement the following abstract methods defined in '{abstract_name}':{formatted}\n"
|
|
69
|
-
"Please ensure that all abstract methods are implemented."
|
|
70
|
-
)
|
|
71
|
-
|
|
72
|
-
# Exported singleton instance
|
|
73
|
-
ImplementsAbstractMethods = __ImplementsAbstractMethods()
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
from typing import Callable, Any
|
|
2
|
-
from orionis.services.introspection.abstract.reflection import ReflectionAbstract
|
|
3
|
-
from orionis.container.exceptions import OrionisContainerTypeError
|
|
4
|
-
|
|
5
|
-
class __IsAbstractClass:
|
|
6
|
-
"""
|
|
7
|
-
Validator that ensures a class is an abstract class.
|
|
8
|
-
"""
|
|
9
|
-
|
|
10
|
-
def __call__(self, abstract: Callable[..., Any], lifetime: str) -> None:
|
|
11
|
-
"""
|
|
12
|
-
Ensures that the provided class is an abstract class.
|
|
13
|
-
|
|
14
|
-
Parameters
|
|
15
|
-
----------
|
|
16
|
-
abstract : Callable[..., Any]
|
|
17
|
-
The class intended to represent the abstract type.
|
|
18
|
-
lifetime : str
|
|
19
|
-
A string indicating the service lifetime, used in error messages.
|
|
20
|
-
|
|
21
|
-
Raises
|
|
22
|
-
------
|
|
23
|
-
OrionisContainerTypeError
|
|
24
|
-
If the class is not abstract.
|
|
25
|
-
"""
|
|
26
|
-
try:
|
|
27
|
-
ReflectionAbstract.ensureIsAbstractClass(abstract)
|
|
28
|
-
except Exception as e:
|
|
29
|
-
raise OrionisContainerTypeError(
|
|
30
|
-
f"Unexpected error registering {lifetime} service: {e}"
|
|
31
|
-
) from e
|
|
32
|
-
|
|
33
|
-
# Exported singleton instance
|
|
34
|
-
IsAbstractClass = __IsAbstractClass()
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
from typing import Any
|
|
2
|
-
from orionis.container.exceptions import OrionisContainerTypeError
|
|
3
|
-
|
|
4
|
-
class __IsCallable:
|
|
5
|
-
"""
|
|
6
|
-
Validator that checks if a value is callable.
|
|
7
|
-
Can be used directly like a function: `IsCallable(value)`
|
|
8
|
-
"""
|
|
9
|
-
|
|
10
|
-
def __call__(self, value: Any) -> None:
|
|
11
|
-
"""
|
|
12
|
-
Ensures that the provided value is callable.
|
|
13
|
-
|
|
14
|
-
Parameters
|
|
15
|
-
----------
|
|
16
|
-
value : Any
|
|
17
|
-
The value to check.
|
|
18
|
-
|
|
19
|
-
Raises
|
|
20
|
-
------
|
|
21
|
-
OrionisContainerTypeError
|
|
22
|
-
If the value is not callable.
|
|
23
|
-
"""
|
|
24
|
-
if not callable(value):
|
|
25
|
-
raise OrionisContainerTypeError(
|
|
26
|
-
f"Expected a callable type, but got {type(value).__name__} instead."
|
|
27
|
-
)
|
|
28
|
-
|
|
29
|
-
# Exported singleton instance
|
|
30
|
-
IsCallable = __IsCallable()
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
from typing import Callable, Any
|
|
2
|
-
from orionis.services.introspection.concretes.reflection import ReflectionConcrete
|
|
3
|
-
from orionis.container.exceptions import OrionisContainerTypeError
|
|
4
|
-
|
|
5
|
-
class __IsConcreteClass:
|
|
6
|
-
"""
|
|
7
|
-
Validator that ensures a class is a concrete (non-abstract) class.
|
|
8
|
-
"""
|
|
9
|
-
|
|
10
|
-
def __call__(self, concrete: Callable[..., Any], lifetime: str) -> None:
|
|
11
|
-
"""
|
|
12
|
-
Ensures that the provided class is a concrete (non-abstract) class.
|
|
13
|
-
|
|
14
|
-
Parameters
|
|
15
|
-
----------
|
|
16
|
-
concrete : Callable[..., Any]
|
|
17
|
-
The class intended to represent the concrete implementation.
|
|
18
|
-
lifetime : str
|
|
19
|
-
A string indicating the service lifetime, used in error messages.
|
|
20
|
-
|
|
21
|
-
Raises
|
|
22
|
-
------
|
|
23
|
-
OrionisContainerTypeError
|
|
24
|
-
If the class is abstract or invalid.
|
|
25
|
-
"""
|
|
26
|
-
try:
|
|
27
|
-
ReflectionConcrete.ensureIsConcreteClass(concrete)
|
|
28
|
-
except Exception as e:
|
|
29
|
-
raise OrionisContainerTypeError(
|
|
30
|
-
f"Unexpected error registering {lifetime} service: {e}"
|
|
31
|
-
) from e
|
|
32
|
-
|
|
33
|
-
# Exported singleton instance
|
|
34
|
-
IsConcreteClass = __IsConcreteClass()
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
from typing import Any
|
|
2
|
-
from orionis.services.introspection.instances.reflection import ReflectionInstance
|
|
3
|
-
from orionis.container.exceptions import OrionisContainerTypeError
|
|
4
|
-
|
|
5
|
-
class __IsInstance:
|
|
6
|
-
"""
|
|
7
|
-
Validator that ensures the provided object is a valid instance (not a class or abstract type).
|
|
8
|
-
"""
|
|
9
|
-
|
|
10
|
-
def __call__(self, instance: Any) -> None:
|
|
11
|
-
"""
|
|
12
|
-
Ensures that the provided object is a valid instance.
|
|
13
|
-
|
|
14
|
-
Parameters
|
|
15
|
-
----------
|
|
16
|
-
instance : Any
|
|
17
|
-
The object to be validated.
|
|
18
|
-
|
|
19
|
-
Raises
|
|
20
|
-
------
|
|
21
|
-
OrionisContainerTypeError
|
|
22
|
-
If the object is not a valid instance.
|
|
23
|
-
"""
|
|
24
|
-
try:
|
|
25
|
-
ReflectionInstance.ensureIsInstance(instance)
|
|
26
|
-
except Exception as e:
|
|
27
|
-
raise OrionisContainerTypeError(
|
|
28
|
-
f"Error registering instance: {e}"
|
|
29
|
-
) from e
|
|
30
|
-
|
|
31
|
-
# Exported singleton instance
|
|
32
|
-
IsInstance = __IsInstance()
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
from typing import Callable
|
|
2
|
-
from orionis.container.exceptions import OrionisContainerException
|
|
3
|
-
|
|
4
|
-
class __IsNotSubclass:
|
|
5
|
-
"""
|
|
6
|
-
Validator that ensures a class is NOT a subclass of another class.
|
|
7
|
-
"""
|
|
8
|
-
|
|
9
|
-
def __call__(self, abstract: Callable[..., any], concrete: Callable[..., any]) -> None:
|
|
10
|
-
"""
|
|
11
|
-
Validates that the concrete class is NOT a subclass of the abstract class.
|
|
12
|
-
|
|
13
|
-
Parameters
|
|
14
|
-
----------
|
|
15
|
-
abstract : Callable[..., Any]
|
|
16
|
-
The supposed base class or interface.
|
|
17
|
-
concrete : Callable[..., Any]
|
|
18
|
-
The implementation class to check.
|
|
19
|
-
|
|
20
|
-
Raises
|
|
21
|
-
------
|
|
22
|
-
OrionisContainerException
|
|
23
|
-
If the concrete class IS a subclass of the abstract class.
|
|
24
|
-
"""
|
|
25
|
-
if issubclass(concrete, abstract):
|
|
26
|
-
raise OrionisContainerException(
|
|
27
|
-
"The concrete class must NOT inherit from the provided abstract class. "
|
|
28
|
-
"Please ensure that the concrete class is not a subclass of the specified abstract class."
|
|
29
|
-
)
|
|
30
|
-
|
|
31
|
-
# Exported singleton instance
|
|
32
|
-
IsNotSubclass = __IsNotSubclass()
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
from typing import Callable
|
|
2
|
-
from orionis.container.exceptions import OrionisContainerException
|
|
3
|
-
|
|
4
|
-
class __IsSubclass:
|
|
5
|
-
"""
|
|
6
|
-
Validator that ensures a class is a subclass of a given abstract class.
|
|
7
|
-
"""
|
|
8
|
-
|
|
9
|
-
def __call__(self, abstract: Callable[..., any], concrete: Callable[..., any]) -> None:
|
|
10
|
-
"""
|
|
11
|
-
Validates that the concrete class is a subclass of the abstract class.
|
|
12
|
-
|
|
13
|
-
Parameters
|
|
14
|
-
----------
|
|
15
|
-
abstract : Callable[..., Any]
|
|
16
|
-
The base or abstract class.
|
|
17
|
-
concrete : Callable[..., Any]
|
|
18
|
-
The class to verify.
|
|
19
|
-
|
|
20
|
-
Raises
|
|
21
|
-
------
|
|
22
|
-
OrionisContainerException
|
|
23
|
-
If the concrete class is NOT a subclass of the abstract class.
|
|
24
|
-
"""
|
|
25
|
-
if not issubclass(concrete, abstract):
|
|
26
|
-
raise OrionisContainerException(
|
|
27
|
-
"The concrete class must inherit from the provided abstract class. "
|
|
28
|
-
"Please ensure that the concrete class is a subclass of the specified abstract class."
|
|
29
|
-
)
|
|
30
|
-
|
|
31
|
-
# Exported singleton instance
|
|
32
|
-
IsSubclass = __IsSubclass()
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
from typing import Any
|
|
2
|
-
from orionis.container.exceptions import OrionisContainerTypeError
|
|
3
|
-
|
|
4
|
-
class __IsValidAlias:
|
|
5
|
-
"""
|
|
6
|
-
Validator that checks if a value is a valid alias string.
|
|
7
|
-
"""
|
|
8
|
-
|
|
9
|
-
_INVALID_CHARS = set(' \t\n\r\x0b\x0c!@#$%^&*()[]{};:,/<>?\\|`~"\'')
|
|
10
|
-
|
|
11
|
-
def __call__(self, value: Any) -> None:
|
|
12
|
-
"""
|
|
13
|
-
Ensures that the provided value is a valid alias of type str and does not contain invalid characters.
|
|
14
|
-
|
|
15
|
-
Parameters
|
|
16
|
-
----------
|
|
17
|
-
value : Any
|
|
18
|
-
The value to check.
|
|
19
|
-
|
|
20
|
-
Raises
|
|
21
|
-
------
|
|
22
|
-
OrionisContainerTypeError
|
|
23
|
-
If the value is not of type str or contains invalid characters.
|
|
24
|
-
"""
|
|
25
|
-
if value is None or value == "" or str(value).isspace():
|
|
26
|
-
raise OrionisContainerTypeError(
|
|
27
|
-
"Alias cannot be None, empty, or whitespace only."
|
|
28
|
-
)
|
|
29
|
-
|
|
30
|
-
if not isinstance(value, str):
|
|
31
|
-
raise OrionisContainerTypeError(
|
|
32
|
-
f"Expected a string type for alias, but got {type(value).__name__} instead."
|
|
33
|
-
)
|
|
34
|
-
|
|
35
|
-
if any(char in self._INVALID_CHARS for char in value):
|
|
36
|
-
raise OrionisContainerTypeError(
|
|
37
|
-
f"Alias '{value}' contains invalid characters. "
|
|
38
|
-
"Aliases must not contain whitespace or special symbols."
|
|
39
|
-
)
|
|
40
|
-
|
|
41
|
-
# Exported singleton instance
|
|
42
|
-
IsValidAlias = __IsValidAlias()
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
from typing import Any, Union
|
|
2
|
-
from orionis.container.enums.lifetimes import Lifetime
|
|
3
|
-
from orionis.container.exceptions import OrionisContainerTypeError
|
|
4
|
-
|
|
5
|
-
class __LifetimeValidator:
|
|
6
|
-
"""
|
|
7
|
-
Validator that checks if a value is a valid lifetime and converts string representations
|
|
8
|
-
to Lifetime enum values.
|
|
9
|
-
"""
|
|
10
|
-
|
|
11
|
-
def __call__(self, lifetime: Union[str, Lifetime, Any]) -> Lifetime:
|
|
12
|
-
"""
|
|
13
|
-
Validates and normalizes the provided lifetime value.
|
|
14
|
-
|
|
15
|
-
Parameters
|
|
16
|
-
----------
|
|
17
|
-
lifetime : Union[str, Lifetime, Any]
|
|
18
|
-
The lifetime value to validate. Can be a Lifetime enum or a string
|
|
19
|
-
representing a valid lifetime.
|
|
20
|
-
|
|
21
|
-
Returns
|
|
22
|
-
-------
|
|
23
|
-
Lifetime
|
|
24
|
-
The validated Lifetime enum value.
|
|
25
|
-
|
|
26
|
-
Raises
|
|
27
|
-
------
|
|
28
|
-
OrionisContainerTypeError
|
|
29
|
-
If the value is not a valid Lifetime enum or string representation,
|
|
30
|
-
or if the string doesn't match any valid Lifetime value.
|
|
31
|
-
"""
|
|
32
|
-
# Already a Lifetime enum
|
|
33
|
-
if isinstance(lifetime, Lifetime):
|
|
34
|
-
return lifetime
|
|
35
|
-
|
|
36
|
-
# String that might represent a Lifetime
|
|
37
|
-
if isinstance(lifetime, str):
|
|
38
|
-
lifetime_key = lifetime.strip().upper()
|
|
39
|
-
if lifetime_key in Lifetime.__members__:
|
|
40
|
-
return Lifetime[lifetime_key]
|
|
41
|
-
|
|
42
|
-
valid_options = ', '.join(Lifetime.__members__.keys())
|
|
43
|
-
raise OrionisContainerTypeError(
|
|
44
|
-
f"Invalid lifetime '{lifetime}'. Valid options are: {valid_options}."
|
|
45
|
-
)
|
|
46
|
-
|
|
47
|
-
# Invalid type
|
|
48
|
-
raise OrionisContainerTypeError(
|
|
49
|
-
f"Lifetime must be of type str or Lifetime enum, got {type(lifetime).__name__}."
|
|
50
|
-
)
|
|
51
|
-
|
|
52
|
-
# Exported singleton instance
|
|
53
|
-
LifetimeValidator = __LifetimeValidator()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|