orionis 0.582.0__py3-none-any.whl → 0.584.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/console/core/reactor.py +4 -18
- orionis/container/facades/facade.py +2 -3
- orionis/foundation/application.py +181 -319
- orionis/foundation/config/roots/paths.py +56 -151
- orionis/foundation/contracts/application.py +742 -401
- orionis/metadata/framework.py +1 -1
- orionis/services/file/contracts/directory.py +43 -199
- orionis/services/file/directory.py +58 -197
- {orionis-0.582.0.dist-info → orionis-0.584.0.dist-info}/METADATA +1 -1
- {orionis-0.582.0.dist-info → orionis-0.584.0.dist-info}/RECORD +13 -14
- orionis/app.py +0 -17
- {orionis-0.582.0.dist-info → orionis-0.584.0.dist-info}/WHEEL +0 -0
- {orionis-0.582.0.dist-info → orionis-0.584.0.dist-info}/licenses/LICENCE +0 -0
- {orionis-0.582.0.dist-info → orionis-0.584.0.dist-info}/top_level.txt +0 -0
@@ -14,35 +14,35 @@ class Paths(BaseEntity):
|
|
14
14
|
}
|
15
15
|
)
|
16
16
|
|
17
|
-
|
18
|
-
default_factory = lambda: str((Path.cwd() / 'app'
|
17
|
+
app: str = field(
|
18
|
+
default_factory = lambda: str((Path.cwd() / 'app').resolve()),
|
19
19
|
metadata = {
|
20
|
-
'description': '
|
21
|
-
'default': lambda: str((Path.cwd() / 'app'
|
20
|
+
'description': 'The main application directory containing core code.',
|
21
|
+
'default': lambda: str((Path.cwd() / 'app').resolve())
|
22
22
|
}
|
23
23
|
)
|
24
24
|
|
25
|
-
|
26
|
-
default_factory = lambda: str((Path.cwd() / 'app' / '
|
25
|
+
console: str = field(
|
26
|
+
default_factory = lambda: str((Path.cwd() / 'app' / 'console').resolve()),
|
27
27
|
metadata = {
|
28
|
-
'description': 'Directory containing
|
29
|
-
'default': lambda: str((Path.cwd() / 'app' / '
|
28
|
+
'description': 'Directory containing subfolders for console commands and scheduler.py.',
|
29
|
+
'default': lambda: str((Path.cwd() / 'app' / 'console').resolve())
|
30
30
|
}
|
31
31
|
)
|
32
32
|
|
33
|
-
|
34
|
-
default_factory = lambda: str((Path.cwd() / 'app' / '
|
33
|
+
exceptions: str = field(
|
34
|
+
default_factory = lambda: str((Path.cwd() / 'app' / 'exceptions').resolve()),
|
35
35
|
metadata = {
|
36
|
-
'description': 'Directory containing
|
37
|
-
'default': lambda: str((Path.cwd() / 'app' / '
|
36
|
+
'description': 'Directory containing exception handler classes.',
|
37
|
+
'default': lambda: str((Path.cwd() / 'app' / 'exceptions').resolve())
|
38
38
|
}
|
39
39
|
)
|
40
40
|
|
41
|
-
|
42
|
-
default_factory = lambda: str((Path.cwd() / 'app' / 'http'
|
41
|
+
http: str = field(
|
42
|
+
default_factory = lambda: str((Path.cwd() / 'app' / 'http').resolve()),
|
43
43
|
metadata = {
|
44
|
-
'description': 'Directory containing HTTP
|
45
|
-
'default': lambda: str((Path.cwd() / 'app' / 'http'
|
44
|
+
'description': 'Directory containing HTTP-related classes (controllers, middleware, requests).',
|
45
|
+
'default': lambda: str((Path.cwd() / 'app' / 'http').resolve())
|
46
46
|
}
|
47
47
|
)
|
48
48
|
|
@@ -62,22 +62,6 @@ class Paths(BaseEntity):
|
|
62
62
|
}
|
63
63
|
)
|
64
64
|
|
65
|
-
events: str = field(
|
66
|
-
default_factory = lambda: str((Path.cwd() / 'app' / 'events').resolve()),
|
67
|
-
metadata = {
|
68
|
-
'description': 'Directory containing event classes.',
|
69
|
-
'default': lambda: str((Path.cwd() / 'app' / 'events').resolve())
|
70
|
-
}
|
71
|
-
)
|
72
|
-
|
73
|
-
listeners: str = field(
|
74
|
-
default_factory = lambda: str((Path.cwd() / 'app' / 'listeners').resolve()),
|
75
|
-
metadata = {
|
76
|
-
'description': 'Directory containing event listener classes.',
|
77
|
-
'default': lambda: str((Path.cwd() / 'app' / 'listeners').resolve())
|
78
|
-
}
|
79
|
-
)
|
80
|
-
|
81
65
|
notifications: str = field(
|
82
66
|
default_factory = lambda: str((Path.cwd() / 'app' / 'notifications').resolve()),
|
83
67
|
metadata = {
|
@@ -86,30 +70,6 @@ class Paths(BaseEntity):
|
|
86
70
|
}
|
87
71
|
)
|
88
72
|
|
89
|
-
jobs: str = field(
|
90
|
-
default_factory = lambda: str((Path.cwd() / 'app' / 'jobs').resolve()),
|
91
|
-
metadata = {
|
92
|
-
'description': 'Directory containing queued job classes.',
|
93
|
-
'default': lambda: str((Path.cwd() / 'app' / 'jobs').resolve())
|
94
|
-
}
|
95
|
-
)
|
96
|
-
|
97
|
-
policies: str = field(
|
98
|
-
default_factory = lambda: str((Path.cwd() / 'app' / 'policies').resolve()),
|
99
|
-
metadata = {
|
100
|
-
'description': 'Directory containing authorization policy classes.',
|
101
|
-
'default': lambda: str((Path.cwd() / 'app' / 'policies').resolve())
|
102
|
-
}
|
103
|
-
)
|
104
|
-
|
105
|
-
exceptions: str = field(
|
106
|
-
default_factory = lambda: str((Path.cwd() / 'app' / 'exceptions').resolve()),
|
107
|
-
metadata = {
|
108
|
-
'description': 'Directory containing exception handler classes.',
|
109
|
-
'default': lambda: str((Path.cwd() / 'app' / 'exceptions').resolve())
|
110
|
-
}
|
111
|
-
)
|
112
|
-
|
113
73
|
services: str = field(
|
114
74
|
default_factory = lambda: str((Path.cwd() / 'app' / 'services').resolve()),
|
115
75
|
metadata = {
|
@@ -118,35 +78,19 @@ class Paths(BaseEntity):
|
|
118
78
|
}
|
119
79
|
)
|
120
80
|
|
121
|
-
|
122
|
-
default_factory = lambda: str((Path.cwd() / '
|
123
|
-
metadata = {
|
124
|
-
'description': 'Directory containing template view files.',
|
125
|
-
'default': lambda: str((Path.cwd() / 'resources' / 'views').resolve())
|
126
|
-
}
|
127
|
-
)
|
128
|
-
|
129
|
-
lang: str = field(
|
130
|
-
default_factory = lambda: str((Path.cwd() / 'resources' / 'lang').resolve()),
|
131
|
-
metadata = {
|
132
|
-
'description': 'Directory containing internationalization files.',
|
133
|
-
'default': lambda: str((Path.cwd() / 'resources' / 'lang').resolve())
|
134
|
-
}
|
135
|
-
)
|
136
|
-
|
137
|
-
assets: str = field(
|
138
|
-
default_factory = lambda: str((Path.cwd() / 'resources' / 'assets').resolve()),
|
81
|
+
jobs: str = field(
|
82
|
+
default_factory = lambda: str((Path.cwd() / 'app' / 'jobs').resolve()),
|
139
83
|
metadata = {
|
140
|
-
'description': 'Directory containing
|
141
|
-
'default': lambda: str((Path.cwd() / '
|
84
|
+
'description': 'Directory containing queued job classes.',
|
85
|
+
'default': lambda: str((Path.cwd() / 'app' / 'jobs').resolve())
|
142
86
|
}
|
143
87
|
)
|
144
88
|
|
145
|
-
|
146
|
-
default_factory = lambda: str((Path.cwd() / '
|
89
|
+
bootstrap: str = field(
|
90
|
+
default_factory = lambda: str((Path.cwd() / 'app' / 'bootstrap').resolve()),
|
147
91
|
metadata = {
|
148
|
-
'description': '
|
149
|
-
'default': lambda: str((Path.cwd() / '
|
92
|
+
'description': 'Directory containing application bootstrap files.',
|
93
|
+
'default': lambda: str((Path.cwd() / 'app' / 'bootstrap').resolve())
|
150
94
|
}
|
151
95
|
)
|
152
96
|
|
@@ -158,75 +102,27 @@ class Paths(BaseEntity):
|
|
158
102
|
}
|
159
103
|
)
|
160
104
|
|
161
|
-
|
162
|
-
default_factory = lambda: str((Path.cwd() / 'database' / '
|
163
|
-
metadata = {
|
164
|
-
'description': 'Directory containing database migration files.',
|
165
|
-
'default': lambda: str((Path.cwd() / 'database' / 'migrations').resolve())
|
166
|
-
}
|
167
|
-
)
|
168
|
-
|
169
|
-
seeders: str = field(
|
170
|
-
default_factory = lambda: str((Path.cwd() / 'database' / 'seeders').resolve()),
|
171
|
-
metadata = {
|
172
|
-
'description': 'Directory containing database seeder files.',
|
173
|
-
'default': lambda: str((Path.cwd() / 'database' / 'seeders').resolve())
|
174
|
-
}
|
175
|
-
)
|
176
|
-
|
177
|
-
factories: str = field(
|
178
|
-
default_factory = lambda: str((Path.cwd() / 'database' / 'factories').resolve()),
|
179
|
-
metadata = {
|
180
|
-
'description': 'Directory containing model factory files.',
|
181
|
-
'default': lambda: str((Path.cwd() / 'database' / 'factories').resolve())
|
182
|
-
}
|
183
|
-
)
|
184
|
-
|
185
|
-
logs: str = field(
|
186
|
-
default_factory = lambda: str((Path.cwd() / 'storage' / 'logs').resolve()),
|
187
|
-
metadata = {
|
188
|
-
'description': 'Directory containing application log files.',
|
189
|
-
'default': lambda: str((Path.cwd() / 'storage' / 'logs').resolve())
|
190
|
-
}
|
191
|
-
)
|
192
|
-
|
193
|
-
framework: str = field(
|
194
|
-
default_factory = lambda: str((Path.cwd() / 'storage' / 'framework').resolve()),
|
195
|
-
metadata = {
|
196
|
-
'description': 'Directory for framework-generated files (cache, sessions, views).',
|
197
|
-
'default': lambda: str((Path.cwd() / 'storage' / 'framework').resolve())
|
198
|
-
}
|
199
|
-
)
|
200
|
-
|
201
|
-
sessions: str = field(
|
202
|
-
default_factory = lambda: str((Path.cwd() / 'storage' / 'framework' / 'sessions').resolve()),
|
203
|
-
metadata = {
|
204
|
-
'description': 'Directory containing session files.',
|
205
|
-
'default': lambda: str((Path.cwd() / 'storage' / 'framework' / 'sessions').resolve())
|
206
|
-
}
|
207
|
-
)
|
208
|
-
|
209
|
-
cache: str = field(
|
210
|
-
default_factory = lambda: str((Path.cwd() / 'storage' / 'framework' / 'cache').resolve()),
|
105
|
+
database: str = field(
|
106
|
+
default_factory = lambda: str((Path.cwd() / 'database' / 'database').resolve()),
|
211
107
|
metadata = {
|
212
|
-
'description': 'Directory containing
|
213
|
-
'default': lambda: str((Path.cwd() / '
|
108
|
+
'description': 'Directory containing the SQLite database file.',
|
109
|
+
'default': lambda: str((Path.cwd() / 'database' / 'database').resolve())
|
214
110
|
}
|
215
111
|
)
|
216
112
|
|
217
|
-
|
218
|
-
default_factory = lambda: str((Path.cwd() / '
|
113
|
+
resources: str = field(
|
114
|
+
default_factory = lambda: str((Path.cwd() / 'resources').resolve()),
|
219
115
|
metadata = {
|
220
|
-
'description': 'Directory containing
|
221
|
-
'default': lambda: str((Path.cwd() / '
|
116
|
+
'description': 'Directory containing application resources (views, lang, assets).',
|
117
|
+
'default': lambda: str((Path.cwd() / 'resources').resolve())
|
222
118
|
}
|
223
119
|
)
|
224
120
|
|
225
|
-
|
226
|
-
default_factory = lambda: str((Path.cwd() / '
|
121
|
+
routes: str = field(
|
122
|
+
default_factory = lambda: str((Path.cwd() / 'routes').resolve()),
|
227
123
|
metadata = {
|
228
|
-
'description': '
|
229
|
-
'default': lambda: str((Path.cwd() / '
|
124
|
+
'description': 'Path to the web routes definition file.',
|
125
|
+
'default': lambda: str((Path.cwd() / 'routes').resolve())
|
230
126
|
}
|
231
127
|
)
|
232
128
|
|
@@ -248,12 +144,12 @@ class Paths(BaseEntity):
|
|
248
144
|
|
249
145
|
def __post_init__(self) -> None:
|
250
146
|
"""
|
251
|
-
Post-initialization hook to validate path attributes.
|
147
|
+
Post-initialization hook to validate and normalize path attributes.
|
252
148
|
|
253
149
|
This method is called automatically after the dataclass is initialized.
|
254
|
-
It ensures that all attributes
|
255
|
-
If any attribute is
|
256
|
-
to
|
150
|
+
It ensures that all path-related attributes of the class are stored as strings.
|
151
|
+
If any attribute is a `pathlib.Path`, it is converted to a string. If any attribute
|
152
|
+
cannot be converted to a string, an `OrionisIntegrityException` is raised.
|
257
153
|
|
258
154
|
Parameters
|
259
155
|
----------
|
@@ -263,21 +159,30 @@ class Paths(BaseEntity):
|
|
263
159
|
Returns
|
264
160
|
-------
|
265
161
|
None
|
266
|
-
This method does not return any value.
|
162
|
+
This method does not return any value. It modifies the instance in place if necessary.
|
267
163
|
|
268
164
|
Raises
|
269
165
|
------
|
270
166
|
OrionisIntegrityException
|
271
|
-
If any attribute is not
|
167
|
+
If any attribute is not a string after conversion.
|
272
168
|
"""
|
273
|
-
super().__post_init__() # Call the parent class's post-init if defined
|
274
169
|
|
275
|
-
#
|
170
|
+
# Call the parent class's __post_init__ if it exists
|
171
|
+
super().__post_init__()
|
172
|
+
|
173
|
+
# Iterate over all dataclass fields to validate and normalize their values
|
276
174
|
for field_ in fields(self):
|
175
|
+
|
176
|
+
# Get the current value of the field
|
277
177
|
value = getattr(self, field_.name)
|
278
|
-
|
178
|
+
|
179
|
+
# Convert Path objects to strings
|
180
|
+
if isinstance(value, Path):
|
181
|
+
object.__setattr__(self, field_.name, str(value))
|
182
|
+
value = str(value)
|
183
|
+
|
184
|
+
# Raise an exception if the value is not a string
|
279
185
|
if not isinstance(value, str):
|
280
|
-
# Raise an exception if the type is invalid
|
281
186
|
raise OrionisIntegrityException(
|
282
187
|
f"Invalid type for '{field_.name}': expected str, got {type(value).__name__}"
|
283
|
-
)
|
188
|
+
)
|