orionis 0.405.0__py3-none-any.whl → 0.406.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.
Files changed (154) hide show
  1. orionis/console/base/command.py +57 -50
  2. orionis/console/base/contracts/command.py +68 -0
  3. orionis/console/dynamic/contracts/progress_bar.py +3 -3
  4. orionis/console/dynamic/progress_bar.py +8 -8
  5. orionis/console/output/console.py +8 -2
  6. orionis/console/output/contracts/console.py +1 -1
  7. orionis/container/container.py +2 -2
  8. orionis/container/context/scope.py +4 -1
  9. orionis/container/contracts/service_provider.py +2 -2
  10. orionis/container/entities/binding.py +31 -44
  11. orionis/container/enums/lifetimes.py +22 -1
  12. orionis/container/facades/facade.py +1 -2
  13. orionis/container/providers/service_provider.py +2 -2
  14. orionis/foundation/application.py +542 -248
  15. orionis/foundation/config/app/entities/app.py +107 -90
  16. orionis/foundation/config/auth/entities/auth.py +4 -33
  17. orionis/foundation/config/cache/entities/cache.py +18 -41
  18. orionis/foundation/config/cache/entities/file.py +8 -35
  19. orionis/foundation/config/cache/entities/stores.py +17 -38
  20. orionis/foundation/config/cors/entities/cors.py +41 -54
  21. orionis/foundation/config/database/entities/connections.py +40 -56
  22. orionis/foundation/config/database/entities/database.py +11 -38
  23. orionis/foundation/config/database/entities/mysql.py +48 -76
  24. orionis/foundation/config/database/entities/oracle.py +30 -57
  25. orionis/foundation/config/database/entities/pgsql.py +45 -61
  26. orionis/foundation/config/database/entities/sqlite.py +26 -53
  27. orionis/foundation/config/filesystems/entitites/aws.py +28 -49
  28. orionis/foundation/config/filesystems/entitites/disks.py +27 -47
  29. orionis/foundation/config/filesystems/entitites/filesystems.py +15 -37
  30. orionis/foundation/config/filesystems/entitites/local.py +9 -35
  31. orionis/foundation/config/filesystems/entitites/public.py +14 -41
  32. orionis/foundation/config/logging/entities/channels.py +56 -86
  33. orionis/foundation/config/logging/entities/chunked.py +9 -9
  34. orionis/foundation/config/logging/entities/daily.py +8 -8
  35. orionis/foundation/config/logging/entities/hourly.py +6 -6
  36. orionis/foundation/config/logging/entities/logging.py +12 -18
  37. orionis/foundation/config/logging/entities/monthly.py +7 -7
  38. orionis/foundation/config/logging/entities/stack.py +5 -5
  39. orionis/foundation/config/logging/entities/weekly.py +6 -6
  40. orionis/foundation/config/mail/entities/file.py +9 -36
  41. orionis/foundation/config/mail/entities/mail.py +22 -40
  42. orionis/foundation/config/mail/entities/mailers.py +29 -44
  43. orionis/foundation/config/mail/entities/smtp.py +47 -48
  44. orionis/foundation/config/queue/entities/brokers.py +19 -41
  45. orionis/foundation/config/queue/entities/database.py +24 -46
  46. orionis/foundation/config/queue/entities/queue.py +28 -40
  47. orionis/foundation/config/roots/paths.py +272 -468
  48. orionis/foundation/config/session/entities/session.py +23 -53
  49. orionis/foundation/config/startup.py +165 -135
  50. orionis/foundation/config/testing/entities/testing.py +137 -122
  51. orionis/foundation/config/testing/enums/__init__.py +6 -2
  52. orionis/foundation/config/testing/enums/drivers.py +16 -0
  53. orionis/foundation/config/testing/enums/verbosity.py +18 -0
  54. orionis/foundation/contracts/application.py +152 -362
  55. orionis/foundation/providers/console_provider.py +24 -2
  56. orionis/foundation/providers/dumper_provider.py +24 -2
  57. orionis/foundation/providers/logger_provider.py +24 -2
  58. orionis/foundation/providers/path_resolver_provider.py +25 -2
  59. orionis/foundation/providers/progress_bar_provider.py +24 -2
  60. orionis/foundation/providers/testing_provider.py +39 -0
  61. orionis/foundation/providers/workers_provider.py +24 -2
  62. orionis/metadata/framework.py +1 -1
  63. orionis/services/environment/helpers/functions.py +1 -2
  64. orionis/services/environment/key/__init__.py +0 -0
  65. orionis/services/environment/key/key_generator.py +37 -0
  66. orionis/support/entities/__init__.py +0 -0
  67. orionis/support/entities/base.py +104 -0
  68. orionis/support/facades/testing.py +15 -0
  69. orionis/support/facades/workers.py +1 -1
  70. orionis/test/cases/asynchronous.py +0 -11
  71. orionis/test/cases/synchronous.py +0 -9
  72. orionis/test/contracts/dumper.py +11 -4
  73. orionis/test/contracts/kernel.py +5 -110
  74. orionis/test/contracts/logs.py +27 -65
  75. orionis/test/contracts/printer.py +16 -128
  76. orionis/test/contracts/test_result.py +100 -0
  77. orionis/test/contracts/unit_test.py +87 -150
  78. orionis/test/core/unit_test.py +608 -554
  79. orionis/test/entities/result.py +22 -2
  80. orionis/test/enums/__init__.py +0 -2
  81. orionis/test/enums/status.py +14 -9
  82. orionis/test/exceptions/config.py +9 -1
  83. orionis/test/exceptions/failure.py +34 -11
  84. orionis/test/exceptions/persistence.py +10 -2
  85. orionis/test/exceptions/runtime.py +9 -1
  86. orionis/test/exceptions/value.py +13 -1
  87. orionis/test/kernel.py +87 -289
  88. orionis/test/output/dumper.py +82 -18
  89. orionis/test/output/printer.py +399 -156
  90. orionis/test/records/logs.py +203 -82
  91. orionis/test/validators/__init__.py +33 -0
  92. orionis/test/validators/base_path.py +45 -0
  93. orionis/test/validators/execution_mode.py +45 -0
  94. orionis/test/validators/fail_fast.py +37 -0
  95. orionis/test/validators/folder_path.py +34 -0
  96. orionis/test/validators/module_name.py +31 -0
  97. orionis/test/validators/name_pattern.py +40 -0
  98. orionis/test/validators/pattern.py +36 -0
  99. orionis/test/validators/persistent.py +42 -0
  100. orionis/test/validators/persistent_driver.py +43 -0
  101. orionis/test/validators/print_result.py +37 -0
  102. orionis/test/validators/tags.py +37 -0
  103. orionis/test/validators/throw_exception.py +39 -0
  104. orionis/test/validators/verbosity.py +37 -0
  105. orionis/test/validators/web_report.py +35 -0
  106. orionis/test/validators/workers.py +31 -0
  107. orionis/test/view/render.py +48 -54
  108. {orionis-0.405.0.dist-info → orionis-0.406.0.dist-info}/METADATA +1 -1
  109. {orionis-0.405.0.dist-info → orionis-0.406.0.dist-info}/RECORD +149 -98
  110. tests/container/__init__.py +0 -0
  111. tests/container/context/__init__.py +0 -0
  112. tests/container/context/test_manager.py +27 -0
  113. tests/container/context/test_scope.py +23 -0
  114. tests/container/entities/__init__.py +0 -0
  115. tests/container/entities/test_binding.py +133 -0
  116. tests/container/enums/__init__.py +0 -0
  117. tests/container/enums/test_lifetimes.py +63 -0
  118. tests/container/facades/__init__.py +0 -0
  119. tests/container/facades/test_facade.py +61 -0
  120. tests/container/mocks/__init__.py +0 -0
  121. tests/container/mocks/mock_complex_classes.py +482 -0
  122. tests/container/mocks/mock_simple_classes.py +32 -0
  123. tests/container/providers/__init__.py +0 -0
  124. tests/container/providers/test_providers.py +48 -0
  125. tests/container/resolver/__init__.py +0 -0
  126. tests/container/resolver/test_resolver.py +55 -0
  127. tests/container/test_container.py +254 -0
  128. tests/container/test_singleton.py +98 -0
  129. tests/container/test_thread_safety.py +217 -0
  130. tests/container/validators/__init__.py +0 -0
  131. tests/container/validators/test_implements.py +140 -0
  132. tests/container/validators/test_is_abstract_class.py +99 -0
  133. tests/container/validators/test_is_callable.py +73 -0
  134. tests/container/validators/test_is_concrete_class.py +97 -0
  135. tests/container/validators/test_is_instance.py +105 -0
  136. tests/container/validators/test_is_not_subclass.py +117 -0
  137. tests/container/validators/test_is_subclass.py +115 -0
  138. tests/container/validators/test_is_valid_alias.py +113 -0
  139. tests/container/validators/test_lifetime.py +75 -0
  140. tests/foundation/config/testing/test_foundation_config_testing.py +1 -1
  141. tests/metadata/test_metadata_framework.py +18 -18
  142. tests/testing/test_testing_result.py +117 -117
  143. tests/testing/test_testing_unit.py +209 -209
  144. orionis/foundation/config/base.py +0 -112
  145. orionis/test/arguments/parser.py +0 -187
  146. orionis/test/contracts/parser.py +0 -43
  147. orionis/test/entities/arguments.py +0 -38
  148. orionis/test/enums/execution_mode.py +0 -16
  149. /orionis/{test/arguments → console/base/contracts}/__init__.py +0 -0
  150. /orionis/foundation/config/testing/enums/{test_mode.py → mode.py} +0 -0
  151. {orionis-0.405.0.dist-info → orionis-0.406.0.dist-info}/WHEEL +0 -0
  152. {orionis-0.405.0.dist-info → orionis-0.406.0.dist-info}/licenses/LICENCE +0 -0
  153. {orionis-0.405.0.dist-info → orionis-0.406.0.dist-info}/top_level.txt +0 -0
  154. {orionis-0.405.0.dist-info → orionis-0.406.0.dist-info}/zip-safe +0 -0
@@ -1,6 +1,7 @@
1
1
  from abc import abstractmethod
2
2
  from pathlib import Path
3
3
  from typing import Any, List, Type
4
+ from orionis.foundation.config.roots.paths import Paths
4
5
  from orionis.container.contracts.service_provider import IServiceProvider
5
6
  from orionis.container.contracts.container import IContainer
6
7
  from orionis.foundation.config.app.entities.app import App
@@ -14,555 +15,344 @@ from orionis.foundation.config.mail.entities.mail import Mail
14
15
  from orionis.foundation.config.queue.entities.queue import Queue
15
16
  from orionis.foundation.config.session.entities.session import Session
16
17
  from orionis.foundation.config.testing.entities.testing import Testing
17
- from orionis.foundation.contracts.config import IConfig
18
18
 
19
19
  class IApplication(IContainer):
20
- """
21
- Abstract interface for application containers that manage service providers.
22
-
23
- This interface extends IContainer to provide application-level functionality
24
- including service provider management and application lifecycle operations.
25
-
26
- By inheriting from IContainer, this interface provides access to all container
27
- methods while adding application-specific functionality.
28
- """
29
20
 
30
21
  @property
31
22
  @abstractmethod
32
23
  def isBooted(self) -> bool:
33
24
  """
34
- Check if the application providers have been booted.
25
+ Indicates whether the application has been booted.
35
26
 
36
27
  Returns
37
28
  -------
38
29
  bool
39
- True if providers are booted, False otherwise
30
+ True if the application is booted, False otherwise.
40
31
  """
41
32
  pass
42
33
 
34
+ @property
43
35
  @abstractmethod
44
- def withProviders(self, providers: List[Type[IServiceProvider]] = []) -> 'IApplication':
36
+ def startAt(self) -> int:
45
37
  """
46
- Add multiple service providers to the application.
47
-
48
- Parameters
49
- ----------
50
- providers : List[Type[IServiceProvider]], optional
51
- List of provider classes to add to the application
38
+ Returns the timestamp when the application was started.
52
39
 
53
40
  Returns
54
41
  -------
55
- IApplication
56
- The application instance for method chaining
42
+ int
43
+ The start time as a Unix timestamp.
57
44
  """
58
45
  pass
59
46
 
60
47
  @abstractmethod
61
- def withConfigurators(
62
- self,
63
- *,
64
- aapp: App|IConfig = None,
65
- auth: Auth|IConfig = None,
66
- cache : Cache|IConfig = None,
67
- cors : Cors|IConfig = None,
68
- database : Database|IConfig = None,
69
- filesystems : Filesystems|IConfig = None,
70
- logging : Logging|IConfig = None,
71
- mail : Mail|IConfig = None,
72
- queue : Queue|IConfig = None,
73
- session : Session|IConfig = None,
74
- testing : Testing|IConfig = None
75
- ) -> 'IApplication':
48
+ def withProviders(self, providers: List[Type[IServiceProvider]] = []) -> 'IApplication':
76
49
  """
77
- Configure the application with multiple configuration entities.
50
+ Add multiple service providers to the application.
78
51
 
79
52
  Parameters
80
53
  ----------
81
- app : App, optional
82
- Application configuration
83
- auth : Auth, optional
84
- Authentication configuration
85
- cache : Cache, optional
86
- Cache configuration
87
- cors : Cors, optional
88
- CORS configuration
89
- database : Database, optional
90
- Database configuration
91
- filesystems : Filesystems, optional
92
- Filesystems configuration
93
- logging : Logging, optional
94
- Logging configuration
95
- mail : Mail, optional
96
- Mail configuration
97
- queue : Queue, optional
98
- Queue configuration
99
- session : Session, optional
100
- Session configuration
101
- testing : Testing, optional
102
- Testing configuration
54
+ providers : List[Type[IServiceProvider]], optional
55
+ List of provider classes to add to the application.
103
56
 
104
57
  Returns
105
58
  -------
106
59
  IApplication
107
- The application instance for method chaining
60
+ The application instance for method chaining.
108
61
  """
109
62
  pass
110
63
 
111
64
  @abstractmethod
112
- def loadConfigApp(self, app: App) -> 'IApplication':
113
- """Load the application configuration from an App instance.
65
+ def addProvider(self, provider: Type[IServiceProvider]) -> 'IApplication':
66
+ """
67
+ Add a single service provider to the application.
114
68
 
115
69
  Parameters
116
70
  ----------
117
- app : App
118
- The App instance containing application configuration
71
+ provider : Type[IServiceProvider]
72
+ The provider class to add to the application.
119
73
 
120
74
  Returns
121
75
  -------
122
76
  IApplication
123
- The application instance for method chaining
77
+ The application instance for method chaining.
124
78
  """
125
79
  pass
126
80
 
127
81
  @abstractmethod
128
- def loadConfigAuth(self, auth: Auth) -> 'IApplication':
82
+ def withConfigurators(
83
+ self,
84
+ *,
85
+ app: App | dict = App(),
86
+ auth: Auth | dict = Auth(),
87
+ cache : Cache | dict = Cache(),
88
+ cors : Cors | dict = Cors(),
89
+ database : Database | dict = Database(),
90
+ filesystems : Filesystems | dict = Filesystems(),
91
+ logging : Logging | dict = Logging(),
92
+ mail : Mail | dict = Mail(),
93
+ path : Paths | dict = Paths(),
94
+ queue : Queue | dict = Queue(),
95
+ session : Session | dict = Session(),
96
+ testing : Testing | dict = Testing()
97
+ ) -> 'IApplication':
129
98
  """
130
- Load the authentication configuration from an Auth instance.
131
-
132
- Parameters
133
- ----------
134
- auth : Auth
135
- The Auth instance containing authentication configuration
99
+ Configure the application with various service configurators.
100
+ Allows setting up different aspects of the application by providing configurator instances for services like authentication, caching, database, etc.
136
101
 
137
102
  Returns
138
103
  -------
139
104
  IApplication
140
- The application instance for method chaining
105
+ Returns self to allow method chaining.
141
106
  """
142
107
  pass
143
108
 
144
109
  @abstractmethod
145
- def loadConfigCache(self, cache: Cache) -> 'IApplication':
110
+ def setConfigApp(self, **app_config) -> 'IApplication':
146
111
  """
147
- Load the cache configuration from a Cache instance.
148
-
149
- Parameters
150
- ----------
151
- cache : Cache
152
- The Cache instance containing cache configuration
153
-
154
- Returns
155
- -------
156
- IApplication
157
- The application instance for method chaining
112
+ Set the application configuration using keyword arguments.
158
113
  """
159
114
  pass
160
115
 
161
116
  @abstractmethod
162
- def loadConfigCors(self, cors: Cors) -> 'IApplication':
117
+ def loadConfigApp(self, app: App | dict) -> 'IApplication':
163
118
  """
164
- Load the CORS configuration from a Cors instance.
165
-
166
- Parameters
167
- ----------
168
- cors : Cors
169
- The Cors instance containing CORS configuration
170
-
171
- Returns
172
- -------
173
- IApplication
174
- The application instance for method chaining
119
+ Load the application configuration from an App instance or dictionary.
175
120
  """
176
121
  pass
177
122
 
178
123
  @abstractmethod
179
- def loadConfigDatabase(self, database: Database) -> 'IApplication':
124
+ def setConfigAuth(self, **auth_config) -> 'IApplication':
180
125
  """
181
- Load the database configuration from a Database instance.
182
-
183
- Parameters
184
- ----------
185
- database : Database
186
- The Database instance containing database configuration
187
-
188
- Returns
189
- -------
190
- IApplication
191
- The application instance for method chaining
126
+ Set the authentication configuration using keyword arguments.
192
127
  """
193
128
  pass
194
129
 
195
130
  @abstractmethod
196
- def loadConfigFilesystems(self, filesystems: Filesystems) -> 'IApplication':
131
+ def loadConfigAuth(self, auth: Auth | dict) -> 'IApplication':
197
132
  """
198
- Load the filesystems configuration from a Filesystems instance.
199
-
200
- Parameters
201
- ----------
202
- filesystems : Filesystems
203
- The Filesystems instance containing filesystems configuration
204
-
205
- Returns
206
- -------
207
- IApplication
208
- The application instance for method chaining
133
+ Load the authentication configuration from an Auth instance or dictionary.
209
134
  """
210
135
  pass
211
136
 
212
137
  @abstractmethod
213
- def loadConfigLogging(self, logging: Logging) -> 'IApplication':
138
+ def setConfigCache(self, **cache_config) -> 'IApplication':
214
139
  """
215
- Load the logging configuration from a Logging instance.
216
-
217
- Parameters
218
- ----------
219
- logging : Logging
220
- The Logging instance containing logging configuration
221
-
222
- Returns
223
- -------
224
- IApplication
225
- The application instance for method chaining
140
+ Set the cache configuration using keyword arguments.
226
141
  """
227
142
  pass
228
143
 
229
144
  @abstractmethod
230
- def loadConfigMail(self, mail: Mail) -> 'IApplication':
145
+ def loadConfigCache(self, cache: Cache | dict) -> 'IApplication':
231
146
  """
232
- Load the mail configuration from a Mail instance.
233
-
234
- Parameters
235
- ----------
236
- mail : Mail
237
- The Mail instance containing mail configuration
238
-
239
- Returns
240
- -------
241
- IApplication
242
- The application instance for method chaining
147
+ Load the cache configuration from a Cache instance or dictionary.
243
148
  """
244
149
  pass
245
150
 
246
151
  @abstractmethod
247
- def loadConfigQueue(self, queue: Queue) -> 'IApplication':
152
+ def setConfigCors(self, **cors_config) -> 'IApplication':
248
153
  """
249
- Load the queue configuration from a Queue instance.
250
-
251
- Parameters
252
- ----------
253
- queue : Queue
254
- The Queue instance containing queue configuration
255
-
256
- Returns
257
- -------
258
- IApplication
259
- The application instance for method chaining
154
+ Set the CORS configuration using keyword arguments.
260
155
  """
261
156
  pass
262
157
 
263
158
  @abstractmethod
264
- def loadConfigSession(self, session: Session) -> 'IApplication':
159
+ def loadConfigCors(self, cors: Cors | dict) -> 'IApplication':
265
160
  """
266
- Load the session configuration from a Session instance.
267
-
268
- Parameters
269
- ----------
270
- session : Session
271
- The Session instance containing session configuration
272
-
273
- Returns
274
- -------
275
- IApplication
276
- The application instance for method chaining
161
+ Load the CORS configuration from a Cors instance or dictionary.
277
162
  """
278
163
  pass
279
164
 
280
165
  @abstractmethod
281
- def loadConfigTesting(self, testing: Testing) -> 'IApplication':
166
+ def setConfigDatabase(self, **database_config) -> 'IApplication':
282
167
  """
283
- Load the testing configuration from a Testing instance.
284
-
285
- Parameters
286
- ----------
287
- testing : Testing
288
- The Testing instance containing testing configuration
289
-
290
- Returns
291
- -------
292
- IApplication
293
- The application instance for method chaining
168
+ Set the database configuration using keyword arguments.
294
169
  """
295
170
  pass
296
171
 
297
172
  @abstractmethod
298
- def addProvider(self, provider: Type[IServiceProvider]) -> 'IApplication':
173
+ def loadConfigDatabase(self, database: Database | dict) -> 'IApplication':
299
174
  """
300
- Add a single service provider to the application.
301
-
302
- Parameters
303
- ----------
304
- provider : Type[IServiceProvider]
305
- The provider class to add to the application
306
-
307
- Returns
308
- -------
309
- IApplication
310
- The application instance for method chaining
175
+ Load the database configuration from a Database instance or dictionary.
311
176
  """
312
177
  pass
313
178
 
314
179
  @abstractmethod
315
- def create(self) -> 'IApplication':
180
+ def setConfigFilesystems(self, **filesystems_config) -> 'IApplication':
316
181
  """
317
- Bootstrap the application by loading providers and kernels.
318
-
319
- Returns
320
- -------
321
- IApplication
322
- The application instance for method chaining
182
+ Set the filesystems configuration using keyword arguments.
323
183
  """
324
184
  pass
325
185
 
326
186
  @abstractmethod
327
- def config(
328
- self,
329
- key: str,
330
- default: Any = None
331
- ) -> Any:
187
+ def loadConfigFilesystems(self, filesystems: Filesystems | dict) -> 'IApplication':
332
188
  """
333
- Retrieve a configuration value by key.
334
-
335
- Parameters
336
- ----------
337
- key : str
338
- The configuration key to retrieve using dot notation (e.g. "app.name") (default is None)
339
- default : Any, optional
340
- Default value to return if key is not found
341
-
342
- Returns
343
- -------
344
- Any
345
- The configuration value or the entire configuration if key is None
189
+ Load the filesystems configuration from a Filesystems instance or dictionary.
346
190
  """
347
191
  pass
348
192
 
349
193
  @abstractmethod
350
- def configApp(self, **app_config) -> 'IApplication':
194
+ def setConfigLogging(self, **logging_config) -> 'IApplication':
351
195
  """
352
- Configure the application with various settings.
353
-
354
- Parameters
355
- ----------
356
- **app_config : dict
357
- Configuration parameters for the application. Must match the fields
358
- expected by the App dataclass (orionis.foundation.config.app.entities.app.App).
359
-
360
- Returns
361
- -------
362
- IApplication
363
- The application instance for method chaining
196
+ Set the logging configuration using keyword arguments.
364
197
  """
365
198
  pass
366
199
 
367
200
  @abstractmethod
368
- def configAuth(self, **auth_config) -> 'IApplication':
201
+ def loadConfigLogging(self, logging: Logging | dict) -> 'IApplication':
369
202
  """
370
- Configure the authentication with various settings.
371
-
372
- Parameters
373
- ----------
374
- **auth_config : dict
375
- Configuration parameters for authentication. Must match the fields
376
- expected by the Auth dataclass (orionis.foundation.config.auth.entities.auth.Auth).
377
-
378
- Returns
379
- -------
380
- IApplication
381
- The application instance for method chaining
203
+ Load the logging configuration from a Logging instance or dictionary.
382
204
  """
383
205
  pass
384
206
 
385
207
  @abstractmethod
386
- def configCache(self, **cache_config) -> 'IApplication':
208
+ def setConfigMail(self, **mail_config) -> 'IApplication':
387
209
  """
388
- Configure the cache with various settings.
389
-
390
- Parameters
391
- ----------
392
- **cache_config : dict
393
- Configuration parameters for cache. Must match the fields
394
- expected by the Cache dataclass (orionis.foundation.config.cache.entities.cache.Cache).
395
-
396
- Returns
397
- -------
398
- IApplication
399
- The application instance for method chaining
210
+ Set the mail configuration using keyword arguments.
400
211
  """
401
212
  pass
402
213
 
403
214
  @abstractmethod
404
- def configCors(self, **cors_config) -> 'IApplication':
215
+ def loadConfigMail(self, mail: Mail | dict) -> 'IApplication':
405
216
  """
406
- Configure the CORS with various settings.
407
-
408
- Parameters
409
- ----------
410
- **cors_config : dict
411
- Configuration parameters for CORS. Must match the fields
412
- expected by the Cors dataclass (orionis.foundation.config.cors.entities.cors.Cors).
413
-
414
- Returns
415
- -------
416
- IApplication
417
- The application instance for method chaining
217
+ Load the mail configuration from a Mail instance or dictionary.
418
218
  """
419
219
  pass
420
220
 
421
221
  @abstractmethod
422
- def configDatabase(self, **database_config) -> 'IApplication':
222
+ def setPaths(
223
+ self,
224
+ *,
225
+ console_scheduler: str | Path = (Path.cwd() / 'app' / 'console' / 'kernel.py').resolve(),
226
+ console_commands: str | Path = (Path.cwd() / 'app' / 'console' / 'commands').resolve(),
227
+ http_controllers: str | Path = (Path.cwd() / 'app' / 'http' / 'controllers').resolve(),
228
+ http_middleware: str | Path = (Path.cwd() / 'app' / 'http' / 'middleware').resolve(),
229
+ http_requests: str | Path = (Path.cwd() / 'app' / 'http' / 'requests').resolve(),
230
+ models: str | Path = (Path.cwd() / 'app' / 'models').resolve(),
231
+ providers: str | Path = (Path.cwd() / 'app' / 'providers').resolve(),
232
+ events: str | Path = (Path.cwd() / 'app' / 'events').resolve(),
233
+ listeners: str | Path = (Path.cwd() / 'app' / 'listeners').resolve(),
234
+ notifications: str | Path = (Path.cwd() / 'app' / 'notifications').resolve(),
235
+ jobs: str | Path = (Path.cwd() / 'app' / 'jobs').resolve(),
236
+ policies: str | Path = (Path.cwd() / 'app' / 'policies').resolve(),
237
+ exceptions: str | Path = (Path.cwd() / 'app' / 'exceptions').resolve(),
238
+ services: str | Path = (Path.cwd() / 'app' / 'services').resolve(),
239
+ views: str | Path = (Path.cwd() / 'resources' / 'views').resolve(),
240
+ lang: str | Path = (Path.cwd() / 'resources' / 'lang').resolve(),
241
+ assets: str | Path = (Path.cwd() / 'resources' / 'assets').resolve(),
242
+ routes_web: str | Path = (Path.cwd() / 'routes' / 'web.py').resolve(),
243
+ routes_api: str | Path = (Path.cwd() / 'routes' / 'api.py').resolve(),
244
+ routes_console: str | Path = (Path.cwd() / 'routes' / 'console.py').resolve(),
245
+ routes_channels: str | Path = (Path.cwd() / 'routes' / 'channels.py').resolve(),
246
+ config: str | Path = (Path.cwd() / 'config').resolve(),
247
+ migrations: str | Path = (Path.cwd() / 'database' / 'migrations').resolve(),
248
+ seeders: str | Path = (Path.cwd() / 'database' / 'seeders').resolve(),
249
+ factories: str | Path = (Path.cwd() / 'database' / 'factories').resolve(),
250
+ storage_logs: str | Path = (Path.cwd() / 'storage' / 'logs').resolve(),
251
+ storage_framework: str | Path = (Path.cwd() / 'storage' / 'framework').resolve(),
252
+ storage_sessions: str | Path = (Path.cwd() / 'storage' / 'framework' / 'sessions').resolve(),
253
+ storage_cache: str | Path = (Path.cwd() / 'storage' / 'framework' / 'cache').resolve(),
254
+ storage_views: str | Path = (Path.cwd() / 'storage' / 'framework' / 'views').resolve(),
255
+ ) -> 'IApplication':
423
256
  """
424
- Configure the database with various settings.
425
-
426
- Parameters
427
- ----------
428
- **database_config : dict
429
- Configuration parameters for database. Must match the fields
430
- expected by the Database dataclass (orionis.foundation.config.database.entities.database.Database).
431
-
432
- Returns
433
- -------
434
- IApplication
435
- The application instance for method chaining
257
+ Set the application paths configuration using keyword arguments.
436
258
  """
437
259
  pass
438
260
 
439
261
  @abstractmethod
440
- def configFilesystems(self, **filesystems_config) -> 'IApplication':
262
+ def loadPaths(self, paths: Paths | dict) -> 'IApplication':
441
263
  """
442
- Configure the filesystems with various settings.
443
-
444
- Parameters
445
- ----------
446
- **filesystems_config : dict
447
- Configuration parameters for filesystems. Must match the fields
448
- expected by the Filesystems dataclass (orionis.foundation.config.filesystems.entitites.filesystems.Filesystems).
449
-
450
- Returns
451
- -------
452
- IApplication
453
- The application instance for method chaining
264
+ Load the application paths configuration from a Paths instance or dictionary.
454
265
  """
455
266
  pass
456
267
 
457
268
  @abstractmethod
458
- def configLogging(self, **logging_config) -> 'IApplication':
269
+ def setConfigQueue(self, **queue_config) -> 'IApplication':
459
270
  """
460
- Configure the logging system with various channel settings.
461
-
462
- Parameters
463
- ----------
464
- **logging_config : dict
465
- Configuration parameters for logging. Must match the fields
466
- expected by the Logging dataclass (orionis.foundation.config.logging.entities.logging.Logging).
467
-
468
- Returns
469
- -------
470
- IApplication
471
- The application instance for method chaining
271
+ Set the queue configuration using keyword arguments.
472
272
  """
473
273
  pass
474
274
 
475
275
  @abstractmethod
476
- def configMail(self, **mail_config) -> 'IApplication':
276
+ def loadConfigQueue(self, queue: Queue | dict) -> 'IApplication':
477
277
  """
478
- Configure the mail system with various settings.
479
-
480
- Parameters
481
- ----------
482
- **mail_config : dict
483
- Configuration parameters for mail. Must match the fields
484
- expected by the Mail dataclass (orionis.foundation.config.mail.entities.mail.Mail).
278
+ Load the queue configuration from a Queue instance or dictionary.
279
+ """
280
+ pass
485
281
 
486
- Returns
487
- -------
488
- IApplication
489
- The application instance for method chaining
282
+ @abstractmethod
283
+ def setConfigSession(self, **session_config) -> 'IApplication':
284
+ """
285
+ Set the session configuration using keyword arguments.
490
286
  """
491
287
  pass
492
288
 
493
289
  @abstractmethod
494
- def configQueue(self, **queue_config) -> 'IApplication':
290
+ def loadConfigSession(self, session: Session | dict) -> 'IApplication':
291
+ """
292
+ Load the session configuration from a Session instance or dictionary.
495
293
  """
496
- Configure the queue system with various settings.
294
+ pass
497
295
 
498
- Parameters
499
- ----------
500
- **queue_config : dict
501
- Configuration parameters for queue. Must match the fields
502
- expected by the Queue dataclass (orionis.foundation.config.queue.entities.queue.Queue).
296
+ @abstractmethod
297
+ def setConfigTesting(self, **testing_config) -> 'IApplication':
298
+ """
299
+ Set the testing configuration using keyword arguments.
300
+ """
301
+ pass
503
302
 
504
- Returns
505
- -------
506
- IApplication
507
- The application instance for method chaining
303
+ @abstractmethod
304
+ def loadConfigTesting(self, testing: Testing | dict) -> 'IApplication':
305
+ """
306
+ Load the testing configuration from a Testing instance or dictionary.
508
307
  """
509
308
  pass
510
309
 
511
310
  @abstractmethod
512
- def configSession(self, **session_config) -> 'IApplication':
311
+ def config(self, key: str = None, default: Any = None) -> Any:
513
312
  """
514
- Configure the session with various settings.
313
+ Retrieve a configuration value using dot notation, or the entire configuration if no key is provided.
515
314
 
516
315
  Parameters
517
316
  ----------
518
- **session_config : dict
519
- Configuration parameters for session. Must match the fields
520
- expected by the Session dataclass (orionis.foundation.config.session.entities.session.Session).
317
+ key : str, optional
318
+ The configuration key to retrieve.
319
+ default : Any, optional
320
+ The default value to return if the key is not found.
521
321
 
522
322
  Returns
523
323
  -------
524
- IApplication
525
- The application instance for method chaining
324
+ Any
325
+ The configuration value or the default.
526
326
  """
527
327
  pass
528
328
 
529
329
  @abstractmethod
530
- def configTesting(self, **testing_config) -> 'IApplication':
330
+ def path(self, key: str = None, default: Any = None) -> Any:
531
331
  """
532
- Configure the testing with various settings.
332
+ Retrieve a path configuration value using dot notation, or the entire paths configuration if no key is provided.
533
333
 
534
334
  Parameters
535
335
  ----------
536
- **testing_config : dict
537
- Configuration parameters for testing. Must match the fields
538
- expected by the Testing dataclass (orionis.foundation.config.testing.entities.testing.Testing).
336
+ key : str, optional
337
+ The path key to retrieve.
338
+ default : Any, optional
339
+ The default value to return if the key is not found.
539
340
 
540
341
  Returns
541
342
  -------
542
- IApplication
543
- The application instance for method chaining
343
+ Any
344
+ The path value or the default.
544
345
  """
545
346
  pass
546
347
 
547
348
  @abstractmethod
548
- def path(
549
- self,
550
- key: str,
551
- default: str = None
552
- ) -> Path:
349
+ def create(self) -> 'IApplication':
553
350
  """
554
- Retrieve a path configuration value by key.
555
-
556
- Parameters
557
- ----------
558
- key : str
559
- The path key to retrieve using dot notation (e.g. "paths.storage")
560
- default : str, optional
561
- Default value to return if key is not found
351
+ Bootstrap the application, loading all necessary providers and kernels.
562
352
 
563
353
  Returns
564
354
  -------
565
- Path
566
- The path value as a Path object, or None if not found and no default is provided
355
+ IApplication
356
+ The initialized application instance.
567
357
  """
568
- pass
358
+ pass