orionis 0.390.0__py3-none-any.whl → 0.392.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.
config/__init__.py ADDED
File without changes
config/app.py ADDED
@@ -0,0 +1,79 @@
1
+ from orionis.foundation.config.app.entities.app import App
2
+ from orionis.foundation.contracts.config import IConfig
3
+ from orionis.services.environment.helpers.functions import env
4
+
5
+ class Config(IConfig):
6
+
7
+ config = App(
8
+
9
+ #--------------------------------------------------------------------------
10
+ # Application Name
11
+ #--------------------------------------------------------------------------
12
+ # Defines the name of the application.
13
+ #
14
+ # This value is used in notifications, UI elements, logs, and anywhere
15
+ # the application's name needs to be displayed.
16
+ #--------------------------------------------------------------------------
17
+
18
+ name = env('APP_NAME', 'Orionis'),
19
+
20
+ #--------------------------------------------------------------------------
21
+ # Debug Mode
22
+ #--------------------------------------------------------------------------
23
+ # Enables or disables detailed error reporting.
24
+ #
25
+ # When set to True, the application will display detailed error messages,
26
+ # which is useful during development but should be disabled in production.
27
+ #--------------------------------------------------------------------------
28
+
29
+ debug = env('APP_DEBUG', False),
30
+
31
+ #--------------------------------------------------------------------------
32
+ # Timezone Configuration
33
+ #--------------------------------------------------------------------------
34
+ # Defines the application's default timezone.
35
+ #
36
+ # This setting ensures consistency when handling timestamps, logs,
37
+ # and scheduled tasks. The default value is 'UTC'.
38
+ #--------------------------------------------------------------------------
39
+
40
+ timezone = env('APP_TIMEZONE', 'UTC'),
41
+
42
+ #--------------------------------------------------------------------------
43
+ # Uvicorn Server Configuration
44
+ #--------------------------------------------------------------------------
45
+ # Defines the settings for running the application with Uvicorn.
46
+ #
47
+ # - `url` : The host address for the application.
48
+ # - `port` : The port number on which the application will run.
49
+ # - `workers` : Number of worker processes to handle requests.
50
+ # - `reload` : Enables auto-reloading when code changes (useful for development).
51
+ #--------------------------------------------------------------------------
52
+
53
+ url = env('APP_URL', '127.0.0.1'),
54
+ port = env('APP_PORT', 8080),
55
+ workers = env('APP_WORKERS', 1),
56
+ reload = env('APP_RELOAD', False),
57
+
58
+ #--------------------------------------------------------------------------
59
+ # Application Encryption
60
+ #--------------------------------------------------------------------------
61
+ # Defines the encryption method and key used by the framework.
62
+ #
63
+ # The encryption method used is AES-256-GCM, which ensures secure data
64
+ # encryption. The key should be properly set via environment variables.
65
+ # Supported key sizes: 128, 192, or 256-bit.
66
+ #--------------------------------------------------------------------------
67
+
68
+ cipher = 'AES-256-GCM',
69
+ key = env('APP_KEY'),
70
+
71
+ #--------------------------------------------------------------------------
72
+ # Additional Values
73
+ #--------------------------------------------------------------------------
74
+ # If your application requires additional configurations, you can define
75
+ # them in this dictionary.
76
+ #--------------------------------------------------------------------------
77
+
78
+ # custom = {}
79
+ )
orionis/__init__.py CHANGED
@@ -1,9 +1,11 @@
1
1
  from orionis.foundation.application import (
2
2
  Application as Orionis,
3
- IApplication as IOrionis
3
+ IApplication as IOrionis,
4
+ Configuration as Config
4
5
  )
5
6
 
6
7
  __all__ = [
7
8
  "Orionis",
8
- "IOrionis"
9
+ "IOrionis",
10
+ "Config"
9
11
  ]
@@ -1,7 +1,20 @@
1
- from typing import Type, List
1
+ from typing import Any, Type, List
2
2
  from orionis.container.container import Container
3
3
  from orionis.container.contracts.service_provider import IServiceProvider
4
- from orionis.foundation.config.roots.paths import Paths
4
+ from orionis.foundation.config.app.entities.app import App
5
+ from orionis.foundation.config.app.enums.ciphers import Cipher
6
+ from orionis.foundation.config.app.enums.environments import Environments
7
+ from orionis.foundation.config.auth.entities.auth import Auth
8
+ from orionis.foundation.config.cache.entities.cache import Cache
9
+ from orionis.foundation.config.cors.entities.cors import Cors
10
+ from orionis.foundation.config.database.entities.database import Database
11
+ from orionis.foundation.config.filesystems.entitites.filesystems import Filesystems
12
+ from orionis.foundation.config.logging.entities.logging import Logging
13
+ from orionis.foundation.config.mail.entities.mail import Mail
14
+ from orionis.foundation.config.queue.entities.queue import Queue
15
+ from orionis.foundation.config.session.entities.session import Session
16
+ from orionis.foundation.config.startup import Configuration
17
+ from orionis.foundation.config.testing.entities.testing import Testing
5
18
  from orionis.foundation.contracts.application import IApplication
6
19
 
7
20
  class Application(Container, IApplication):
@@ -47,6 +60,8 @@ class Application(Container, IApplication):
47
60
  # Singleton pattern - prevent multiple initializations
48
61
  if not hasattr(self, '_Application__initialized'):
49
62
  self.__providers: List[IServiceProvider] = []
63
+ self.__configurators : dict = {}
64
+ self.__config: dict = {}
50
65
  self.__booted: bool = False
51
66
  self.__initialized = True
52
67
 
@@ -144,10 +159,6 @@ class Application(Container, IApplication):
144
159
  -------
145
160
  Application
146
161
  The application instance for method chaining
147
-
148
- Examples
149
- --------
150
- >>> app.withProviders([CustomProvider, AnotherProvider])
151
162
  """
152
163
  # Add each provider class
153
164
  for provider_cls in providers:
@@ -182,6 +193,417 @@ class Application(Container, IApplication):
182
193
 
183
194
  # Instantiate and add provider
184
195
  self.__providers.append(provider(self))
196
+
197
+ # Return self instance.
198
+ return self
199
+
200
+ def withConfigurators(
201
+ self,
202
+ *,
203
+ app: App = None,
204
+ auth: Auth = None,
205
+ cache : Cache = None,
206
+ cors : Cors = None,
207
+ database : Database = None,
208
+ filesystems : Filesystems = None,
209
+ logging : Logging = None,
210
+ mail : Mail = None,
211
+ queue : Queue = None,
212
+ session : Session = None,
213
+ testing : Testing = None,
214
+ ) -> 'Application':
215
+
216
+ self.loadConfigApp(app or App())
217
+ self.loadConfigAuth(auth or Auth())
218
+ self.loadConfigCache(cache or Cache())
219
+ self.loadConfigCors(cors or Cors())
220
+ self.loadConfigDatabase(database or Database())
221
+ self.loadConfigFilesystems(filesystems or Filesystems())
222
+ self.loadConfigLogging(logging or Logging())
223
+ self.loadConfigMail(mail or Mail())
224
+ self.loadConfigQueue(queue or Queue())
225
+ self.loadConfigSession(session or Session())
226
+ self.loadConfigTesting(testing or Testing())
227
+
228
+ return self
229
+
230
+ def configApp(
231
+ self,
232
+ *,
233
+ name: str = None,
234
+ env: str | Environments = None,
235
+ debug: bool = None,
236
+ url: str = None,
237
+ port: int = None,
238
+ workers: int = None,
239
+ reload: bool = None,
240
+ timezone: str = None,
241
+ locale: str = None,
242
+ fallback_locale: str = None,
243
+ cipher: str | Cipher = None,
244
+ key: str = None,
245
+ maintenance: str = None
246
+ ) -> 'Application':
247
+ """
248
+ Configure the application with various settings.
249
+
250
+ Parameters
251
+ ----------
252
+ name : str, optional
253
+ The name of the application
254
+ env : str | Environments, optional
255
+ The environment of the application (e.g., 'development', 'production')
256
+ debug : bool, optional
257
+ Whether to enable debug mode
258
+ url : str, optional
259
+ The base URL of the application
260
+ port : int, optional
261
+ The port on which the application runs
262
+ workers : int, optional
263
+ Number of worker processes for handling requests
264
+ reload : bool, optional
265
+ Whether to enable auto-reloading of the application
266
+ timezone : str, optional
267
+ The timezone for the application
268
+ locale : str, optional
269
+ The default locale for the application
270
+ fallback_locale : str, optional
271
+ The fallback locale if the default is not available
272
+ cipher : str | Cipher, optional
273
+ The encryption cipher used by the application
274
+ key : str, optional
275
+ The encryption key used by the application
276
+ maintenance : str, optional
277
+ The maintenance route for the application
278
+
279
+ Returns
280
+ -------
281
+ Application
282
+ The application instance for method chaining
283
+
284
+ Raises
285
+ ------
286
+ TypeError
287
+ If any parameter is of an incorrect type or value.
288
+ """
289
+ # Create App instance with provided parameters and validate it.
290
+ params = {}
291
+ for _key, _value in locals().items():
292
+ if _key != 'self' and _value is not None:
293
+ params[_key] = _value
294
+
295
+ # Create App instance with validated parameters
296
+ app = App(**params)
297
+
298
+ # Load configuration using App instance.
299
+ self.loadConfigApp(app)
300
+
301
+ # Return the application instance for method chaining
302
+ return self
303
+
304
+ def loadConfigApp(
305
+ self,
306
+ app: App
307
+ ) -> 'Application':
308
+ """
309
+ Load the application configuration from an App instance.
310
+
311
+ Parameters
312
+ ----------
313
+ config : App
314
+ The App instance containing application configuration
315
+
316
+ Returns
317
+ -------
318
+ Application
319
+ The application instance for method chaining
320
+ """
321
+ # Validate config type
322
+ if not isinstance(app, App):
323
+ raise TypeError(f"Expected App instance, got {type(app).__name__}")
324
+
325
+ # Store the configuration
326
+ self.__configurators['app'] = app
327
+
328
+ # Return the application instance for method chaining
329
+ return self
330
+
331
+ def loadConfigAuth(
332
+ self,
333
+ auth: Auth
334
+ ) -> 'Application':
335
+ """
336
+ Load the application authentication configuration from an Auth instance.
337
+
338
+ Parameters
339
+ ----------
340
+ auth : Auth
341
+ The Auth instance containing authentication configuration
342
+
343
+ Returns
344
+ -------
345
+ Application
346
+ The application instance for method chaining
347
+ """
348
+ # Validate auth type
349
+ if not isinstance(auth, Auth):
350
+ raise TypeError(f"Expected Auth instance, got {type(auth).__name__}")
351
+
352
+ # Store the configuration
353
+ self.__configurators['auth'] = auth
354
+
355
+ # Return the application instance for method chaining
356
+ return self
357
+
358
+ def loadConfigCache(
359
+ self,
360
+ cache: Cache
361
+ ) -> 'Application':
362
+ """
363
+ Load the application cache configuration from a Cache instance.
364
+
365
+ Parameters
366
+ ----------
367
+ cache : Cache
368
+ The Cache instance containing cache configuration
369
+
370
+ Returns
371
+ -------
372
+ Application
373
+ The application instance for method chaining
374
+ """
375
+ # Validate cache type
376
+ if not isinstance(cache, Cache):
377
+ raise TypeError(f"Expected Cache instance, got {type(cache).__name__}")
378
+
379
+ # Store the configuration
380
+ self.__configurators['cache'] = cache
381
+
382
+ # Return the application instance for method chaining
383
+ return self
384
+
385
+ def loadConfigCors(
386
+ self,
387
+ cors: Cors
388
+ ) -> 'Application':
389
+ """
390
+ Load the application CORS configuration from a Cors instance.
391
+
392
+ Parameters
393
+ ----------
394
+ cors : Cors
395
+ The Cors instance containing CORS configuration
396
+
397
+ Returns
398
+ -------
399
+ Application
400
+ The application instance for method chaining
401
+ """
402
+ # Validate cors type
403
+ if not isinstance(cors, Cors):
404
+ raise TypeError(f"Expected Cors instance, got {type(cors).__name__}")
405
+
406
+ # Store the configuration
407
+ self.__configurators['cors'] = cors
408
+
409
+ # Return the application instance for method chaining
410
+ return self
411
+
412
+ def loadConfigDatabase(
413
+ self,
414
+ database: Database
415
+ ) -> 'Application':
416
+ """
417
+ Load the application database configuration from a Database instance.
418
+
419
+ Parameters
420
+ ----------
421
+ database : Database
422
+ The Database instance containing database configuration
423
+
424
+ Returns
425
+ -------
426
+ Application
427
+ The application instance for method chaining
428
+ """
429
+ # Validate database type
430
+ if not isinstance(database, Database):
431
+ raise TypeError(f"Expected Database instance, got {type(database).__name__}")
432
+
433
+ # Store the configuration
434
+ self.__configurators['database'] = database
435
+
436
+ # Return the application instance for method chaining
437
+ return self
438
+
439
+ def loadConfigFilesystems(
440
+ self,
441
+ filesystems: Filesystems
442
+ ) -> 'Application':
443
+ """
444
+ Load the application filesystems configuration from a Filesystems instance.
445
+
446
+ Parameters
447
+ ----------
448
+ filesystems : Filesystems
449
+ The Filesystems instance containing filesystems configuration
450
+
451
+ Returns
452
+ -------
453
+ Application
454
+ The application instance for method chaining
455
+ """
456
+ # Validate filesystems type
457
+ if not isinstance(filesystems, Filesystems):
458
+ raise TypeError(f"Expected Filesystems instance, got {type(filesystems).__name__}")
459
+
460
+ # Store the configuration
461
+ self.__configurators['filesystems'] = filesystems
462
+
463
+ # Return the application instance for method chaining
464
+ return self
465
+
466
+ def loadConfigLogging(
467
+ self,
468
+ logging: Logging
469
+ ) -> 'Application':
470
+ """
471
+ Load the application logging configuration from a Logging instance.
472
+
473
+ Parameters
474
+ ----------
475
+ logging : Logging
476
+ The Logging instance containing logging configuration
477
+
478
+ Returns
479
+ -------
480
+ Application
481
+ The application instance for method chaining
482
+ """
483
+ # Validate logging type
484
+ if not isinstance(logging, Logging):
485
+ raise TypeError(f"Expected Logging instance, got {type(logging).__name__}")
486
+
487
+ # Store the configuration
488
+ self.__configurators['logging'] = logging
489
+
490
+ # Return the application instance for method chaining
491
+ return self
492
+
493
+ def loadConfigMail(
494
+ self,
495
+ mail: Mail
496
+ ) -> 'Application':
497
+ """
498
+ Load the application mail configuration from a Mail instance.
499
+
500
+ Parameters
501
+ ----------
502
+ mail : Mail
503
+ The Mail instance containing mail configuration
504
+
505
+ Returns
506
+ -------
507
+ Application
508
+ The application instance for method chaining
509
+ """
510
+ # Validate mail type
511
+ if not isinstance(mail, Mail):
512
+ raise TypeError(f"Expected Mail instance, got {type(mail).__name__}")
513
+
514
+ # Store the configuration
515
+ self.__configurators.append({
516
+ 'mail' : mail
517
+ })
518
+
519
+ # Return the application instance for method chaining
520
+ return self
521
+
522
+ def loadConfigQueue(
523
+ self,
524
+ queue: Queue
525
+ ) -> 'Application':
526
+ """
527
+ Load the application queue configuration from a Queue instance.
528
+
529
+ Parameters
530
+ ----------
531
+ queue : Queue
532
+ The Queue instance containing queue configuration
533
+
534
+ Returns
535
+ -------
536
+ Application
537
+ The application instance for method chaining
538
+ """
539
+ # Validate queue type
540
+ if not isinstance(queue, Queue):
541
+ raise TypeError(f"Expected Queue instance, got {type(queue).__name__}")
542
+
543
+ # Store the configuration
544
+ self.__configurators.append({
545
+ 'queue' : queue
546
+ })
547
+
548
+ # Return the application instance for method chaining
549
+ return self
550
+
551
+ def loadConfigSession(
552
+ self,
553
+ session: Session
554
+ ) -> 'Application':
555
+ """
556
+ Load the application session configuration from a Session instance.
557
+
558
+ Parameters
559
+ ----------
560
+ session : Session
561
+ The Session instance containing session configuration
562
+
563
+ Returns
564
+ -------
565
+ Application
566
+ The application instance for method chaining
567
+ """
568
+ # Validate session type
569
+ if not isinstance(session, Session):
570
+ raise TypeError(f"Expected Session instance, got {type(session).__name__}")
571
+
572
+ # Store the configuration
573
+ self.__configurators.append({
574
+ 'session' : session
575
+ })
576
+
577
+ # Return the application instance for method chaining
578
+ return self
579
+
580
+ def loadConfigTesting(
581
+ self,
582
+ testing: Testing
583
+ ) -> 'Application':
584
+ """
585
+ Load the application testing configuration from a Testing instance.
586
+
587
+ Parameters
588
+ ----------
589
+ testing : Testing
590
+ The Testing instance containing testing configuration
591
+
592
+ Returns
593
+ -------
594
+ Application
595
+ The application instance for method chaining
596
+ """
597
+ # Validate testing type
598
+ if not isinstance(testing, Testing):
599
+ raise TypeError(f"Expected Testing instance, got {type(testing).__name__}")
600
+
601
+ # Store the configuration
602
+ self.__configurators.append({
603
+ 'testing' : testing
604
+ })
605
+
606
+ # Return the application instance for method chaining
185
607
  return self
186
608
 
187
609
  def create(
@@ -206,7 +628,79 @@ class Application(Container, IApplication):
206
628
  self.__registerProviders()
207
629
  self.__bootProviders()
208
630
 
631
+ # Load configuration if not already set
632
+ self.__loadConfig()
633
+
209
634
  # Mark as booted
210
635
  self.__booted = True
211
636
 
212
- return self
637
+ return self
638
+
639
+ def __loadConfig(
640
+ self,
641
+ ) -> None:
642
+ """
643
+ Retrieve a configuration value by key.
644
+
645
+ Returns
646
+ -------
647
+ None
648
+ Initializes the application configuration if not already set.
649
+ """
650
+
651
+ # Try to load the configuration
652
+ try:
653
+
654
+ # Check if configuration is a dictionary
655
+ if not self.__config:
656
+
657
+ # Initialize with default configuration
658
+ if not self.__configurators:
659
+ self.__config = Configuration().toDict()
660
+ else:
661
+ self.__config = Configuration(**self.__configurators).toDict()
662
+
663
+ except Exception as e:
664
+
665
+ # Handle any exceptions during configuration loading
666
+ raise RuntimeError(f"Failed to load application configuration: {str(e)}")
667
+
668
+ def config(
669
+ self,
670
+ key: str,
671
+ default: Any = None
672
+ ) -> Any:
673
+ """
674
+ Retrieve a configuration value by key.
675
+
676
+ Parameters
677
+ ----------
678
+ key : str
679
+ The configuration key to retrieve using dot notation (e.g. "app.name") (default is None)
680
+ default : Any, optional
681
+ Default value to return if key is not found
682
+
683
+ Returns
684
+ -------
685
+ Any
686
+ The configuration value or the entire configuration if key is None
687
+ """
688
+ # If key is None, raise an error to prevent ambiguity
689
+ if key is None:
690
+ raise ValueError("Key cannot be None. Use config() without arguments to get the entire configuration.")
691
+
692
+ # Split the key by dot notation
693
+ parts = key.split('.')
694
+
695
+ # Start with the full config
696
+ config_value = self.__config
697
+
698
+ # Traverse the config dictionary based on the key parts
699
+ for part in parts:
700
+ if isinstance(config_value, dict) and part in config_value:
701
+ config_value = config_value[part]
702
+ else:
703
+ return default
704
+
705
+ # Return the final configuration value
706
+ return config_value
@@ -1,7 +1,20 @@
1
1
  from abc import abstractmethod
2
- from typing import List, Type
2
+ from typing import Any, List, Type
3
3
  from orionis.container.contracts.service_provider import IServiceProvider
4
4
  from orionis.container.contracts.container import IContainer
5
+ from orionis.foundation.config.startup import Configuration
6
+ from orionis.foundation.config.app.entities.app import App
7
+ from orionis.foundation.config.auth.entities.auth import Auth
8
+ from orionis.foundation.config.cache.entities.cache import Cache
9
+ from orionis.foundation.config.cors.entities.cors import Cors
10
+ from orionis.foundation.config.database.entities.database import Database
11
+ from orionis.foundation.config.filesystems.entitites.filesystems import Filesystems
12
+ from orionis.foundation.config.logging.entities.logging import Logging
13
+ from orionis.foundation.config.mail.entities.mail import Mail
14
+ from orionis.foundation.config.queue.entities.queue import Queue
15
+ from orionis.foundation.config.session.entities.session import Session
16
+ from orionis.foundation.config.testing.entities.testing import Testing
17
+ from orionis.support.wrapper.dot_dict import DotDict
5
18
 
6
19
  class IApplication(IContainer):
7
20
  """
@@ -31,12 +44,249 @@ class IApplication(IContainer):
31
44
  def withProviders(self, providers: List[Type[IServiceProvider]] = []) -> 'IApplication':
32
45
  """
33
46
  Add multiple service providers to the application.
34
-
47
+
35
48
  Parameters
36
49
  ----------
37
50
  providers : List[Type[IServiceProvider]], optional
38
51
  List of provider classes to add to the application
39
-
52
+
53
+ Returns
54
+ -------
55
+ IApplication
56
+ The application instance for method chaining
57
+ """
58
+ pass
59
+
60
+ @abstractmethod
61
+ def withConfigurators(
62
+ self,
63
+ *,
64
+ app: App = None,
65
+ auth: Auth = None,
66
+ cache: Cache = None,
67
+ cors: Cors = None,
68
+ database: Database = None,
69
+ filesystems: Filesystems = None,
70
+ logging: Logging = None,
71
+ mail: Mail = None,
72
+ queue: Queue = None,
73
+ session: Session = None,
74
+ testing: Testing = None,
75
+ ) -> 'IApplication':
76
+ """
77
+ Configure the application with multiple configuration entities.
78
+
79
+ Parameters
80
+ ----------
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
103
+
104
+ Returns
105
+ -------
106
+ IApplication
107
+ The application instance for method chaining
108
+ """
109
+ pass
110
+
111
+ @abstractmethod
112
+ def loadConfigApp(self, app: App) -> 'IApplication':
113
+ """Load the application configuration from an App instance.
114
+
115
+ Parameters
116
+ ----------
117
+ app : App
118
+ The App instance containing application configuration
119
+
120
+ Returns
121
+ -------
122
+ IApplication
123
+ The application instance for method chaining
124
+ """
125
+ pass
126
+
127
+ @abstractmethod
128
+ def loadConfigAuth(self, auth: Auth) -> 'IApplication':
129
+ """
130
+ Load the authentication configuration from an Auth instance.
131
+
132
+ Parameters
133
+ ----------
134
+ auth : Auth
135
+ The Auth instance containing authentication configuration
136
+
137
+ Returns
138
+ -------
139
+ IApplication
140
+ The application instance for method chaining
141
+ """
142
+ pass
143
+
144
+ @abstractmethod
145
+ def loadConfigCache(self, cache: Cache) -> 'IApplication':
146
+ """
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
158
+ """
159
+ pass
160
+
161
+ @abstractmethod
162
+ def loadConfigCors(self, cors: Cors) -> 'IApplication':
163
+ """
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
175
+ """
176
+ pass
177
+
178
+ @abstractmethod
179
+ def loadConfigDatabase(self, database: Database) -> 'IApplication':
180
+ """
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
192
+ """
193
+ pass
194
+
195
+ @abstractmethod
196
+ def loadConfigFilesystems(self, filesystems: Filesystems) -> 'IApplication':
197
+ """
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
209
+ """
210
+ pass
211
+
212
+ @abstractmethod
213
+ def loadConfigLogging(self, logging: Logging) -> 'IApplication':
214
+ """
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
226
+ """
227
+ pass
228
+
229
+ @abstractmethod
230
+ def loadConfigMail(self, mail: Mail) -> 'IApplication':
231
+ """
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
243
+ """
244
+ pass
245
+
246
+ @abstractmethod
247
+ def loadConfigQueue(self, queue: Queue) -> 'IApplication':
248
+ """
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
260
+ """
261
+ pass
262
+
263
+ @abstractmethod
264
+ def loadConfigSession(self, session: Session) -> 'IApplication':
265
+ """
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
277
+ """
278
+ pass
279
+
280
+ @abstractmethod
281
+ def loadConfigTesting(self, testing: Testing) -> 'IApplication':
282
+ """
283
+ Load the testing configuration from a Testing instance.
284
+
285
+ Parameters
286
+ ----------
287
+ testing : Testing
288
+ The Testing instance containing testing configuration
289
+
40
290
  Returns
41
291
  -------
42
292
  IApplication
@@ -48,12 +298,12 @@ class IApplication(IContainer):
48
298
  def addProvider(self, provider: Type[IServiceProvider]) -> 'IApplication':
49
299
  """
50
300
  Add a single service provider to the application.
51
-
301
+
52
302
  Parameters
53
303
  ----------
54
304
  provider : Type[IServiceProvider]
55
305
  The provider class to add to the application
56
-
306
+
57
307
  Returns
58
308
  -------
59
309
  IApplication
@@ -65,10 +315,33 @@ class IApplication(IContainer):
65
315
  def create(self) -> 'IApplication':
66
316
  """
67
317
  Bootstrap the application by loading providers and kernels.
68
-
318
+
69
319
  Returns
70
320
  -------
71
321
  IApplication
72
322
  The application instance for method chaining
73
323
  """
324
+ pass
325
+
326
+ @abstractmethod
327
+ def config(
328
+ self,
329
+ key: str,
330
+ default: Any = None
331
+ ) -> Any:
332
+ """
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
346
+ """
74
347
  pass
@@ -5,7 +5,7 @@
5
5
  NAME = "orionis"
6
6
 
7
7
  # Current version of the framework
8
- VERSION = "0.390.0"
8
+ VERSION = "0.392.0"
9
9
 
10
10
  # Full name of the author or maintainer of the project
11
11
  AUTHOR = "Raul Mauricio Uñate Castro"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: orionis
3
- Version: 0.390.0
3
+ Version: 0.392.0
4
4
  Summary: Orionis Framework – Elegant, Fast, and Powerful.
5
5
  Home-page: https://github.com/orionis-framework/framework
6
6
  Author: Raul Mauricio Uñate Castro
@@ -1,4 +1,6 @@
1
- orionis/__init__.py,sha256=-rB8tR3G95nmZEsp57IfPQL5fNV08HrP0CWuLTOzxEw,156
1
+ config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ config/app.py,sha256=MJOS_SXC8-xGqGzhxPXI1e8cbCS-rEkq5IPCMY4osWY,3724
3
+ orionis/__init__.py,sha256=4AGBG1xD3NjsqkmQ-fD3pde7tiO26iwOpdvJoNvP0kI,201
2
4
  orionis/_console/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
5
  orionis/_console/command_filter.py,sha256=bn0fcWfQg13DrQBaV4NopNxdP-6up0G54Qmhg7r_BKA,1211
4
6
  orionis/_console/kernel.py,sha256=M4Zc9x-1hrQP7Dq6Ons5UnGoq73XV1Fwa9cwY7zqWbw,883
@@ -146,7 +148,7 @@ orionis/container/validators/is_subclass.py,sha256=4sBaGLoRs8nUhuWjlP0VJqyTwVHYq
146
148
  orionis/container/validators/is_valid_alias.py,sha256=4uAYcq8xov7jZbXnpKpjNkxcZtlTNnL5RRctVPMwJes,1424
147
149
  orionis/container/validators/lifetime.py,sha256=IQ43fDNrxYHMlZH2zlYDJnlkLO_eS4U7Fs3UJgQBidI,1844
148
150
  orionis/foundation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
149
- orionis/foundation/application.py,sha256=HicY1ZiFLLPVSD21Pd3PofrvO_3tmRldQGuaMvlAZuA,6620
151
+ orionis/foundation/application.py,sha256=KzwTNRNKTyFk60zM2YzX908OWpX2tZV49LWG-Ll73vQ,21962
150
152
  orionis/foundation/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
151
153
  orionis/foundation/config/startup.py,sha256=zutF-34DkW68bpiTxH9xrmIe1iJdXCF9Y6wueXS6qys,8265
152
154
  orionis/foundation/config/app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -235,7 +237,7 @@ orionis/foundation/config/testing/entities/testing.py,sha256=keU7dSuRv0rgaG-T4Vo
235
237
  orionis/foundation/config/testing/enums/__init__.py,sha256=tCHed6wBzqHx8o3kWBGm8tZYkYOKdSAx8TvgC-Eauv0,75
236
238
  orionis/foundation/config/testing/enums/test_mode.py,sha256=IbFpauu7J-iSAfmC8jDbmTEYl8eZr-AexL-lyOh8_74,337
237
239
  orionis/foundation/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
238
- orionis/foundation/contracts/application.py,sha256=AR1SlIu6aUChLNx2PbZk1ZQgX9vgDrS51wMPaiF05O4,2217
240
+ orionis/foundation/contracts/application.py,sha256=rbR6sHgjcooIZGNYXtUGO5RLvG0c4iJxdhJ9PGfvycA,10011
239
241
  orionis/foundation/contracts/config.py,sha256=Rpz6U6t8OXHO9JJKSTnCimytXE-tfCB-1ithP2nG8MQ,628
240
242
  orionis/foundation/exceptions/__init__.py,sha256=XtG3MJ_MFNY_dU5mmTyz_N_4QG1jYrcv5RegBso7wuY,163
241
243
  orionis/foundation/exceptions/integrity.py,sha256=mc4pL1UMoYRHEmphnpW2oGk5URhu7DJRREyzHaV-cs8,472
@@ -247,7 +249,7 @@ orionis/foundation/providers/path_resolver_provider.py,sha256=rXvaVc5sSqmDgRzWJo
247
249
  orionis/foundation/providers/progress_bar_provider.py,sha256=75Jr4iEgUOUGl8Di1DioeP5_HRQlR-1lVzPmS96sWjA,737
248
250
  orionis/foundation/providers/workers_provider.py,sha256=WWlji3C69_-Y0c42aZDbR_bmcE_qZEh2SaA_cNkCivI,702
249
251
  orionis/metadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
250
- orionis/metadata/framework.py,sha256=4IaQW9cQElsqCRrzC5h3HRoeIleA_458JLSI8_OwCzg,4960
252
+ orionis/metadata/framework.py,sha256=NisdW45j_SD6TAcLF8gMsFcBApFsBQUUIv-dK8eH5yc,4960
251
253
  orionis/metadata/package.py,sha256=tqLfBRo-w1j_GN4xvzUNFyweWYFS-qhSgAEc-AmCH1M,5452
252
254
  orionis/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
253
255
  orionis/services/asynchrony/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -384,7 +386,7 @@ orionis/test/records/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hS
384
386
  orionis/test/records/logs.py,sha256=EOQcloMVdhlNl2lU9igQz8H4b-OtKtiwh2pgr_QZWOI,13186
385
387
  orionis/test/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
386
388
  orionis/test/view/render.py,sha256=zd7xDvVfmQ2HxZamDTzL2-z2PpyL99EaolbbM7wTah4,5014
387
- orionis-0.390.0.dist-info/licenses/LICENCE,sha256=-_4cF2EBKuYVS_SQpy1uapq0oJPUU1vl_RUWSy2jJTo,1111
389
+ orionis-0.392.0.dist-info/licenses/LICENCE,sha256=-_4cF2EBKuYVS_SQpy1uapq0oJPUU1vl_RUWSy2jJTo,1111
388
390
  tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
389
391
  tests/example/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
390
392
  tests/example/test_example.py,sha256=8G7kp74PZZ0Tdnw8WkheZ7lvZVFpdx_9ShOZBN9GEF0,25582
@@ -485,8 +487,8 @@ tests/support/wrapper/test_services_wrapper_docdict.py,sha256=nTNrvJkMSPx_aopEQ9
485
487
  tests/testing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
486
488
  tests/testing/test_testing_result.py,sha256=fnH7hjumNSErAFGITJgq2LHxSzvPF2tdtmHL9kyAv-Y,4409
487
489
  tests/testing/test_testing_unit.py,sha256=d3CRGo6608fMzYcZKIKapjx_af2aigqWiKSiuK9euIY,7600
488
- orionis-0.390.0.dist-info/METADATA,sha256=1ShLkVPP1VxI_7rCb6tiPjJlE1LqzB17JANoSQOV6FY,4772
489
- orionis-0.390.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
490
- orionis-0.390.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
491
- orionis-0.390.0.dist-info/zip-safe,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
492
- orionis-0.390.0.dist-info/RECORD,,
490
+ orionis-0.392.0.dist-info/METADATA,sha256=L0ZAamDSA8QCzLav3v6ap9XqDINAFWIC0Y0TTS7HLQk,4772
491
+ orionis-0.392.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
492
+ orionis-0.392.0.dist-info/top_level.txt,sha256=udNmZ4TdfoC-7CBFJO7HLpWggpCM71okNNgNVzgpjt4,21
493
+ orionis-0.392.0.dist-info/zip-safe,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
494
+ orionis-0.392.0.dist-info/RECORD,,
@@ -1,2 +1,3 @@
1
+ config
1
2
  orionis
2
3
  tests