orionis 0.583.0__py3-none-any.whl → 0.585.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 +40 -140
- 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.583.0.dist-info → orionis-0.585.0.dist-info}/METADATA +1 -1
- {orionis-0.583.0.dist-info → orionis-0.585.0.dist-info}/RECORD +13 -14
- orionis/app.py +0 -17
- {orionis-0.583.0.dist-info → orionis-0.585.0.dist-info}/WHEEL +0 -0
- {orionis-0.583.0.dist-info → orionis-0.585.0.dist-info}/licenses/LICENCE +0 -0
- {orionis-0.583.0.dist-info → orionis-0.585.0.dist-info}/top_level.txt +0 -0
@@ -1,7 +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.console.
|
4
|
+
from orionis.console.contracts.base_scheduler import IBaseScheduler
|
5
5
|
from orionis.failure.contracts.handler import IBaseExceptionHandler
|
6
6
|
from orionis.foundation.config.roots.paths import Paths
|
7
7
|
from orionis.container.contracts.service_provider import IServiceProvider
|
@@ -29,71 +29,76 @@ class IApplication(IContainer):
|
|
29
29
|
bootstrap operations.
|
30
30
|
"""
|
31
31
|
|
32
|
-
@property
|
33
32
|
@abstractmethod
|
34
|
-
def
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
Returns
|
39
|
-
-------
|
40
|
-
bool
|
41
|
-
True if the application has been successfully booted and is ready
|
42
|
-
for operation, False otherwise.
|
43
|
-
"""
|
44
|
-
pass
|
45
|
-
|
46
|
-
@property
|
47
|
-
@abstractmethod
|
48
|
-
def startAt(self) -> int:
|
49
|
-
"""
|
50
|
-
Get the application startup timestamp.
|
51
|
-
|
52
|
-
Returns
|
53
|
-
-------
|
54
|
-
int
|
55
|
-
The Unix timestamp representing when the application was started.
|
56
|
-
"""
|
57
|
-
pass
|
58
|
-
|
59
|
-
@abstractmethod
|
60
|
-
def withProviders(self, providers: List[Type[IServiceProvider]] = []) -> 'IApplication':
|
33
|
+
def withProviders(
|
34
|
+
self,
|
35
|
+
providers: List[Type[IServiceProvider]] = []
|
36
|
+
) -> 'IApplication':
|
61
37
|
"""
|
62
38
|
Register multiple service providers with the application.
|
63
39
|
|
40
|
+
This method provides a convenient way to add multiple service provider
|
41
|
+
classes to the application in a single call. Each provider in the list
|
42
|
+
will be validated and added to the internal providers collection.
|
43
|
+
|
64
44
|
Parameters
|
65
45
|
----------
|
66
46
|
providers : List[Type[IServiceProvider]], optional
|
67
|
-
A list of service provider classes
|
68
|
-
|
69
|
-
|
47
|
+
A list of service provider classes that implement IServiceProvider
|
48
|
+
interface. Each provider will be added to the application's provider
|
49
|
+
registry. Default is an empty list.
|
70
50
|
|
71
51
|
Returns
|
72
52
|
-------
|
73
|
-
|
74
|
-
The application instance to enable method chaining.
|
53
|
+
Application
|
54
|
+
The current application instance to enable method chaining.
|
55
|
+
|
56
|
+
Notes
|
57
|
+
-----
|
58
|
+
This method iterates through the provided list and calls addProvider()
|
59
|
+
for each provider class, which performs individual validation and
|
60
|
+
registration.
|
75
61
|
"""
|
76
62
|
pass
|
77
63
|
|
78
64
|
@abstractmethod
|
79
|
-
def addProvider(
|
65
|
+
def addProvider(
|
66
|
+
self,
|
67
|
+
provider: Type[IServiceProvider]
|
68
|
+
) -> 'IApplication':
|
80
69
|
"""
|
81
70
|
Register a single service provider with the application.
|
82
71
|
|
72
|
+
This method validates and adds a service provider class to the application's
|
73
|
+
provider registry. The provider must implement the IServiceProvider interface
|
74
|
+
and will be checked for duplicates before registration.
|
75
|
+
|
83
76
|
Parameters
|
84
77
|
----------
|
85
78
|
provider : Type[IServiceProvider]
|
86
|
-
|
87
|
-
The
|
88
|
-
|
79
|
+
A service provider class that implements the IServiceProvider interface.
|
80
|
+
The class will be instantiated and registered during the application
|
81
|
+
bootstrap process.
|
89
82
|
|
90
83
|
Returns
|
91
84
|
-------
|
92
|
-
|
93
|
-
The application instance to enable method chaining.
|
85
|
+
Application
|
86
|
+
The current application instance to enable method chaining.
|
87
|
+
|
88
|
+
Raises
|
89
|
+
------
|
90
|
+
OrionisTypeError
|
91
|
+
If the provider parameter is not a class type or does not implement
|
92
|
+
the IServiceProvider interface, or if the provider is already registered.
|
93
|
+
|
94
|
+
Notes
|
95
|
+
-----
|
96
|
+
Providers are stored as class references and will be instantiated during
|
97
|
+
the registration phase of the application bootstrap process.
|
94
98
|
"""
|
95
99
|
pass
|
96
100
|
|
101
|
+
@abstractmethod
|
97
102
|
def setExceptionHandler(
|
98
103
|
self,
|
99
104
|
handler: IBaseExceptionHandler
|
@@ -102,16 +107,16 @@ class IApplication(IContainer):
|
|
102
107
|
Register a custom exception handler class for the application.
|
103
108
|
|
104
109
|
This method allows you to specify a custom exception handler class that
|
105
|
-
inherits from
|
110
|
+
inherits from BaseExceptionHandler. The handler class will be used to
|
106
111
|
manage exceptions raised within the application, including reporting and
|
107
112
|
rendering error messages. The provided handler must be a class (not an
|
108
|
-
instance) and must inherit from
|
113
|
+
instance) and must inherit from BaseExceptionHandler.
|
109
114
|
|
110
115
|
Parameters
|
111
116
|
----------
|
112
|
-
handler : Type[
|
117
|
+
handler : Type[BaseExceptionHandler]
|
113
118
|
The exception handler class to be used by the application. Must be a
|
114
|
-
subclass of
|
119
|
+
subclass of BaseExceptionHandler.
|
115
120
|
|
116
121
|
Returns
|
117
122
|
-------
|
@@ -121,7 +126,7 @@ class IApplication(IContainer):
|
|
121
126
|
Raises
|
122
127
|
------
|
123
128
|
OrionisTypeError
|
124
|
-
If the provided handler is not a class or is not a subclass of
|
129
|
+
If the provided handler is not a class or is not a subclass of BaseExceptionHandler.
|
125
130
|
|
126
131
|
Notes
|
127
132
|
-----
|
@@ -130,6 +135,7 @@ class IApplication(IContainer):
|
|
130
135
|
"""
|
131
136
|
pass
|
132
137
|
|
138
|
+
@abstractmethod
|
133
139
|
def getExceptionHandler(
|
134
140
|
self
|
135
141
|
) -> IBaseExceptionHandler:
|
@@ -138,15 +144,15 @@ class IApplication(IContainer):
|
|
138
144
|
|
139
145
|
This method returns an instance of the exception handler that has been set using
|
140
146
|
the `setExceptionHandler` method. If no custom handler has been set, it returns
|
141
|
-
a default `
|
147
|
+
a default `BaseExceptionHandler` instance. The returned object is responsible
|
142
148
|
for handling exceptions within the application, including reporting and rendering
|
143
149
|
error messages.
|
144
150
|
|
145
151
|
Returns
|
146
152
|
-------
|
147
|
-
|
153
|
+
BaseExceptionHandler
|
148
154
|
An instance of the currently registered exception handler. If no handler
|
149
|
-
has been set, returns a default `
|
155
|
+
has been set, returns a default `BaseExceptionHandler` instance.
|
150
156
|
|
151
157
|
Notes
|
152
158
|
-----
|
@@ -159,7 +165,7 @@ class IApplication(IContainer):
|
|
159
165
|
@abstractmethod
|
160
166
|
def setScheduler(
|
161
167
|
self,
|
162
|
-
scheduler:
|
168
|
+
scheduler: IBaseScheduler
|
163
169
|
) -> 'IApplication':
|
164
170
|
"""
|
165
171
|
Register a custom scheduler class for the application.
|
@@ -196,7 +202,7 @@ class IApplication(IContainer):
|
|
196
202
|
@abstractmethod
|
197
203
|
def getScheduler(
|
198
204
|
self
|
199
|
-
) ->
|
205
|
+
) -> IBaseScheduler:
|
200
206
|
"""
|
201
207
|
Retrieve the currently registered scheduler instance.
|
202
208
|
|
@@ -233,675 +239,1010 @@ class IApplication(IContainer):
|
|
233
239
|
testing : Testing | dict = Testing()
|
234
240
|
) -> 'IApplication':
|
235
241
|
"""
|
236
|
-
Configure the application with
|
242
|
+
Configure the application with comprehensive service configuration objects.
|
237
243
|
|
238
|
-
This method
|
239
|
-
|
240
|
-
|
241
|
-
|
244
|
+
This method provides a centralized way to configure all major application
|
245
|
+
subsystems using either configuration entity instances or dictionary objects.
|
246
|
+
Each configurator manages settings for a specific aspect of the application
|
247
|
+
such as authentication, caching, database connectivity, logging, and more.
|
242
248
|
|
243
249
|
Parameters
|
244
250
|
----------
|
245
|
-
app : App
|
246
|
-
Application-level configuration settings
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
251
|
+
app : App or dict, optional
|
252
|
+
Application-level configuration including name, environment, debug settings,
|
253
|
+
and URL configuration. Default creates a new App() instance.
|
254
|
+
auth : Auth or dict, optional
|
255
|
+
Authentication system configuration including guards, providers, and
|
256
|
+
password settings. Default creates a new Auth() instance.
|
257
|
+
cache : Cache or dict, optional
|
258
|
+
Caching system configuration including default store, prefix settings,
|
259
|
+
and driver-specific options. Default creates a new Cache() instance.
|
260
|
+
cors : Cors or dict, optional
|
261
|
+
Cross-Origin Resource Sharing configuration including allowed origins,
|
262
|
+
methods, and headers. Default creates a new Cors() instance.
|
263
|
+
database : Database or dict, optional
|
264
|
+
Database connectivity configuration including default connection, migration
|
265
|
+
settings, and connection definitions. Default creates a new Database() instance.
|
266
|
+
filesystems : Filesystems or dict, optional
|
267
|
+
File storage system configuration including default disk, cloud storage
|
268
|
+
settings, and disk definitions. Default creates a new Filesystems() instance.
|
269
|
+
logging : Logging or dict, optional
|
270
|
+
Logging system configuration including default channel, log levels,
|
271
|
+
and channel definitions. Default creates a new Logging() instance.
|
272
|
+
mail : Mail or dict, optional
|
273
|
+
Email system configuration including default mailer, transport settings,
|
274
|
+
and mailer definitions. Default creates a new Mail() instance.
|
275
|
+
path : Paths or dict, optional
|
276
|
+
Application path configuration including directories for controllers,
|
277
|
+
models, views, and other application components. Default creates a new Paths() instance.
|
278
|
+
queue : Queue or dict, optional
|
279
|
+
Queue system configuration including default connection, worker settings,
|
280
|
+
and connection definitions. Default creates a new Queue() instance.
|
281
|
+
session : Session or dict, optional
|
282
|
+
Session management configuration including driver, lifetime, encryption,
|
283
|
+
and storage settings. Default creates a new Session() instance.
|
284
|
+
testing : Testing or dict, optional
|
285
|
+
Testing framework configuration including database settings, environment
|
286
|
+
variables, and test-specific options. Default creates a new Testing() instance.
|
269
287
|
|
270
288
|
Returns
|
271
289
|
-------
|
272
|
-
|
273
|
-
The application instance to enable method chaining.
|
274
|
-
"""
|
275
|
-
pass
|
276
|
-
|
277
|
-
@abstractmethod
|
278
|
-
def setConfigApp(self, **app_config) -> 'IApplication':
|
279
|
-
"""
|
280
|
-
Configure application settings using keyword arguments.
|
290
|
+
Application
|
291
|
+
The current application instance to enable method chaining.
|
281
292
|
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
parameter names.
|
293
|
+
Raises
|
294
|
+
------
|
295
|
+
OrionisTypeError
|
296
|
+
If any configurator parameter is not an instance of its expected type
|
297
|
+
or a dictionary that can be converted to the expected type.
|
288
298
|
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
299
|
+
Notes
|
300
|
+
-----
|
301
|
+
Each configurator is validated for type correctness and then passed to its
|
302
|
+
corresponding load method for processing and storage in the application's
|
303
|
+
configuration system.
|
293
304
|
"""
|
294
305
|
pass
|
295
306
|
|
296
307
|
@abstractmethod
|
297
|
-
def
|
308
|
+
def setConfigApp(
|
309
|
+
self,
|
310
|
+
**app_config
|
311
|
+
) -> 'IApplication':
|
298
312
|
"""
|
299
|
-
|
313
|
+
Configure the application using keyword arguments.
|
314
|
+
|
315
|
+
This method provides a convenient way to set application configuration
|
316
|
+
by passing individual configuration parameters as keyword arguments.
|
317
|
+
The parameters are used to create an App configuration instance.
|
300
318
|
|
301
319
|
Parameters
|
302
320
|
----------
|
303
|
-
|
304
|
-
|
305
|
-
|
321
|
+
**app_config : dict
|
322
|
+
Configuration parameters for the application. These must match the
|
323
|
+
field names and types expected by the App dataclass from
|
324
|
+
orionis.foundation.config.app.entities.app.App.
|
306
325
|
|
307
326
|
Returns
|
308
327
|
-------
|
309
|
-
|
310
|
-
The application instance to enable method chaining.
|
328
|
+
Application
|
329
|
+
The current application instance to enable method chaining.
|
330
|
+
|
331
|
+
Notes
|
332
|
+
-----
|
333
|
+
This method internally creates an App instance from the provided keyword
|
334
|
+
arguments and then calls loadConfigApp() to store the configuration.
|
311
335
|
"""
|
312
336
|
pass
|
313
337
|
|
314
338
|
@abstractmethod
|
315
|
-
def
|
339
|
+
def loadConfigApp(
|
340
|
+
self,
|
341
|
+
app: App | dict
|
342
|
+
) -> 'IApplication':
|
316
343
|
"""
|
317
|
-
|
344
|
+
Load and store application configuration from an App instance or dictionary.
|
345
|
+
|
346
|
+
This method validates and stores the application configuration in the
|
347
|
+
internal configurators storage. If a dictionary is provided, it will
|
348
|
+
be converted to an App instance before storage.
|
318
349
|
|
319
350
|
Parameters
|
320
351
|
----------
|
321
|
-
|
322
|
-
|
323
|
-
|
352
|
+
app : App or dict
|
353
|
+
The application configuration as either an App instance or a dictionary
|
354
|
+
containing configuration parameters that can be used to construct an
|
355
|
+
App instance.
|
324
356
|
|
325
357
|
Returns
|
326
358
|
-------
|
327
|
-
|
328
|
-
The application instance to enable method chaining.
|
359
|
+
Application
|
360
|
+
The current application instance to enable method chaining.
|
361
|
+
|
362
|
+
Raises
|
363
|
+
------
|
364
|
+
OrionisTypeError
|
365
|
+
If the app parameter is not an instance of App or a dictionary.
|
366
|
+
|
367
|
+
Notes
|
368
|
+
-----
|
369
|
+
Dictionary inputs are automatically converted to App instances using
|
370
|
+
the dictionary unpacking operator (**app).
|
329
371
|
"""
|
330
372
|
pass
|
331
373
|
|
332
374
|
@abstractmethod
|
333
|
-
def
|
375
|
+
def setConfigAuth(
|
376
|
+
self,
|
377
|
+
**auth_config
|
378
|
+
) -> 'IApplication':
|
334
379
|
"""
|
335
|
-
|
380
|
+
Configure the authentication system using keyword arguments.
|
381
|
+
|
382
|
+
This method provides a convenient way to set authentication configuration
|
383
|
+
by passing individual configuration parameters as keyword arguments.
|
384
|
+
The parameters are used to create an Auth configuration instance.
|
336
385
|
|
337
386
|
Parameters
|
338
387
|
----------
|
339
|
-
|
340
|
-
|
341
|
-
|
388
|
+
**auth_config : dict
|
389
|
+
Configuration parameters for authentication. These must match the
|
390
|
+
field names and types expected by the Auth dataclass from
|
391
|
+
orionis.foundation.config.auth.entities.auth.Auth.
|
342
392
|
|
343
393
|
Returns
|
344
394
|
-------
|
345
|
-
|
346
|
-
The application instance to enable method chaining.
|
395
|
+
Application
|
396
|
+
The current application instance to enable method chaining.
|
397
|
+
|
398
|
+
Notes
|
399
|
+
-----
|
400
|
+
This method internally creates an Auth instance from the provided keyword
|
401
|
+
arguments and then calls loadConfigAuth() to store the configuration.
|
347
402
|
"""
|
348
403
|
pass
|
349
404
|
|
350
405
|
@abstractmethod
|
351
|
-
def
|
406
|
+
def loadConfigAuth(
|
407
|
+
self,
|
408
|
+
auth: Auth | dict
|
409
|
+
) -> 'IApplication':
|
352
410
|
"""
|
353
|
-
|
411
|
+
Load and store authentication configuration from an Auth instance or dictionary.
|
412
|
+
|
413
|
+
This method validates and stores the authentication configuration in the
|
414
|
+
internal configurators storage. If a dictionary is provided, it will
|
415
|
+
be converted to an Auth instance before storage.
|
354
416
|
|
355
417
|
Parameters
|
356
418
|
----------
|
357
|
-
|
358
|
-
|
359
|
-
|
419
|
+
auth : Auth or dict
|
420
|
+
The authentication configuration as either an Auth instance or a dictionary
|
421
|
+
containing configuration parameters that can be used to construct an
|
422
|
+
Auth instance.
|
360
423
|
|
361
424
|
Returns
|
362
425
|
-------
|
363
|
-
|
364
|
-
The application instance to enable method chaining.
|
426
|
+
Application
|
427
|
+
The current application instance to enable method chaining.
|
428
|
+
|
429
|
+
Raises
|
430
|
+
------
|
431
|
+
OrionisTypeError
|
432
|
+
If the auth parameter is not an instance of Auth or a dictionary.
|
433
|
+
|
434
|
+
Notes
|
435
|
+
-----
|
436
|
+
Dictionary inputs are automatically converted to Auth instances using
|
437
|
+
the dictionary unpacking operator (**auth).
|
365
438
|
"""
|
366
439
|
pass
|
367
440
|
|
368
441
|
@abstractmethod
|
369
|
-
def
|
442
|
+
def setConfigCache(
|
443
|
+
self,
|
444
|
+
**cache_config
|
445
|
+
) -> 'IApplication':
|
370
446
|
"""
|
371
|
-
|
447
|
+
Configure the cache system using keyword arguments.
|
448
|
+
|
449
|
+
This method provides a convenient way to set cache configuration by
|
450
|
+
passing individual configuration parameters as keyword arguments.
|
451
|
+
The parameters are used to create a Cache configuration instance.
|
372
452
|
|
373
453
|
Parameters
|
374
454
|
----------
|
375
|
-
|
376
|
-
|
377
|
-
|
455
|
+
**cache_config : dict
|
456
|
+
Configuration parameters for the cache system. These must match the
|
457
|
+
field names and types expected by the Cache dataclass from
|
458
|
+
orionis.foundation.config.cache.entities.cache.Cache.
|
378
459
|
|
379
460
|
Returns
|
380
461
|
-------
|
381
|
-
|
382
|
-
The application instance to enable method chaining.
|
462
|
+
Application
|
463
|
+
The current application instance to enable method chaining.
|
464
|
+
|
465
|
+
Notes
|
466
|
+
-----
|
467
|
+
This method internally creates a Cache instance from the provided keyword
|
468
|
+
arguments and then calls loadConfigCache() to store the configuration.
|
383
469
|
"""
|
384
470
|
pass
|
385
471
|
|
386
472
|
@abstractmethod
|
387
|
-
def
|
473
|
+
def loadConfigCache(
|
474
|
+
self,
|
475
|
+
cache: Cache | dict
|
476
|
+
) -> 'IApplication':
|
388
477
|
"""
|
389
|
-
|
478
|
+
Load and store cache configuration from a Cache instance or dictionary.
|
479
|
+
|
480
|
+
This method validates and stores the cache configuration in the
|
481
|
+
internal configurators storage. If a dictionary is provided, it will
|
482
|
+
be converted to a Cache instance before storage.
|
390
483
|
|
391
484
|
Parameters
|
392
485
|
----------
|
393
|
-
|
394
|
-
|
395
|
-
configuration
|
486
|
+
cache : Cache or dict
|
487
|
+
The cache configuration as either a Cache instance or a dictionary
|
488
|
+
containing configuration parameters that can be used to construct a
|
489
|
+
Cache instance.
|
396
490
|
|
397
491
|
Returns
|
398
492
|
-------
|
399
|
-
|
400
|
-
The application instance to enable method chaining.
|
493
|
+
Application
|
494
|
+
The current application instance to enable method chaining.
|
495
|
+
|
496
|
+
Raises
|
497
|
+
------
|
498
|
+
OrionisTypeError
|
499
|
+
If the cache parameter is not an instance of Cache or a dictionary.
|
500
|
+
|
501
|
+
Notes
|
502
|
+
-----
|
503
|
+
Dictionary inputs are automatically converted to Cache instances using
|
504
|
+
the dictionary unpacking operator (**cache).
|
401
505
|
"""
|
402
506
|
pass
|
403
507
|
|
404
508
|
@abstractmethod
|
405
|
-
def
|
509
|
+
def setConfigCors(
|
510
|
+
self,
|
511
|
+
**cors_config
|
512
|
+
) -> 'IApplication':
|
406
513
|
"""
|
407
|
-
|
514
|
+
Configure the CORS (Cross-Origin Resource Sharing) system using keyword arguments.
|
515
|
+
|
516
|
+
This method provides a convenient way to set CORS configuration by
|
517
|
+
passing individual configuration parameters as keyword arguments.
|
518
|
+
The parameters are used to create a Cors configuration instance.
|
408
519
|
|
409
520
|
Parameters
|
410
521
|
----------
|
411
|
-
|
412
|
-
|
413
|
-
|
522
|
+
**cors_config : dict
|
523
|
+
Configuration parameters for CORS settings. These must match the
|
524
|
+
field names and types expected by the Cors dataclass from
|
525
|
+
orionis.foundation.config.cors.entities.cors.Cors.
|
414
526
|
|
415
527
|
Returns
|
416
528
|
-------
|
417
|
-
|
418
|
-
The application instance to enable method chaining.
|
529
|
+
Application
|
530
|
+
The current application instance to enable method chaining.
|
531
|
+
|
532
|
+
Notes
|
533
|
+
-----
|
534
|
+
This method internally creates a Cors instance from the provided keyword
|
535
|
+
arguments and then calls loadConfigCors() to store the configuration.
|
419
536
|
"""
|
420
537
|
pass
|
421
538
|
|
422
539
|
@abstractmethod
|
423
|
-
def
|
540
|
+
def loadConfigCors(
|
541
|
+
self,
|
542
|
+
cors: Cors | dict
|
543
|
+
) -> 'IApplication':
|
424
544
|
"""
|
425
|
-
|
545
|
+
Load and store CORS configuration from a Cors instance or dictionary.
|
546
|
+
|
547
|
+
This method validates and stores the CORS (Cross-Origin Resource Sharing)
|
548
|
+
configuration in the internal configurators storage. If a dictionary is
|
549
|
+
provided, it will be converted to a Cors instance before storage.
|
426
550
|
|
427
551
|
Parameters
|
428
552
|
----------
|
429
|
-
|
430
|
-
|
431
|
-
|
553
|
+
cors : Cors or dict
|
554
|
+
The CORS configuration as either a Cors instance or a dictionary
|
555
|
+
containing configuration parameters that can be used to construct a
|
556
|
+
Cors instance.
|
432
557
|
|
433
558
|
Returns
|
434
559
|
-------
|
435
|
-
|
436
|
-
The application instance to enable method chaining.
|
560
|
+
Application
|
561
|
+
The current application instance to enable method chaining.
|
562
|
+
|
563
|
+
Raises
|
564
|
+
------
|
565
|
+
OrionisTypeError
|
566
|
+
If the cors parameter is not an instance of Cors or a dictionary.
|
567
|
+
|
568
|
+
Notes
|
569
|
+
-----
|
570
|
+
Dictionary inputs are automatically converted to Cors instances using
|
571
|
+
the dictionary unpacking operator (**cors).
|
437
572
|
"""
|
438
573
|
pass
|
439
574
|
|
440
575
|
@abstractmethod
|
441
|
-
def
|
576
|
+
def setConfigDatabase(
|
577
|
+
self,
|
578
|
+
**database_config
|
579
|
+
) -> 'IApplication':
|
442
580
|
"""
|
443
|
-
|
581
|
+
Configure the database system using keyword arguments.
|
582
|
+
|
583
|
+
This method provides a convenient way to set database configuration by
|
584
|
+
passing individual configuration parameters as keyword arguments.
|
585
|
+
The parameters are used to create a Database configuration instance.
|
444
586
|
|
445
587
|
Parameters
|
446
588
|
----------
|
447
|
-
|
448
|
-
|
449
|
-
|
589
|
+
**database_config : dict
|
590
|
+
Configuration parameters for the database system. These must match the
|
591
|
+
field names and types expected by the Database dataclass from
|
592
|
+
orionis.foundation.config.database.entities.database.Database.
|
450
593
|
|
451
594
|
Returns
|
452
595
|
-------
|
453
|
-
|
454
|
-
The application instance to enable method chaining.
|
596
|
+
Application
|
597
|
+
The current application instance to enable method chaining.
|
598
|
+
|
599
|
+
Notes
|
600
|
+
-----
|
601
|
+
This method internally creates a Database instance from the provided keyword
|
602
|
+
arguments and then calls loadConfigDatabase() to store the configuration.
|
455
603
|
"""
|
456
604
|
pass
|
457
605
|
|
458
606
|
@abstractmethod
|
459
|
-
def
|
607
|
+
def loadConfigDatabase(
|
608
|
+
self,
|
609
|
+
database: Database | dict
|
610
|
+
) -> 'IApplication':
|
460
611
|
"""
|
461
|
-
|
612
|
+
Load and store database configuration from a Database instance or dictionary.
|
613
|
+
|
614
|
+
This method validates and stores the database configuration in the
|
615
|
+
internal configurators storage. If a dictionary is provided, it will
|
616
|
+
be converted to a Database instance before storage.
|
462
617
|
|
463
618
|
Parameters
|
464
619
|
----------
|
465
|
-
|
466
|
-
|
467
|
-
|
620
|
+
database : Database or dict
|
621
|
+
The database configuration as either a Database instance or a dictionary
|
622
|
+
containing configuration parameters that can be used to construct a
|
623
|
+
Database instance.
|
468
624
|
|
469
625
|
Returns
|
470
626
|
-------
|
471
|
-
|
472
|
-
The application instance to enable method chaining.
|
627
|
+
Application
|
628
|
+
The current application instance to enable method chaining.
|
629
|
+
|
630
|
+
Raises
|
631
|
+
------
|
632
|
+
OrionisTypeError
|
633
|
+
If the database parameter is not an instance of Database or a dictionary.
|
634
|
+
|
635
|
+
Notes
|
636
|
+
-----
|
637
|
+
Dictionary inputs are automatically converted to Database instances using
|
638
|
+
the dictionary unpacking operator (**database).
|
473
639
|
"""
|
474
640
|
pass
|
475
641
|
|
476
642
|
@abstractmethod
|
477
|
-
def
|
643
|
+
def setConfigFilesystems(
|
644
|
+
self,
|
645
|
+
**filesystems_config
|
646
|
+
) -> 'IApplication':
|
478
647
|
"""
|
479
|
-
|
648
|
+
Configure the filesystems using keyword arguments.
|
649
|
+
|
650
|
+
This method provides a convenient way to set filesystem configuration by
|
651
|
+
passing individual configuration parameters as keyword arguments.
|
652
|
+
The parameters are used to create a Filesystems configuration instance.
|
480
653
|
|
481
654
|
Parameters
|
482
655
|
----------
|
483
|
-
|
484
|
-
|
485
|
-
|
656
|
+
**filesystems_config : dict
|
657
|
+
Configuration parameters for the filesystems. These must match the
|
658
|
+
field names and types expected by the Filesystems dataclass from
|
659
|
+
orionis.foundation.config.filesystems.entitites.filesystems.Filesystems.
|
486
660
|
|
487
661
|
Returns
|
488
662
|
-------
|
489
|
-
|
490
|
-
The application instance to enable method chaining.
|
663
|
+
Application
|
664
|
+
The current application instance to enable method chaining.
|
665
|
+
|
666
|
+
Notes
|
667
|
+
-----
|
668
|
+
This method internally creates a Filesystems instance from the provided keyword
|
669
|
+
arguments and then calls loadConfigFilesystems() to store the configuration.
|
491
670
|
"""
|
492
671
|
pass
|
493
672
|
|
494
673
|
@abstractmethod
|
495
|
-
def
|
674
|
+
def loadConfigFilesystems(
|
675
|
+
self,
|
676
|
+
filesystems: Filesystems | dict
|
677
|
+
) -> 'IApplication':
|
496
678
|
"""
|
497
|
-
|
679
|
+
Load and store filesystems configuration from a Filesystems instance or dictionary.
|
680
|
+
|
681
|
+
This method validates and stores the filesystems configuration in the
|
682
|
+
internal configurators storage. If a dictionary is provided, it will
|
683
|
+
be converted to a Filesystems instance before storage.
|
498
684
|
|
499
685
|
Parameters
|
500
686
|
----------
|
501
|
-
|
502
|
-
|
503
|
-
|
687
|
+
filesystems : Filesystems or dict
|
688
|
+
The filesystems configuration as either a Filesystems instance or a dictionary
|
689
|
+
containing configuration parameters that can be used to construct a
|
690
|
+
Filesystems instance.
|
504
691
|
|
505
692
|
Returns
|
506
693
|
-------
|
507
|
-
|
508
|
-
The application instance to enable method chaining.
|
694
|
+
Application
|
695
|
+
The current application instance to enable method chaining.
|
696
|
+
|
697
|
+
Raises
|
698
|
+
------
|
699
|
+
OrionisTypeError
|
700
|
+
If the filesystems parameter is not an instance of Filesystems or a dictionary.
|
701
|
+
|
702
|
+
Notes
|
703
|
+
-----
|
704
|
+
Dictionary inputs are automatically converted to Filesystems instances using
|
705
|
+
the dictionary unpacking operator (**filesystems).
|
509
706
|
"""
|
510
707
|
pass
|
511
708
|
|
512
709
|
@abstractmethod
|
513
|
-
def
|
710
|
+
def setConfigLogging(
|
711
|
+
self,
|
712
|
+
**logging_config
|
713
|
+
) -> 'IApplication':
|
514
714
|
"""
|
515
|
-
|
715
|
+
Configure the logging system using keyword arguments.
|
716
|
+
|
717
|
+
This method provides a convenient way to set logging configuration by
|
718
|
+
passing individual configuration parameters as keyword arguments.
|
719
|
+
The parameters are used to create a Logging configuration instance.
|
516
720
|
|
517
721
|
Parameters
|
518
722
|
----------
|
519
|
-
|
520
|
-
|
521
|
-
|
723
|
+
**logging_config : dict
|
724
|
+
Configuration parameters for the logging system. These must match the
|
725
|
+
field names and types expected by the Logging dataclass from
|
726
|
+
orionis.foundation.config.logging.entities.logging.Logging.
|
522
727
|
|
523
728
|
Returns
|
524
729
|
-------
|
525
|
-
|
526
|
-
The application instance to enable method chaining.
|
730
|
+
Application
|
731
|
+
The current application instance to enable method chaining.
|
732
|
+
|
733
|
+
Notes
|
734
|
+
-----
|
735
|
+
This method internally creates a Logging instance from the provided keyword
|
736
|
+
arguments and then calls loadConfigLogging() to store the configuration.
|
527
737
|
"""
|
528
738
|
pass
|
529
739
|
|
530
740
|
@abstractmethod
|
531
|
-
def
|
741
|
+
def loadConfigLogging(
|
742
|
+
self,
|
743
|
+
logging: Logging | dict
|
744
|
+
) -> 'IApplication':
|
532
745
|
"""
|
533
|
-
|
746
|
+
Load and store logging configuration from a Logging instance or dictionary.
|
747
|
+
|
748
|
+
This method validates and stores the logging configuration in the
|
749
|
+
internal configurators storage. If a dictionary is provided, it will
|
750
|
+
be converted to a Logging instance before storage.
|
534
751
|
|
535
752
|
Parameters
|
536
753
|
----------
|
537
|
-
|
538
|
-
|
539
|
-
|
754
|
+
logging : Logging or dict
|
755
|
+
The logging configuration as either a Logging instance or a dictionary
|
756
|
+
containing configuration parameters that can be used to construct a
|
757
|
+
Logging instance.
|
540
758
|
|
541
759
|
Returns
|
542
760
|
-------
|
543
|
-
|
544
|
-
The application instance to enable method chaining.
|
761
|
+
Application
|
762
|
+
The current application instance to enable method chaining.
|
763
|
+
|
764
|
+
Raises
|
765
|
+
------
|
766
|
+
OrionisTypeError
|
767
|
+
If the logging parameter is not an instance of Logging or a dictionary.
|
768
|
+
|
769
|
+
Notes
|
770
|
+
-----
|
771
|
+
Dictionary inputs are automatically converted to Logging instances using
|
772
|
+
the dictionary unpacking operator (**logging).
|
545
773
|
"""
|
546
774
|
pass
|
547
775
|
|
548
776
|
@abstractmethod
|
549
|
-
def
|
777
|
+
def setConfigMail(
|
778
|
+
self,
|
779
|
+
**mail_config
|
780
|
+
) -> 'IApplication':
|
550
781
|
"""
|
551
|
-
|
782
|
+
Configure the mail system using keyword arguments.
|
783
|
+
|
784
|
+
This method provides a convenient way to set mail configuration by
|
785
|
+
passing individual configuration parameters as keyword arguments.
|
786
|
+
The parameters are used to create a Mail configuration instance.
|
552
787
|
|
553
788
|
Parameters
|
554
789
|
----------
|
555
|
-
|
556
|
-
|
557
|
-
|
790
|
+
**mail_config : dict
|
791
|
+
Configuration parameters for the mail system. These must match the
|
792
|
+
field names and types expected by the Mail dataclass from
|
793
|
+
orionis.foundation.config.mail.entities.mail.Mail.
|
558
794
|
|
559
795
|
Returns
|
560
796
|
-------
|
561
|
-
|
562
|
-
The application instance to enable method chaining.
|
797
|
+
Application
|
798
|
+
The current application instance to enable method chaining.
|
799
|
+
|
800
|
+
Notes
|
801
|
+
-----
|
802
|
+
This method internally creates a Mail instance from the provided keyword
|
803
|
+
arguments and then calls loadConfigMail() to store the configuration.
|
563
804
|
"""
|
564
805
|
pass
|
565
806
|
|
566
807
|
@abstractmethod
|
567
|
-
def
|
808
|
+
def loadConfigMail(
|
568
809
|
self,
|
569
|
-
|
570
|
-
root: str | Path = Path.cwd().resolve(),
|
571
|
-
commands: str | Path = (Path.cwd() / 'app' / 'console' / 'commands').resolve(),
|
572
|
-
controllers: str | Path = (Path.cwd() / 'app' / 'http' / 'controllers').resolve(),
|
573
|
-
middleware: str | Path = (Path.cwd() / 'app' / 'http' / 'middleware').resolve(),
|
574
|
-
requests: str | Path = (Path.cwd() / 'app' / 'http' / 'requests').resolve(),
|
575
|
-
models: str | Path = (Path.cwd() / 'app' / 'models').resolve(),
|
576
|
-
providers: str | Path = (Path.cwd() / 'app' / 'providers').resolve(),
|
577
|
-
events: str | Path = (Path.cwd() / 'app' / 'events').resolve(),
|
578
|
-
listeners: str | Path = (Path.cwd() / 'app' / 'listeners').resolve(),
|
579
|
-
notifications: str | Path = (Path.cwd() / 'app' / 'notifications').resolve(),
|
580
|
-
jobs: str | Path = (Path.cwd() / 'app' / 'jobs').resolve(),
|
581
|
-
policies: str | Path = (Path.cwd() / 'app' / 'policies').resolve(),
|
582
|
-
exceptions: str | Path = (Path.cwd() / 'app' / 'exceptions').resolve(),
|
583
|
-
services: str | Path = (Path.cwd() / 'app' / 'services').resolve(),
|
584
|
-
views: str | Path = (Path.cwd() / 'resources' / 'views').resolve(),
|
585
|
-
lang: str | Path = (Path.cwd() / 'resources' / 'lang').resolve(),
|
586
|
-
assets: str | Path = (Path.cwd() / 'resources' / 'assets').resolve(),
|
587
|
-
routes: str | Path = (Path.cwd() / 'routes').resolve(),
|
588
|
-
config: str | Path = (Path.cwd() / 'config').resolve(),
|
589
|
-
migrations: str | Path = (Path.cwd() / 'database' / 'migrations').resolve(),
|
590
|
-
seeders: str | Path = (Path.cwd() / 'database' / 'seeders').resolve(),
|
591
|
-
factories: str | Path = (Path.cwd() / 'database' / 'factories').resolve(),
|
592
|
-
logs: str | Path = (Path.cwd() / 'storage' / 'logs').resolve(),
|
593
|
-
sessions: str | Path = (Path.cwd() / 'storage' / 'framework' / 'sessions').resolve(),
|
594
|
-
cache: str | Path = (Path.cwd() / 'storage' / 'framework' / 'cache').resolve(),
|
595
|
-
testing: str | Path = (Path.cwd() / 'storage' / 'framework' / 'testing').resolve(),
|
596
|
-
storage: str | Path = (Path.cwd() / 'storage').resolve()
|
810
|
+
mail: Mail | dict
|
597
811
|
) -> 'IApplication':
|
598
812
|
"""
|
599
|
-
|
813
|
+
Load and store mail configuration from a Mail instance or dictionary.
|
600
814
|
|
601
|
-
This method
|
602
|
-
|
603
|
-
|
604
|
-
paths and stored as strings in the configuration dictionary.
|
815
|
+
This method validates and stores the mail configuration in the
|
816
|
+
internal configurators storage. If a dictionary is provided, it will
|
817
|
+
be converted to a Mail instance before storage.
|
605
818
|
|
606
819
|
Parameters
|
607
820
|
----------
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
controllers : str or Path, optional
|
613
|
-
Directory for HTTP controller classes. Defaults to 'app/http/controllers'.
|
614
|
-
middleware : str or Path, optional
|
615
|
-
Directory for HTTP middleware classes. Defaults to 'app/http/middleware'.
|
616
|
-
requests : str or Path, optional
|
617
|
-
Directory for HTTP request classes. Defaults to 'app/http/requests'.
|
618
|
-
models : str or Path, optional
|
619
|
-
Directory for data model classes. Defaults to 'app/models'.
|
620
|
-
providers : str or Path, optional
|
621
|
-
Directory for service provider classes. Defaults to 'app/providers'.
|
622
|
-
events : str or Path, optional
|
623
|
-
Directory for event classes. Defaults to 'app/events'.
|
624
|
-
listeners : str or Path, optional
|
625
|
-
Directory for event listener classes. Defaults to 'app/listeners'.
|
626
|
-
notifications : str or Path, optional
|
627
|
-
Directory for notification classes. Defaults to 'app/notifications'.
|
628
|
-
jobs : str or Path, optional
|
629
|
-
Directory for queue job classes. Defaults to 'app/jobs'.
|
630
|
-
policies : str or Path, optional
|
631
|
-
Directory for authorization policy classes. Defaults to 'app/policies'.
|
632
|
-
exceptions : str or Path, optional
|
633
|
-
Directory for custom exception classes. Defaults to 'app/exceptions'.
|
634
|
-
services : str or Path, optional
|
635
|
-
Directory for application service classes. Defaults to 'app/services'.
|
636
|
-
views : str or Path, optional
|
637
|
-
Directory for view templates. Defaults to 'resources/views'.
|
638
|
-
lang : str or Path, optional
|
639
|
-
Directory for language files. Defaults to 'resources/lang'.
|
640
|
-
assets : str or Path, optional
|
641
|
-
Directory for asset files. Defaults to 'resources/assets'.
|
642
|
-
routes : str or Path, optional
|
643
|
-
Directory for route definitions. Defaults to 'routes'.
|
644
|
-
config : str or Path, optional
|
645
|
-
Directory for configuration files. Defaults to 'config'.
|
646
|
-
migrations : str or Path, optional
|
647
|
-
Directory for database migration files. Defaults to 'database/migrations'.
|
648
|
-
seeders : str or Path, optional
|
649
|
-
Directory for database seeder files. Defaults to 'database/seeders'.
|
650
|
-
factories : str or Path, optional
|
651
|
-
Directory for model factory files. Defaults to 'database/factories'.
|
652
|
-
logs : str or Path, optional
|
653
|
-
Directory for log file storage. Defaults to 'storage/logs'.
|
654
|
-
sessions : str or Path, optional
|
655
|
-
Directory for session file storage. Defaults to 'storage/framework/sessions'.
|
656
|
-
cache : str or Path, optional
|
657
|
-
Directory for cache file storage. Defaults to 'storage/framework/cache'.
|
658
|
-
testing : str or Path, optional
|
659
|
-
Directory for testing file storage. Defaults to 'storage/framework/testing'.
|
821
|
+
mail : Mail or dict
|
822
|
+
The mail configuration as either a Mail instance or a dictionary
|
823
|
+
containing configuration parameters that can be used to construct a
|
824
|
+
Mail instance.
|
660
825
|
|
661
826
|
Returns
|
662
827
|
-------
|
663
828
|
Application
|
664
|
-
|
829
|
+
The current application instance to enable method chaining.
|
830
|
+
|
831
|
+
Raises
|
832
|
+
------
|
833
|
+
OrionisTypeError
|
834
|
+
If the mail parameter is not an instance of Mail or a dictionary.
|
665
835
|
|
666
836
|
Notes
|
667
837
|
-----
|
668
|
-
|
669
|
-
|
670
|
-
resolved paths are stored as strings in the internal configuration dictionary.
|
838
|
+
Dictionary inputs are automatically converted to Mail instances using
|
839
|
+
the dictionary unpacking operator (**mail).
|
671
840
|
"""
|
672
841
|
pass
|
673
842
|
|
674
843
|
@abstractmethod
|
675
|
-
def
|
844
|
+
def setConfigQueue(
|
845
|
+
self,
|
846
|
+
**queue_config
|
847
|
+
) -> 'IApplication':
|
676
848
|
"""
|
677
|
-
|
849
|
+
Configure the queue system using keyword arguments.
|
850
|
+
|
851
|
+
This method provides a convenient way to set queue configuration by
|
852
|
+
passing individual configuration parameters as keyword arguments.
|
853
|
+
The parameters are used to create a Queue configuration instance.
|
678
854
|
|
679
855
|
Parameters
|
680
856
|
----------
|
681
|
-
|
682
|
-
|
683
|
-
|
857
|
+
**queue_config : dict
|
858
|
+
Configuration parameters for the queue system. These must match the
|
859
|
+
field names and types expected by the Queue dataclass from
|
860
|
+
orionis.foundation.config.queue.entities.queue.Queue.
|
684
861
|
|
685
862
|
Returns
|
686
863
|
-------
|
687
|
-
|
688
|
-
The application instance to enable method chaining.
|
864
|
+
Application
|
865
|
+
The current application instance to enable method chaining.
|
866
|
+
|
867
|
+
Notes
|
868
|
+
-----
|
869
|
+
This method internally creates a Queue instance from the provided keyword
|
870
|
+
arguments and then calls loadConfigQueue() to store the configuration.
|
689
871
|
"""
|
690
872
|
pass
|
691
873
|
|
692
874
|
@abstractmethod
|
693
|
-
def
|
875
|
+
def loadConfigQueue(
|
694
876
|
self,
|
695
|
-
|
877
|
+
queue: Queue | dict
|
696
878
|
) -> 'IApplication':
|
697
879
|
"""
|
698
|
-
|
880
|
+
Load and store queue configuration from a Queue instance or dictionary.
|
699
881
|
|
700
|
-
This method
|
701
|
-
|
702
|
-
|
882
|
+
This method validates and stores the queue configuration in the
|
883
|
+
internal configurators storage. If a dictionary is provided, it will
|
884
|
+
be converted to a Queue instance before storage.
|
703
885
|
|
704
886
|
Parameters
|
705
887
|
----------
|
706
|
-
|
707
|
-
The
|
888
|
+
queue : Queue or dict
|
889
|
+
The queue configuration as either a Queue instance or a dictionary
|
890
|
+
containing configuration parameters that can be used to construct a
|
891
|
+
Queue instance.
|
708
892
|
|
709
893
|
Returns
|
710
894
|
-------
|
711
895
|
Application
|
712
896
|
The current application instance to enable method chaining.
|
713
|
-
"""
|
714
|
-
pass
|
715
897
|
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
"""
|
721
|
-
Get the base path of the application.
|
722
|
-
|
723
|
-
This method returns the base path that was previously set using setBasePath().
|
724
|
-
If no base path has been set, it returns None.
|
898
|
+
Raises
|
899
|
+
------
|
900
|
+
OrionisTypeError
|
901
|
+
If the queue parameter is not an instance of Queue or a dictionary.
|
725
902
|
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
903
|
+
Notes
|
904
|
+
-----
|
905
|
+
Dictionary inputs are automatically converted to Queue instances using
|
906
|
+
the dictionary unpacking operator (**queue).
|
730
907
|
"""
|
731
908
|
pass
|
732
909
|
|
733
910
|
@abstractmethod
|
734
|
-
def
|
911
|
+
def setConfigSession(
|
912
|
+
self,
|
913
|
+
**session_config
|
914
|
+
) -> 'IApplication':
|
735
915
|
"""
|
736
|
-
Configure
|
916
|
+
Configure the session system using keyword arguments.
|
917
|
+
|
918
|
+
This method provides a convenient way to set session configuration by
|
919
|
+
passing individual configuration parameters as keyword arguments.
|
920
|
+
The parameters are used to create a Session configuration instance.
|
737
921
|
|
738
922
|
Parameters
|
739
923
|
----------
|
740
|
-
**
|
741
|
-
|
742
|
-
|
924
|
+
**session_config : dict
|
925
|
+
Configuration parameters for the session system. These must match the
|
926
|
+
field names and types expected by the Session dataclass from
|
927
|
+
orionis.foundation.config.session.entities.session.Session.
|
743
928
|
|
744
929
|
Returns
|
745
930
|
-------
|
746
|
-
|
747
|
-
The application instance to enable method chaining.
|
931
|
+
Application
|
932
|
+
The current application instance to enable method chaining.
|
933
|
+
|
934
|
+
Notes
|
935
|
+
-----
|
936
|
+
This method internally creates a Session instance from the provided keyword
|
937
|
+
arguments and then calls loadConfigSession() to store the configuration.
|
748
938
|
"""
|
749
939
|
pass
|
750
940
|
|
751
941
|
@abstractmethod
|
752
|
-
def
|
942
|
+
def loadConfigSession(
|
943
|
+
self,
|
944
|
+
session: Session | dict
|
945
|
+
) -> 'IApplication':
|
753
946
|
"""
|
754
|
-
Load
|
947
|
+
Load and store session configuration from a Session instance or dictionary.
|
948
|
+
|
949
|
+
This method validates and stores the session configuration in the
|
950
|
+
internal configurators storage. If a dictionary is provided, it will
|
951
|
+
be converted to a Session instance before storage.
|
755
952
|
|
756
953
|
Parameters
|
757
954
|
----------
|
758
|
-
|
759
|
-
|
760
|
-
|
955
|
+
session : Session or dict
|
956
|
+
The session configuration as either a Session instance or a dictionary
|
957
|
+
containing configuration parameters that can be used to construct a
|
958
|
+
Session instance.
|
761
959
|
|
762
960
|
Returns
|
763
961
|
-------
|
764
|
-
|
765
|
-
The application instance to enable method chaining.
|
962
|
+
Application
|
963
|
+
The current application instance to enable method chaining.
|
964
|
+
|
965
|
+
Raises
|
966
|
+
------
|
967
|
+
OrionisTypeError
|
968
|
+
If the session parameter is not an instance of Session or a dictionary.
|
969
|
+
|
970
|
+
Notes
|
971
|
+
-----
|
972
|
+
Dictionary inputs are automatically converted to Session instances using
|
973
|
+
the dictionary unpacking operator (**session).
|
766
974
|
"""
|
767
975
|
pass
|
768
976
|
|
769
977
|
@abstractmethod
|
770
|
-
def
|
978
|
+
def setConfigTesting(
|
979
|
+
self,
|
980
|
+
**testing_config
|
981
|
+
) -> 'IApplication':
|
771
982
|
"""
|
772
|
-
Configure
|
983
|
+
Configure the testing framework using keyword arguments.
|
984
|
+
|
985
|
+
This method provides a convenient way to set testing configuration by
|
986
|
+
passing individual configuration parameters as keyword arguments.
|
987
|
+
The parameters are used to create a Testing configuration instance.
|
773
988
|
|
774
989
|
Parameters
|
775
990
|
----------
|
776
|
-
**
|
777
|
-
|
778
|
-
|
991
|
+
**testing_config : dict
|
992
|
+
Configuration parameters for the testing framework. These must match the
|
993
|
+
field names and types expected by the Testing dataclass from
|
994
|
+
orionis.foundation.config.testing.entities.testing.Testing.
|
779
995
|
|
780
996
|
Returns
|
781
997
|
-------
|
782
|
-
|
783
|
-
The application instance to enable method chaining.
|
998
|
+
Application
|
999
|
+
The current application instance to enable method chaining.
|
1000
|
+
|
1001
|
+
Notes
|
1002
|
+
-----
|
1003
|
+
This method internally creates a Testing instance from the provided keyword
|
1004
|
+
arguments and then calls loadConfigTesting() to store the configuration.
|
784
1005
|
"""
|
785
1006
|
pass
|
786
1007
|
|
787
1008
|
@abstractmethod
|
788
|
-
def
|
1009
|
+
def loadConfigTesting(
|
1010
|
+
self,
|
1011
|
+
testing: Testing | dict
|
1012
|
+
) -> 'IApplication':
|
789
1013
|
"""
|
790
|
-
Load
|
1014
|
+
Load and store testing configuration from a Testing instance or dictionary.
|
1015
|
+
|
1016
|
+
This method validates and stores the testing framework configuration in the
|
1017
|
+
internal configurators storage. If a dictionary is provided, it will be
|
1018
|
+
converted to a Testing instance before storage.
|
791
1019
|
|
792
1020
|
Parameters
|
793
1021
|
----------
|
794
|
-
|
795
|
-
|
796
|
-
|
1022
|
+
testing : Testing or dict
|
1023
|
+
The testing configuration as either a Testing instance or a dictionary
|
1024
|
+
containing configuration parameters that can be used to construct a
|
1025
|
+
Testing instance.
|
797
1026
|
|
798
1027
|
Returns
|
799
1028
|
-------
|
800
|
-
|
801
|
-
The application instance to enable method chaining.
|
1029
|
+
Application
|
1030
|
+
The current application instance to enable method chaining.
|
1031
|
+
|
1032
|
+
Raises
|
1033
|
+
------
|
1034
|
+
OrionisTypeError
|
1035
|
+
If the testing parameter is not an instance of Testing or a dictionary.
|
1036
|
+
|
1037
|
+
Notes
|
1038
|
+
-----
|
1039
|
+
Dictionary inputs are automatically converted to Testing instances using
|
1040
|
+
the dictionary unpacking operator (**testing).
|
802
1041
|
"""
|
803
1042
|
pass
|
804
1043
|
|
805
1044
|
@abstractmethod
|
806
|
-
def
|
1045
|
+
def setConfigPaths(
|
1046
|
+
self,
|
1047
|
+
*,
|
1048
|
+
root: str | Path = str(Path.cwd().resolve()),
|
1049
|
+
app: str | Path = str((Path.cwd() / 'app').resolve()),
|
1050
|
+
console: str | Path = str((Path.cwd() / 'app' / 'console').resolve()),
|
1051
|
+
exceptions: str | Path = str((Path.cwd() / 'app' / 'exceptions').resolve()),
|
1052
|
+
http: str | Path = str((Path.cwd() / 'app' / 'http').resolve()),
|
1053
|
+
models: str | Path = str((Path.cwd() / 'app' / 'models').resolve()),
|
1054
|
+
providers: str | Path = str((Path.cwd() / 'app' / 'providers').resolve()),
|
1055
|
+
notifications: str | Path = str((Path.cwd() / 'app' / 'notifications').resolve()),
|
1056
|
+
services: str | Path = str((Path.cwd() / 'app' / 'services').resolve()),
|
1057
|
+
jobs: str | Path = str((Path.cwd() / 'app' / 'jobs').resolve()),
|
1058
|
+
bootstrap: str | Path = str((Path.cwd() / 'app' / 'bootstrap').resolve()),
|
1059
|
+
config: str | Path = str((Path.cwd() / 'config').resolve()),
|
1060
|
+
database: str | Path = str((Path.cwd() / 'database' / 'database').resolve()),
|
1061
|
+
resources: str | Path = str((Path.cwd() / 'resources').resolve()),
|
1062
|
+
routes: str | Path = str((Path.cwd() / 'routes').resolve()),
|
1063
|
+
storage: str | Path = str((Path.cwd() / 'storage').resolve()),
|
1064
|
+
tests: str | Path = str((Path.cwd() / 'tests').resolve())
|
1065
|
+
) -> 'IApplication':
|
807
1066
|
"""
|
808
|
-
|
1067
|
+
Set and resolve application directory paths using keyword arguments.
|
809
1068
|
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
1069
|
+
Only the following options are available:
|
1070
|
+
- root
|
1071
|
+
- app
|
1072
|
+
- console
|
1073
|
+
- exceptions
|
1074
|
+
- http
|
1075
|
+
- models
|
1076
|
+
- providers
|
1077
|
+
- notifications
|
1078
|
+
- services
|
1079
|
+
- jobs
|
1080
|
+
- bootstrap
|
1081
|
+
- config
|
1082
|
+
- database
|
1083
|
+
- resources
|
1084
|
+
- routes
|
1085
|
+
- storage
|
1086
|
+
- tests
|
1087
|
+
|
1088
|
+
All provided paths are resolved to absolute paths and stored as strings in the configuration dictionary.
|
815
1089
|
|
816
1090
|
Returns
|
817
1091
|
-------
|
818
|
-
|
819
|
-
|
1092
|
+
Application
|
1093
|
+
Returns the current Application instance to enable method chaining.
|
820
1094
|
"""
|
821
1095
|
pass
|
822
1096
|
|
823
1097
|
@abstractmethod
|
824
|
-
def
|
1098
|
+
def loadConfigPaths(
|
1099
|
+
self,
|
1100
|
+
paths: Paths | dict
|
1101
|
+
) -> 'IApplication':
|
825
1102
|
"""
|
826
|
-
Load
|
1103
|
+
Load and store path configuration from a Paths instance or dictionary.
|
1104
|
+
|
1105
|
+
This method validates and stores the application path configuration in the
|
1106
|
+
internal configurators storage. If a dictionary is provided, it will be
|
1107
|
+
converted to a Paths instance before storage.
|
827
1108
|
|
828
1109
|
Parameters
|
829
1110
|
----------
|
830
|
-
|
831
|
-
|
832
|
-
|
1111
|
+
paths : Paths or dict
|
1112
|
+
The path configuration as either a Paths instance or a dictionary
|
1113
|
+
containing path parameters that can be used to construct a Paths instance.
|
833
1114
|
|
834
1115
|
Returns
|
835
1116
|
-------
|
836
|
-
|
837
|
-
The application instance to enable method chaining.
|
1117
|
+
Application
|
1118
|
+
The current application instance to enable method chaining.
|
1119
|
+
|
1120
|
+
Raises
|
1121
|
+
------
|
1122
|
+
OrionisTypeError
|
1123
|
+
If the paths parameter is not an instance of Paths or a dictionary.
|
1124
|
+
|
1125
|
+
Notes
|
1126
|
+
-----
|
1127
|
+
Dictionary inputs are automatically converted to Paths instances using
|
1128
|
+
the dictionary unpacking operator (**paths). This method is used internally
|
1129
|
+
by withConfigurators() and can be called directly for path configuration.
|
838
1130
|
"""
|
839
1131
|
pass
|
840
1132
|
|
841
1133
|
@abstractmethod
|
842
|
-
def config(
|
1134
|
+
def config(
|
1135
|
+
self,
|
1136
|
+
key: str = None
|
1137
|
+
) -> Any:
|
843
1138
|
"""
|
844
|
-
Retrieve configuration values using dot notation
|
1139
|
+
Retrieve application configuration values using dot notation.
|
845
1140
|
|
846
|
-
This method provides access to the application's configuration
|
847
|
-
|
848
|
-
|
1141
|
+
This method provides access to the application's configuration settings,
|
1142
|
+
supporting retrieval of nested values using dot notation (e.g., "database.default").
|
1143
|
+
If a key is provided, the method returns the corresponding configuration value.
|
1144
|
+
If no key is provided, it returns the entire configuration dictionary, excluding
|
1145
|
+
path-related configuration (which should be accessed via the `path()` method).
|
849
1146
|
|
850
1147
|
Parameters
|
851
1148
|
----------
|
852
1149
|
key : str, optional
|
853
|
-
The configuration key to retrieve
|
854
|
-
If None,
|
855
|
-
|
856
|
-
|
1150
|
+
The configuration key to retrieve, supporting dot notation for nested
|
1151
|
+
values (e.g., "database.default", "app.name"). If None, the method returns
|
1152
|
+
the entire configuration dictionary except for the 'path' configuration.
|
1153
|
+
Default is None.
|
857
1154
|
|
858
1155
|
Returns
|
859
1156
|
-------
|
860
1157
|
Any
|
861
|
-
|
862
|
-
|
1158
|
+
If `key` is provided and found, returns the corresponding configuration value.
|
1159
|
+
If `key` is None, returns the entire configuration dictionary (excluding 'path').
|
1160
|
+
If the key is not found, returns None.
|
1161
|
+
|
1162
|
+
Raises
|
1163
|
+
------
|
1164
|
+
OrionisRuntimeError
|
1165
|
+
If the application configuration has not been initialized (i.e., if `create()`
|
1166
|
+
has not been called before accessing configuration).
|
1167
|
+
OrionisValueError
|
1168
|
+
If the provided `key` parameter is not a string type.
|
1169
|
+
|
1170
|
+
Notes
|
1171
|
+
-----
|
1172
|
+
The method traverses nested configuration structures by splitting the key
|
1173
|
+
on dots and navigating through dictionary levels. Path configurations are
|
1174
|
+
excluded from full configuration returns and should be accessed via the
|
1175
|
+
`path()` method instead.
|
863
1176
|
"""
|
864
1177
|
pass
|
865
1178
|
|
866
1179
|
@abstractmethod
|
867
|
-
def path(
|
1180
|
+
def path(
|
1181
|
+
self,
|
1182
|
+
key: str = None
|
1183
|
+
) -> Path | dict:
|
868
1184
|
"""
|
869
|
-
Retrieve path configuration values using dot notation
|
1185
|
+
Retrieve application path configuration values using dot notation.
|
870
1186
|
|
871
|
-
|
872
|
-
allowing retrieval of specific path values by key or the entire paths
|
873
|
-
configuration when no key is specified.
|
1187
|
+
Provides access to the application's path configuration, allowing retrieval of either a specific path value or the entire paths configuration dictionary. If a key is provided, the corresponding path is returned as a `Path` object. If no key is provided, a dictionary mapping all path configuration keys to their resolved `Path` objects is returned.
|
874
1188
|
|
875
1189
|
Parameters
|
876
1190
|
----------
|
877
1191
|
key : str, optional
|
878
|
-
|
879
|
-
If None, returns the entire paths configuration
|
880
|
-
default : Any, optional
|
881
|
-
The default value to return if the specified key is not found.
|
1192
|
+
Dot-notated key specifying the path configuration to retrieve (e.g., "console", "storage.logs").
|
1193
|
+
If None, returns the entire paths configuration dictionary. Default is None.
|
882
1194
|
|
883
1195
|
Returns
|
884
1196
|
-------
|
885
|
-
|
886
|
-
|
887
|
-
|
1197
|
+
Path or dict
|
1198
|
+
If `key` is provided and found, returns the resolved `Path` object for that key.
|
1199
|
+
If `key` is None, returns a dictionary mapping all path keys to their `Path` objects.
|
1200
|
+
If `key` is not found, returns None.
|
1201
|
+
|
1202
|
+
Raises
|
1203
|
+
------
|
1204
|
+
OrionisRuntimeError
|
1205
|
+
If the application configuration has not been initialized (i.e., if `create()` has not been called).
|
1206
|
+
OrionisValueError
|
1207
|
+
If the provided `key` parameter is not a string.
|
1208
|
+
|
1209
|
+
Notes
|
1210
|
+
-----
|
1211
|
+
- The method traverses the paths configuration structure by splitting the key on dots and navigating through dictionary levels.
|
1212
|
+
- This method is specifically designed for path-related configuration access, separate from general application configuration.
|
1213
|
+
- All returned paths are resolved as `Path` objects for consistency and ease of use.
|
888
1214
|
"""
|
889
1215
|
pass
|
890
1216
|
|
891
1217
|
@abstractmethod
|
892
|
-
def create(
|
1218
|
+
def create(
|
1219
|
+
self
|
1220
|
+
) -> 'IApplication':
|
893
1221
|
"""
|
894
|
-
Bootstrap and initialize the application.
|
1222
|
+
Bootstrap and initialize the complete application framework.
|
895
1223
|
|
896
|
-
This method
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
and ready to handle requests or commands.
|
1224
|
+
This method orchestrates the entire application startup process including
|
1225
|
+
configuration loading, service provider registration and booting, framework
|
1226
|
+
kernel initialization, and logging setup. It ensures the application is
|
1227
|
+
fully prepared for operation and prevents duplicate initialization.
|
901
1228
|
|
902
1229
|
Returns
|
903
1230
|
-------
|
904
|
-
|
905
|
-
The
|
906
|
-
|
907
|
-
|
1231
|
+
Application
|
1232
|
+
The current application instance to enable method chaining.
|
1233
|
+
|
1234
|
+
Notes
|
1235
|
+
-----
|
1236
|
+
The bootstrap process follows this sequence:
|
1237
|
+
1. Load and process all configuration from configurators
|
1238
|
+
2. Register core framework service providers
|
1239
|
+
3. Register and boot all service providers
|
1240
|
+
4. Initialize framework kernels (Testing, CLI)
|
1241
|
+
5. Log successful startup with timing information
|
1242
|
+
6. Mark application as booted to prevent re-initialization
|
1243
|
+
|
1244
|
+
This method is idempotent - calling it multiple times will not cause
|
1245
|
+
duplicate initialization. The startup time is calculated and logged
|
1246
|
+
for performance monitoring purposes.
|
1247
|
+
"""
|
1248
|
+
pass
|