orionis 0.420.0__py3-none-any.whl → 0.422.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/__init__.py +0 -11
- orionis/foundation/config/app/entities/app.py +15 -14
- orionis/foundation/config/cache/entities/cache.py +2 -1
- orionis/foundation/config/cache/entities/file.py +1 -0
- orionis/foundation/config/cache/entities/stores.py +1 -0
- orionis/foundation/config/cors/entities/cors.py +1 -0
- orionis/foundation/config/database/entities/connections.py +5 -4
- orionis/foundation/config/database/entities/database.py +3 -2
- orionis/foundation/config/database/entities/mysql.py +7 -6
- orionis/foundation/config/database/entities/oracle.py +11 -10
- orionis/foundation/config/database/entities/pgsql.py +7 -6
- orionis/foundation/config/database/entities/sqlite.py +8 -7
- orionis/foundation/config/filesystems/entitites/aws.py +1 -0
- orionis/foundation/config/filesystems/entitites/disks.py +4 -3
- orionis/foundation/config/filesystems/entitites/filesystems.py +2 -1
- orionis/foundation/config/filesystems/entitites/local.py +1 -0
- orionis/foundation/config/filesystems/entitites/public.py +1 -0
- orionis/foundation/config/logging/entities/channels.py +7 -6
- orionis/foundation/config/logging/entities/chunked.py +1 -0
- orionis/foundation/config/logging/entities/daily.py +3 -2
- orionis/foundation/config/logging/entities/hourly.py +1 -0
- orionis/foundation/config/logging/entities/logging.py +2 -1
- orionis/foundation/config/logging/entities/monthly.py +1 -0
- orionis/foundation/config/logging/entities/stack.py +1 -0
- orionis/foundation/config/logging/entities/weekly.py +1 -0
- orionis/foundation/config/mail/entities/mail.py +1 -1
- orionis/foundation/config/mail/entities/mailers.py +2 -2
- orionis/foundation/config/queue/entities/brokers.py +2 -1
- orionis/foundation/config/queue/entities/database.py +1 -0
- orionis/foundation/config/queue/entities/queue.py +2 -1
- orionis/foundation/config/roots/paths.py +63 -62
- orionis/foundation/config/session/entities/session.py +9 -8
- orionis/foundation/config/startup.py +13 -12
- orionis/foundation/config/testing/entities/testing.py +2 -1
- orionis/metadata/framework.py +1 -1
- orionis/services/environment/contracts/{types.py → caster.py} +1 -29
- orionis/services/environment/core/dot_env.py +230 -142
- orionis/services/environment/dynamic/caster.py +902 -0
- orionis/services/environment/enums/{cast_type.py → value_type.py} +11 -10
- orionis/services/environment/key/key_generator.py +7 -15
- orionis/services/environment/validators/types.py +10 -10
- orionis/support/entities/base.py +25 -0
- {orionis-0.420.0.dist-info → orionis-0.422.0.dist-info}/METADATA +1 -1
- {orionis-0.420.0.dist-info → orionis-0.422.0.dist-info}/RECORD +49 -51
- tests/foundation/config/root/test_foundation_config_root_paths.py +4 -1
- orionis/services/environment/dynamic/types.py +0 -577
- orionis/services/environment/serializer/__init__.py +0 -0
- orionis/services/environment/serializer/values.py +0 -21
- {orionis-0.420.0.dist-info → orionis-0.422.0.dist-info}/WHEEL +0 -0
- {orionis-0.420.0.dist-info → orionis-0.422.0.dist-info}/licenses/LICENCE +0 -0
- {orionis-0.420.0.dist-info → orionis-0.422.0.dist-info}/top_level.txt +0 -0
- {orionis-0.420.0.dist-info → orionis-0.422.0.dist-info}/zip-safe +0 -0
orionis/__init__.py
CHANGED
|
@@ -47,7 +47,7 @@ class App(BaseEntity):
|
|
|
47
47
|
"""
|
|
48
48
|
|
|
49
49
|
name: str = field(
|
|
50
|
-
|
|
50
|
+
default_factory = lambda: Env.get('APP_NAME', 'Orionis Application'),
|
|
51
51
|
metadata = {
|
|
52
52
|
"description": "The name of the application. Defaults to 'Orionis Application'.",
|
|
53
53
|
"default": 'Orionis Application'
|
|
@@ -55,7 +55,7 @@ class App(BaseEntity):
|
|
|
55
55
|
)
|
|
56
56
|
|
|
57
57
|
env: str | Environments = field(
|
|
58
|
-
|
|
58
|
+
default_factory = lambda: Env.get('APP_ENV', Environments.DEVELOPMENT.value),
|
|
59
59
|
metadata = {
|
|
60
60
|
"description": "The environment in which the application is running. Defaults to 'DEVELOPMENT'.",
|
|
61
61
|
"default": Environments.DEVELOPMENT.value
|
|
@@ -63,7 +63,7 @@ class App(BaseEntity):
|
|
|
63
63
|
)
|
|
64
64
|
|
|
65
65
|
debug: bool = field(
|
|
66
|
-
|
|
66
|
+
default_factory = lambda: Env.get('APP_DEBUG', True),
|
|
67
67
|
metadata = {
|
|
68
68
|
"description": "Flag indicating whether debug mode is enabled. Defaults to False.",
|
|
69
69
|
"default": True
|
|
@@ -71,7 +71,7 @@ class App(BaseEntity):
|
|
|
71
71
|
)
|
|
72
72
|
|
|
73
73
|
url: str = field(
|
|
74
|
-
|
|
74
|
+
default_factory = lambda: Env.get('APP_URL', 'http://127.0.0.1'),
|
|
75
75
|
metadata = {
|
|
76
76
|
"description": "The base URL of the application. Defaults to 'http://127.0.0.1'.",
|
|
77
77
|
"default": 'http://127.0.0.1'
|
|
@@ -79,7 +79,7 @@ class App(BaseEntity):
|
|
|
79
79
|
)
|
|
80
80
|
|
|
81
81
|
port: int = field(
|
|
82
|
-
|
|
82
|
+
default_factory = lambda: Env.get('APP_PORT', 8000),
|
|
83
83
|
metadata = {
|
|
84
84
|
"description": "The port on which the application will run. Defaults to 8000.",
|
|
85
85
|
"default": 8000
|
|
@@ -87,15 +87,15 @@ class App(BaseEntity):
|
|
|
87
87
|
)
|
|
88
88
|
|
|
89
89
|
workers: int = field(
|
|
90
|
-
|
|
90
|
+
default_factory = lambda: Env.get('APP_WORKERS', Workers().calculate()),
|
|
91
91
|
metadata = {
|
|
92
92
|
"description": "The number of worker processes to handle requests. Defaults to the maximum available workers.",
|
|
93
|
-
"default": Workers().calculate()
|
|
93
|
+
"default": lambda: Workers().calculate()
|
|
94
94
|
}
|
|
95
95
|
)
|
|
96
96
|
|
|
97
97
|
reload: bool = field(
|
|
98
|
-
|
|
98
|
+
default_factory = lambda: Env.get('APP_RELOAD', True),
|
|
99
99
|
metadata = {
|
|
100
100
|
"description": "Flag indicating whether the application should reload on code changes. Defaults to True.",
|
|
101
101
|
"default": True
|
|
@@ -103,7 +103,7 @@ class App(BaseEntity):
|
|
|
103
103
|
)
|
|
104
104
|
|
|
105
105
|
timezone: str = field(
|
|
106
|
-
|
|
106
|
+
default_factory = lambda: Env.get('APP_TIMEZONE', 'UTC'),
|
|
107
107
|
metadata = {
|
|
108
108
|
"description": "The timezone of the application. Defaults to 'UTC'.",
|
|
109
109
|
"default": 'UTC'
|
|
@@ -111,7 +111,7 @@ class App(BaseEntity):
|
|
|
111
111
|
)
|
|
112
112
|
|
|
113
113
|
locale: str = field(
|
|
114
|
-
|
|
114
|
+
default_factory = lambda: Env.get('APP_LOCALE', 'en'),
|
|
115
115
|
metadata = {
|
|
116
116
|
"description": "The locale for the application. Defaults to 'en'.",
|
|
117
117
|
"default": 'en'
|
|
@@ -119,7 +119,7 @@ class App(BaseEntity):
|
|
|
119
119
|
)
|
|
120
120
|
|
|
121
121
|
fallback_locale: str = field(
|
|
122
|
-
|
|
122
|
+
default_factory = lambda: Env.get('APP_FALLBACK_LOCALE', 'en'),
|
|
123
123
|
metadata = {
|
|
124
124
|
"description": "The fallback locale for the application. Defaults to 'en'.",
|
|
125
125
|
"default": 'en'
|
|
@@ -127,7 +127,7 @@ class App(BaseEntity):
|
|
|
127
127
|
)
|
|
128
128
|
|
|
129
129
|
cipher: str | Cipher = field(
|
|
130
|
-
|
|
130
|
+
default_factory = lambda: Env.get('APP_CIPHER', Cipher.AES_256_CBC.value),
|
|
131
131
|
metadata = {
|
|
132
132
|
"description": "The cipher used for encryption. Defaults to 'AES_256_CBC'.",
|
|
133
133
|
"default": Cipher.AES_256_CBC.value
|
|
@@ -135,7 +135,7 @@ class App(BaseEntity):
|
|
|
135
135
|
)
|
|
136
136
|
|
|
137
137
|
key: str = field(
|
|
138
|
-
|
|
138
|
+
default_factory = lambda: Env.get('APP_KEY'),
|
|
139
139
|
metadata = {
|
|
140
140
|
"description": "The encryption key for the application. Defaults to None.",
|
|
141
141
|
"default": None
|
|
@@ -143,7 +143,7 @@ class App(BaseEntity):
|
|
|
143
143
|
)
|
|
144
144
|
|
|
145
145
|
maintenance: str = field(
|
|
146
|
-
|
|
146
|
+
default_factory = lambda: Env.get('APP_MAINTENANCE', '/maintenance'),
|
|
147
147
|
metadata = {
|
|
148
148
|
"description": "The maintenance configuration for the application. Defaults to '/maintenance'.",
|
|
149
149
|
"default": '/maintenance'
|
|
@@ -151,6 +151,7 @@ class App(BaseEntity):
|
|
|
151
151
|
)
|
|
152
152
|
|
|
153
153
|
def __post_init__(self):
|
|
154
|
+
super().__post_init__()
|
|
154
155
|
"""
|
|
155
156
|
Validate and normalize attributes after dataclass initialization.
|
|
156
157
|
|
|
@@ -24,7 +24,7 @@ class Cache(BaseEntity):
|
|
|
24
24
|
"""
|
|
25
25
|
|
|
26
26
|
default: Drivers | str = field(
|
|
27
|
-
default_factory = lambda : Env.get("CACHE_STORE", Drivers.MEMORY),
|
|
27
|
+
default_factory = lambda : Env.get("CACHE_STORE", Drivers.MEMORY.value),
|
|
28
28
|
metadata = {
|
|
29
29
|
"description": "The default cache storage type. Can be a member of the Drivers enum or a string (e.g., 'memory', 'file').",
|
|
30
30
|
"default": Drivers.MEMORY.value
|
|
@@ -40,6 +40,7 @@ class Cache(BaseEntity):
|
|
|
40
40
|
)
|
|
41
41
|
|
|
42
42
|
def __post_init__(self):
|
|
43
|
+
super().__post_init__()
|
|
43
44
|
"""
|
|
44
45
|
Post-initialization method for validating and normalizing cache configuration.
|
|
45
46
|
|
|
@@ -26,7 +26,7 @@ class Connections(BaseEntity):
|
|
|
26
26
|
default_factory = lambda: SQLite(),
|
|
27
27
|
metadata = {
|
|
28
28
|
"description": "SQLite database connection configuration",
|
|
29
|
-
"default": SQLite().toDict()
|
|
29
|
+
"default": lambda: SQLite().toDict()
|
|
30
30
|
}
|
|
31
31
|
)
|
|
32
32
|
|
|
@@ -34,7 +34,7 @@ class Connections(BaseEntity):
|
|
|
34
34
|
default_factory = lambda: MySQL(),
|
|
35
35
|
metadata = {
|
|
36
36
|
"description": "MySQL database connection configuration",
|
|
37
|
-
"default": MySQL().toDict()
|
|
37
|
+
"default": lambda: MySQL().toDict()
|
|
38
38
|
}
|
|
39
39
|
)
|
|
40
40
|
|
|
@@ -42,7 +42,7 @@ class Connections(BaseEntity):
|
|
|
42
42
|
default_factory = lambda: PGSQL(),
|
|
43
43
|
metadata = {
|
|
44
44
|
"description": "PostgreSQL database connection configuration",
|
|
45
|
-
"default": PGSQL().toDict()
|
|
45
|
+
"default": lambda: PGSQL().toDict()
|
|
46
46
|
}
|
|
47
47
|
)
|
|
48
48
|
|
|
@@ -50,11 +50,12 @@ class Connections(BaseEntity):
|
|
|
50
50
|
default_factory = lambda: Oracle(),
|
|
51
51
|
metadata = {
|
|
52
52
|
"description": "Oracle database connection configuration",
|
|
53
|
-
"default": Oracle().toDict()
|
|
53
|
+
"default": lambda: Oracle().toDict()
|
|
54
54
|
}
|
|
55
55
|
)
|
|
56
56
|
|
|
57
57
|
def __post_init__(self):
|
|
58
|
+
super().__post_init__()
|
|
58
59
|
"""
|
|
59
60
|
Post-initialization method to validate the types of database connection attributes.
|
|
60
61
|
Ensures that the attributes `sqlite`, `mysql`, `pgsql`, and `oracle` are instances of their respective classes.
|
|
@@ -17,7 +17,7 @@ class Database(BaseEntity):
|
|
|
17
17
|
The different database connections available to the application.
|
|
18
18
|
"""
|
|
19
19
|
default: str = field(
|
|
20
|
-
|
|
20
|
+
default_factory = lambda: Env.get("DB_CONNECTION", "sqlite"),
|
|
21
21
|
metadata={
|
|
22
22
|
"description": "Default database connection name",
|
|
23
23
|
"default": "sqlite"
|
|
@@ -28,11 +28,12 @@ class Database(BaseEntity):
|
|
|
28
28
|
default_factory = lambda: Connections(),
|
|
29
29
|
metadata={
|
|
30
30
|
"description": "Database connections",
|
|
31
|
-
"default": Connections().toDict()
|
|
31
|
+
"default": lambda: Connections().toDict()
|
|
32
32
|
}
|
|
33
33
|
)
|
|
34
34
|
|
|
35
35
|
def __post_init__(self):
|
|
36
|
+
super().__post_init__()
|
|
36
37
|
"""
|
|
37
38
|
Post-initialization method for validating and normalizing the 'default' and 'connections' attributes.
|
|
38
39
|
Validates that the 'default' attribute is either a valid string corresponding to a member of DatabaseConnections
|
|
@@ -53,7 +53,7 @@ class MySQL(BaseEntity):
|
|
|
53
53
|
)
|
|
54
54
|
|
|
55
55
|
host: str = field(
|
|
56
|
-
|
|
56
|
+
default_factory = lambda: Env.get("DB_HOST", "127.0.0.1"),
|
|
57
57
|
metadata = {
|
|
58
58
|
"description": "The host address for the MySQL server.",
|
|
59
59
|
"default": "127.0.0.1"
|
|
@@ -61,7 +61,7 @@ class MySQL(BaseEntity):
|
|
|
61
61
|
)
|
|
62
62
|
|
|
63
63
|
port: int = field(
|
|
64
|
-
|
|
64
|
+
default_factory = lambda: Env.get("DB_PORT", 3306),
|
|
65
65
|
metadata = {
|
|
66
66
|
"description": "The port for connecting to the MySQL server.",
|
|
67
67
|
"default": 3306
|
|
@@ -69,7 +69,7 @@ class MySQL(BaseEntity):
|
|
|
69
69
|
)
|
|
70
70
|
|
|
71
71
|
database: str = field(
|
|
72
|
-
|
|
72
|
+
default_factory = lambda: Env.get("DB_DATABASE", "orionis"),
|
|
73
73
|
metadata = {
|
|
74
74
|
"description": "The name of the MySQL database.",
|
|
75
75
|
"default": "orionis"
|
|
@@ -77,7 +77,7 @@ class MySQL(BaseEntity):
|
|
|
77
77
|
)
|
|
78
78
|
|
|
79
79
|
username: str = field(
|
|
80
|
-
|
|
80
|
+
default_factory = lambda: Env.get("DB_USERNAME", "root"),
|
|
81
81
|
metadata = {
|
|
82
82
|
"description": "The username for connecting to the MySQL database.",
|
|
83
83
|
"default": "root"
|
|
@@ -85,7 +85,7 @@ class MySQL(BaseEntity):
|
|
|
85
85
|
)
|
|
86
86
|
|
|
87
87
|
password: str = field(
|
|
88
|
-
|
|
88
|
+
default_factory = lambda: Env.get("DB_PASSWORD", ""),
|
|
89
89
|
metadata = {
|
|
90
90
|
"description": "The password for the MySQL database.",
|
|
91
91
|
"default": ""
|
|
@@ -93,7 +93,7 @@ class MySQL(BaseEntity):
|
|
|
93
93
|
)
|
|
94
94
|
|
|
95
95
|
unix_socket: str = field(
|
|
96
|
-
|
|
96
|
+
default_factory = lambda: Env.get("DB_SOCKET", ""),
|
|
97
97
|
metadata = {
|
|
98
98
|
"description": "The path to the Unix socket for MySQL connections (optional).",
|
|
99
99
|
"default": ""
|
|
@@ -149,6 +149,7 @@ class MySQL(BaseEntity):
|
|
|
149
149
|
)
|
|
150
150
|
|
|
151
151
|
def __post_init__(self):
|
|
152
|
+
super().__post_init__()
|
|
152
153
|
"""
|
|
153
154
|
Post-initialization validation for MySQL database entity configuration.
|
|
154
155
|
This method performs comprehensive validation on the instance attributes to ensure
|
|
@@ -46,7 +46,7 @@ class Oracle(BaseEntity):
|
|
|
46
46
|
)
|
|
47
47
|
|
|
48
48
|
username: str = field(
|
|
49
|
-
|
|
49
|
+
default_factory = lambda: Env.get("DB_USERNAME", "sys"),
|
|
50
50
|
metadata = {
|
|
51
51
|
"description": "Oracle DB username.",
|
|
52
52
|
"default": "sys"
|
|
@@ -54,7 +54,7 @@ class Oracle(BaseEntity):
|
|
|
54
54
|
)
|
|
55
55
|
|
|
56
56
|
password: str = field(
|
|
57
|
-
|
|
57
|
+
default_factory = lambda: Env.get("DB_PASSWORD", ""),
|
|
58
58
|
metadata = {
|
|
59
59
|
"description": "Oracle DB password.",
|
|
60
60
|
"default": ""
|
|
@@ -62,7 +62,7 @@ class Oracle(BaseEntity):
|
|
|
62
62
|
)
|
|
63
63
|
|
|
64
64
|
host: str = field(
|
|
65
|
-
|
|
65
|
+
default_factory = lambda: Env.get("DB_HOST", "localhost"),
|
|
66
66
|
metadata = {
|
|
67
67
|
"description": "Oracle DB host address.",
|
|
68
68
|
"default": "localhost"
|
|
@@ -70,7 +70,7 @@ class Oracle(BaseEntity):
|
|
|
70
70
|
)
|
|
71
71
|
|
|
72
72
|
port: int = field(
|
|
73
|
-
|
|
73
|
+
default_factory = lambda: Env.get("DB_PORT", 1521),
|
|
74
74
|
metadata = {
|
|
75
75
|
"description": "Oracle DB listener port.",
|
|
76
76
|
"default": 1521
|
|
@@ -78,7 +78,7 @@ class Oracle(BaseEntity):
|
|
|
78
78
|
)
|
|
79
79
|
|
|
80
80
|
service_name: Optional[str] = field(
|
|
81
|
-
|
|
81
|
+
default_factory = lambda: Env.get("DB_SERVICE_NAME", "ORCL"),
|
|
82
82
|
metadata = {
|
|
83
83
|
"description": "Service name for Oracle DB.",
|
|
84
84
|
"default": "ORCL"
|
|
@@ -86,7 +86,7 @@ class Oracle(BaseEntity):
|
|
|
86
86
|
)
|
|
87
87
|
|
|
88
88
|
sid: Optional[str] = field(
|
|
89
|
-
|
|
89
|
+
default_factory = lambda: Env.get("DB_SID", None),
|
|
90
90
|
metadata = {
|
|
91
91
|
"description": "SID for Oracle DB.",
|
|
92
92
|
"default": None
|
|
@@ -94,7 +94,7 @@ class Oracle(BaseEntity):
|
|
|
94
94
|
)
|
|
95
95
|
|
|
96
96
|
dsn: Optional[str] = field(
|
|
97
|
-
|
|
97
|
+
default_factory = lambda: Env.get("DB_DSN", None),
|
|
98
98
|
metadata = {
|
|
99
99
|
"description": "DSN string (overrides host/port/service/sid).",
|
|
100
100
|
"default": None
|
|
@@ -102,7 +102,7 @@ class Oracle(BaseEntity):
|
|
|
102
102
|
)
|
|
103
103
|
|
|
104
104
|
tns_name: Optional[str] = field(
|
|
105
|
-
|
|
105
|
+
default_factory = lambda: Env.get("DB_TNS", None),
|
|
106
106
|
metadata = {
|
|
107
107
|
"description": "TNS alias defined in tnsnames.ora file.",
|
|
108
108
|
"default": None
|
|
@@ -110,7 +110,7 @@ class Oracle(BaseEntity):
|
|
|
110
110
|
)
|
|
111
111
|
|
|
112
112
|
encoding: str | OracleEncoding = field(
|
|
113
|
-
|
|
113
|
+
default_factory = lambda: Env.get("DB_ENCODING", OracleEncoding.AL32UTF8.value),
|
|
114
114
|
metadata = {
|
|
115
115
|
"description": "Database charset (CHAR/VARCHAR2)",
|
|
116
116
|
"default": OracleEncoding.AL32UTF8.value
|
|
@@ -118,7 +118,7 @@ class Oracle(BaseEntity):
|
|
|
118
118
|
)
|
|
119
119
|
|
|
120
120
|
nencoding: str | OracleNencoding = field(
|
|
121
|
-
|
|
121
|
+
default_factory = lambda: Env.get("DB_NENCODING", OracleNencoding.AL32UTF8.value),
|
|
122
122
|
metadata = {
|
|
123
123
|
"description": "Database charset (NCHAR/NVARCHAR2)",
|
|
124
124
|
"default": OracleNencoding.AL32UTF8.value
|
|
@@ -126,6 +126,7 @@ class Oracle(BaseEntity):
|
|
|
126
126
|
)
|
|
127
127
|
|
|
128
128
|
def __post_init__(self):
|
|
129
|
+
super().__post_init__()
|
|
129
130
|
"""
|
|
130
131
|
Post-initialization validation for Oracle database connection entity.
|
|
131
132
|
This method performs strict validation on the configuration fields required to establish
|
|
@@ -35,7 +35,7 @@ class PGSQL(BaseEntity):
|
|
|
35
35
|
)
|
|
36
36
|
|
|
37
37
|
host: str = field(
|
|
38
|
-
|
|
38
|
+
default_factory = lambda: Env.get("DB_HOST", "127.0.0.1"),
|
|
39
39
|
metadata = {
|
|
40
40
|
"description": "Database host",
|
|
41
41
|
"default": "127.0.0.1"
|
|
@@ -43,7 +43,7 @@ class PGSQL(BaseEntity):
|
|
|
43
43
|
)
|
|
44
44
|
|
|
45
45
|
port: str | int = field(
|
|
46
|
-
|
|
46
|
+
default_factory = lambda: Env.get("DB_PORT", 5432),
|
|
47
47
|
metadata = {
|
|
48
48
|
"description": "Database port",
|
|
49
49
|
"default": 5432
|
|
@@ -51,7 +51,7 @@ class PGSQL(BaseEntity):
|
|
|
51
51
|
)
|
|
52
52
|
|
|
53
53
|
database: str = field(
|
|
54
|
-
|
|
54
|
+
default_factory = lambda: Env.get("DB_DATABASE", "orionis"),
|
|
55
55
|
metadata = {
|
|
56
56
|
"description": "Database name",
|
|
57
57
|
"default": "orionis"
|
|
@@ -59,7 +59,7 @@ class PGSQL(BaseEntity):
|
|
|
59
59
|
)
|
|
60
60
|
|
|
61
61
|
username: str = field(
|
|
62
|
-
|
|
62
|
+
default_factory = lambda: Env.get("DB_USERNAME", "postgres"),
|
|
63
63
|
metadata = {
|
|
64
64
|
"description": "Database user",
|
|
65
65
|
"default": "postgres"
|
|
@@ -67,7 +67,7 @@ class PGSQL(BaseEntity):
|
|
|
67
67
|
)
|
|
68
68
|
|
|
69
69
|
password: str = field(
|
|
70
|
-
|
|
70
|
+
default_factory = lambda: Env.get("DB_PASSWORD", ""),
|
|
71
71
|
metadata = {
|
|
72
72
|
"description": "Database password",
|
|
73
73
|
"default": ""
|
|
@@ -75,7 +75,7 @@ class PGSQL(BaseEntity):
|
|
|
75
75
|
)
|
|
76
76
|
|
|
77
77
|
charset: str | PGSQLCharset = field(
|
|
78
|
-
|
|
78
|
+
default_factory = lambda: Env.get("DB_CHARSET", PGSQLCharset.UTF8.value),
|
|
79
79
|
metadata = {
|
|
80
80
|
"description": "Database charset",
|
|
81
81
|
"default": PGSQLCharset.UTF8.value
|
|
@@ -115,6 +115,7 @@ class PGSQL(BaseEntity):
|
|
|
115
115
|
)
|
|
116
116
|
|
|
117
117
|
def __post_init__(self):
|
|
118
|
+
super().__post_init__()
|
|
118
119
|
"""
|
|
119
120
|
Validates the initialization of the database entity attributes after object creation.
|
|
120
121
|
|
|
@@ -42,7 +42,7 @@ class SQLite(BaseEntity):
|
|
|
42
42
|
)
|
|
43
43
|
|
|
44
44
|
url: str = field(
|
|
45
|
-
|
|
45
|
+
default_factory = lambda: Env.get('DB_URL', 'sqlite:///' + Env.get('DB_DATABASE', 'database/database.sqlite')),
|
|
46
46
|
metadata = {
|
|
47
47
|
"description": "The URL for connecting to the database.",
|
|
48
48
|
"example": "sqlite:///database/database.sqlite",
|
|
@@ -50,7 +50,7 @@ class SQLite(BaseEntity):
|
|
|
50
50
|
)
|
|
51
51
|
|
|
52
52
|
database: str = field(
|
|
53
|
-
|
|
53
|
+
default_factory = lambda: Env.get('DB_DATABASE', 'database.sqlite'),
|
|
54
54
|
metadata = {
|
|
55
55
|
"description": "The path to the SQLite database file.",
|
|
56
56
|
"example": "database.sqlite",
|
|
@@ -58,7 +58,7 @@ class SQLite(BaseEntity):
|
|
|
58
58
|
)
|
|
59
59
|
|
|
60
60
|
prefix: str = field(
|
|
61
|
-
|
|
61
|
+
default_factory = lambda: Env.get('DB_PREFIX', ''),
|
|
62
62
|
metadata = {
|
|
63
63
|
"description": "Prefix for table names.",
|
|
64
64
|
"example": "",
|
|
@@ -66,7 +66,7 @@ class SQLite(BaseEntity):
|
|
|
66
66
|
)
|
|
67
67
|
|
|
68
68
|
foreign_key_constraints: bool | SQLiteForeignKey = field(
|
|
69
|
-
|
|
69
|
+
default_factory = lambda: Env.get('DB_FOREIGN_KEYS', SQLiteForeignKey.OFF.value),
|
|
70
70
|
metadata = {
|
|
71
71
|
"description": "Whether foreign key constraints are enabled.",
|
|
72
72
|
"example": SQLiteForeignKey.OFF.value
|
|
@@ -74,7 +74,7 @@ class SQLite(BaseEntity):
|
|
|
74
74
|
)
|
|
75
75
|
|
|
76
76
|
busy_timeout: int = field(
|
|
77
|
-
|
|
77
|
+
default_factory = lambda: Env.get('DB_BUSY_TIMEOUT', 5000),
|
|
78
78
|
metadata = {
|
|
79
79
|
"description": "The timeout period (in milliseconds) before retrying a locked database.",
|
|
80
80
|
"example": 5000
|
|
@@ -82,7 +82,7 @@ class SQLite(BaseEntity):
|
|
|
82
82
|
)
|
|
83
83
|
|
|
84
84
|
journal_mode: str | SQLiteJournalMode = field(
|
|
85
|
-
|
|
85
|
+
default_factory = lambda: Env.get('DB_JOURNAL_MODE', SQLiteJournalMode.DELETE.value),
|
|
86
86
|
metadata = {
|
|
87
87
|
"description": "The journal mode used for transactions.",
|
|
88
88
|
"example": SQLiteJournalMode.DELETE.value
|
|
@@ -90,7 +90,7 @@ class SQLite(BaseEntity):
|
|
|
90
90
|
)
|
|
91
91
|
|
|
92
92
|
synchronous: str | SQLiteSynchronous = field(
|
|
93
|
-
|
|
93
|
+
default_factory = lambda: Env.get('DB_SYNCHRONOUS', SQLiteSynchronous.NORMAL.value),
|
|
94
94
|
metadata = {
|
|
95
95
|
"description": "The synchronization level for the database.",
|
|
96
96
|
"example": SQLiteSynchronous.NORMAL.value
|
|
@@ -98,6 +98,7 @@ class SQLite(BaseEntity):
|
|
|
98
98
|
)
|
|
99
99
|
|
|
100
100
|
def __post_init__(self):
|
|
101
|
+
super().__post_init__()
|
|
101
102
|
"""
|
|
102
103
|
Post-initialization validation for SQLite database configuration fields.
|
|
103
104
|
|
|
@@ -23,7 +23,7 @@ class Disks(BaseEntity):
|
|
|
23
23
|
default_factory = lambda: Local(),
|
|
24
24
|
metadata={
|
|
25
25
|
"description": "The absolute or relative path where local files are stored.",
|
|
26
|
-
"default": Local().toDict()
|
|
26
|
+
"default": lambda: Local().toDict()
|
|
27
27
|
}
|
|
28
28
|
)
|
|
29
29
|
|
|
@@ -31,7 +31,7 @@ class Disks(BaseEntity):
|
|
|
31
31
|
default_factory = lambda: Public(),
|
|
32
32
|
metadata={
|
|
33
33
|
"description": "The absolute or relative path where public files are stored.",
|
|
34
|
-
"default": Public().toDict()
|
|
34
|
+
"default": lambda: Public().toDict()
|
|
35
35
|
}
|
|
36
36
|
)
|
|
37
37
|
|
|
@@ -39,11 +39,12 @@ class Disks(BaseEntity):
|
|
|
39
39
|
default_factory = lambda: S3(),
|
|
40
40
|
metadata={
|
|
41
41
|
"description": "The configuration for AWS S3 storage.",
|
|
42
|
-
"default": S3().toDict()
|
|
42
|
+
"default": lambda: S3().toDict()
|
|
43
43
|
}
|
|
44
44
|
)
|
|
45
45
|
|
|
46
46
|
def __post_init__(self):
|
|
47
|
+
super().__post_init__()
|
|
47
48
|
"""
|
|
48
49
|
Post-initialization method to ensure the 'path' attribute is a non-empty Path object.
|
|
49
50
|
- Converts 'path' to a Path instance if it is not already.
|
|
@@ -28,11 +28,12 @@ class Filesystems(BaseEntity):
|
|
|
28
28
|
default_factory = lambda: Disks(),
|
|
29
29
|
metadata={
|
|
30
30
|
"description": "A collection of available filesystem disks.",
|
|
31
|
-
"default": Disks().toDict()
|
|
31
|
+
"default": lambda: Disks().toDict()
|
|
32
32
|
}
|
|
33
33
|
)
|
|
34
34
|
|
|
35
35
|
def __post_init__(self):
|
|
36
|
+
super().__post_init__()
|
|
36
37
|
"""
|
|
37
38
|
Validates the types of the attributes after initialization.
|
|
38
39
|
"""
|
|
@@ -18,7 +18,7 @@ class Channels(BaseEntity):
|
|
|
18
18
|
default_factory = lambda: Stack(),
|
|
19
19
|
metadata = {
|
|
20
20
|
"description": "Configuration for stack log channel.",
|
|
21
|
-
"default": Stack().toDict()
|
|
21
|
+
"default": lambda: Stack().toDict()
|
|
22
22
|
}
|
|
23
23
|
)
|
|
24
24
|
|
|
@@ -26,7 +26,7 @@ class Channels(BaseEntity):
|
|
|
26
26
|
default_factory = lambda: Hourly(),
|
|
27
27
|
metadata = {
|
|
28
28
|
"description": "Configuration for hourly log rotation.",
|
|
29
|
-
"default": Hourly().toDict()
|
|
29
|
+
"default": lambda: Hourly().toDict()
|
|
30
30
|
}
|
|
31
31
|
)
|
|
32
32
|
|
|
@@ -34,7 +34,7 @@ class Channels(BaseEntity):
|
|
|
34
34
|
default_factory = lambda: Daily(),
|
|
35
35
|
metadata = {
|
|
36
36
|
"description": "Configuration for daily log rotation.",
|
|
37
|
-
"default": Daily().toDict()
|
|
37
|
+
"default": lambda: Daily().toDict()
|
|
38
38
|
}
|
|
39
39
|
)
|
|
40
40
|
|
|
@@ -42,7 +42,7 @@ class Channels(BaseEntity):
|
|
|
42
42
|
default_factory = lambda: Weekly(),
|
|
43
43
|
metadata = {
|
|
44
44
|
"description": "Configuration for weekly log rotation.",
|
|
45
|
-
"default": Weekly().toDict()
|
|
45
|
+
"default": lambda: Weekly().toDict()
|
|
46
46
|
}
|
|
47
47
|
)
|
|
48
48
|
|
|
@@ -50,7 +50,7 @@ class Channels(BaseEntity):
|
|
|
50
50
|
default_factory = lambda: Monthly(),
|
|
51
51
|
metadata = {
|
|
52
52
|
"description": "Configuration for monthly log rotation.",
|
|
53
|
-
"default": Monthly().toDict()
|
|
53
|
+
"default": lambda: Monthly().toDict()
|
|
54
54
|
}
|
|
55
55
|
)
|
|
56
56
|
|
|
@@ -58,11 +58,12 @@ class Channels(BaseEntity):
|
|
|
58
58
|
default_factory = lambda: Chunked(),
|
|
59
59
|
metadata = {
|
|
60
60
|
"description": "Configuration for chunked log file storage.",
|
|
61
|
-
"default": Chunked().toDict()
|
|
61
|
+
"default": lambda: Chunked().toDict()
|
|
62
62
|
}
|
|
63
63
|
)
|
|
64
64
|
|
|
65
65
|
def __post_init__(self):
|
|
66
|
+
super().__post_init__()
|
|
66
67
|
"""
|
|
67
68
|
Post-initialization method to validate the types of log rotation properties.
|
|
68
69
|
Ensures that the following instance attributes are of the correct types:
|