orionis 0.252.0__py3-none-any.whl → 0.265.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/application.py +6 -0
- orionis/framework.py +1 -1
- orionis/luminate/{application.py → _application.py} +21 -19
- orionis/luminate/{container → _container}/container.py +4 -4
- orionis/luminate/{container → _container}/container_integrity.py +2 -2
- orionis/luminate/{container → _container}/resolve.py +2 -2
- orionis/luminate/{contracts → _contracts}/application.py +2 -2
- orionis/luminate/{contracts → _contracts}/console/task_manager.py +1 -1
- orionis/luminate/{contracts → _contracts}/facades/commands/scheduler_facade.py +1 -1
- orionis/luminate/{contracts → _contracts}/facades/facade.py +4 -3
- orionis/luminate/{contracts → _contracts}/foundation/providers/service_providers_bootstrapper.py +2 -2
- orionis/luminate/{contracts → _contracts}/providers/service_provider.py +1 -1
- orionis/luminate/{facades → _facades}/app_facade.py +2 -2
- orionis/luminate/{facades → _facades}/commands/commands_facade.py +3 -3
- orionis/luminate/{facades → _facades}/commands/scheduler_facade.py +3 -3
- orionis/luminate/{facades → _facades}/config/config_facade.py +3 -3
- orionis/luminate/{facades → _facades}/environment/environment_facade.py +3 -3
- orionis/luminate/{facades → _facades}/files/path_facade.py +4 -4
- orionis/luminate/{facades → _facades}/log/log_facade.py +2 -2
- orionis/luminate/{foundation → _foundation}/console/command_bootstrapper.py +2 -2
- orionis/luminate/{foundation → _foundation}/environment/environment_bootstrapper.py +3 -3
- orionis/luminate/{foundation → _foundation/foundation}/config/config_bootstrapper.py +3 -3
- orionis/luminate/{foundation → _foundation}/providers/service_providers_bootstrapper.py +4 -4
- orionis/luminate/{providers → _providers}/commands/reactor_commands_service_provider.py +7 -7
- orionis/luminate/{providers → _providers}/commands/scheduler_provider.py +3 -3
- orionis/luminate/{providers → _providers}/config/config_service_provider.py +3 -3
- orionis/luminate/{providers → _providers}/environment/environment__service_provider.py +4 -4
- orionis/luminate/_providers/files/paths_provider.py +21 -0
- orionis/luminate/{providers → _providers}/log/log_service_provider.py +5 -5
- orionis/luminate/{providers → _providers}/service_provider.py +2 -2
- orionis/luminate/{services_ → _services}/commands/reactor_commands_service.py +3 -3
- orionis/luminate/{services_ → _services}/commands/scheduler_service.py +1 -1
- orionis/luminate/{services_ → _services}/config/config_service.py +1 -1
- orionis/luminate/{services_ → _services}/log/log_service.py +1 -1
- orionis/luminate/app.py +19 -0
- orionis/luminate/console/base/command.py +1 -1
- orionis/luminate/console/command_filter.py +1 -1
- orionis/luminate/console/commands/help.py +1 -1
- orionis/luminate/console/commands/schedule_work.py +2 -2
- orionis/luminate/console/dumper/dump_die.py +1 -1
- orionis/luminate/console/kernel.py +1 -1
- orionis/luminate/console/output/console.py +3 -3
- orionis/luminate/console/output/executor.py +1 -1
- orionis/luminate/console/output/progress_bar.py +1 -1
- orionis/luminate/console/parser.py +1 -1
- orionis/luminate/{config → foundation/config}/app/entities/app.py +44 -43
- orionis/luminate/{config → foundation/config}/auth/entities/auth.py +9 -1
- orionis/luminate/foundation/config/cache/entities/cache.py +74 -0
- orionis/luminate/foundation/config/cache/entities/file.py +46 -0
- orionis/luminate/foundation/config/cache/entities/stores.py +46 -0
- orionis/luminate/{contracts/config → foundation/config/contracts}/config.py +8 -12
- orionis/luminate/foundation/config/cors/entities/cors.py +129 -0
- orionis/luminate/foundation/config/database/entities/connections.py +89 -0
- orionis/luminate/foundation/config/database/entities/database.py +62 -0
- orionis/luminate/foundation/config/database/entities/mysql.py +270 -0
- orionis/luminate/foundation/config/database/entities/oracle.py +227 -0
- orionis/luminate/foundation/config/database/entities/pgsql.py +189 -0
- orionis/luminate/foundation/config/database/entities/sqlite.py +178 -0
- orionis/luminate/foundation/config/database/enums/mysql_charsets.py +92 -0
- orionis/luminate/foundation/config/database/enums/mysql_collations.py +53 -0
- orionis/luminate/foundation/config/database/enums/mysql_engine.py +18 -0
- orionis/luminate/foundation/config/database/enums/oracle_encoding.py +44 -0
- orionis/luminate/foundation/config/database/enums/oracle_nencoding.py +31 -0
- orionis/luminate/foundation/config/database/enums/pgsql_charsets.py +90 -0
- orionis/luminate/foundation/config/database/enums/pgsql_collations.py +26 -0
- orionis/luminate/foundation/config/database/enums/pgsql_mode.py +24 -0
- orionis/luminate/foundation/config/database/enums/sqlite_foreign_key.py +12 -0
- orionis/luminate/foundation/config/database/enums/sqlite_journal.py +22 -0
- orionis/luminate/foundation/config/database/enums/sqlite_synchronous.py +16 -0
- orionis/luminate/foundation/config/filesystems/entitites/aws.py +134 -0
- orionis/luminate/foundation/config/filesystems/entitites/disks.py +68 -0
- orionis/luminate/foundation/config/filesystems/entitites/filesystems.py +53 -0
- orionis/luminate/foundation/config/filesystems/entitites/local.py +39 -0
- orionis/luminate/foundation/config/filesystems/entitites/public.py +52 -0
- orionis/luminate/foundation/config/logging/entities/channels.py +115 -0
- orionis/luminate/foundation/config/logging/entities/chunked.py +128 -0
- orionis/luminate/foundation/config/logging/entities/daily.py +113 -0
- orionis/luminate/foundation/config/logging/entities/hourly.py +100 -0
- orionis/luminate/foundation/config/logging/entities/logging.py +51 -0
- orionis/luminate/foundation/config/logging/entities/monthly.py +100 -0
- orionis/luminate/foundation/config/logging/entities/stack.py +74 -0
- orionis/luminate/foundation/config/logging/entities/weekly.py +102 -0
- orionis/luminate/foundation/config/logging/enums/levels.py +21 -0
- orionis/luminate/foundation/config/mail/entities/file.py +41 -0
- orionis/luminate/foundation/config/mail/entities/mail.py +56 -0
- orionis/luminate/foundation/config/mail/entities/mailers.py +54 -0
- orionis/luminate/foundation/config/mail/entities/smtp.py +104 -0
- orionis/luminate/foundation/config/queue/entities/brokers.py +55 -0
- orionis/luminate/foundation/config/queue/entities/database.py +107 -0
- orionis/luminate/foundation/config/queue/entities/queue.py +47 -0
- orionis/luminate/foundation/config/queue/enums/strategy.py +15 -0
- orionis/luminate/foundation/config/roots/paths.py +446 -0
- orionis/luminate/foundation/config/session/entities/session.py +147 -0
- orionis/luminate/foundation/config/session/enums/same_site_policy.py +14 -0
- orionis/luminate/foundation/config/session/helpers/secret_key.py +16 -0
- orionis/luminate/foundation/config/startup.py +203 -0
- orionis/luminate/foundation/config/testing/entities/__init__.py +0 -0
- orionis/luminate/{config → foundation/config/testing}/entities/testing.py +36 -20
- orionis/luminate/foundation/config/testing/enums/__init__.py +0 -0
- orionis/luminate/foundation/config/testing/enums/test_mode.py +12 -0
- orionis/luminate/patterns/__init__.py +0 -4
- orionis/luminate/patterns/singleton/__init__.py +0 -10
- orionis/luminate/services/asynchrony/__init__.py +0 -0
- orionis/luminate/services/asynchrony/async_io.py +31 -0
- orionis/luminate/services/environment/__init__.py +0 -10
- orionis/luminate/services/environment/contracts/__init__.py +0 -5
- orionis/luminate/services/environment/contracts/env.py +0 -11
- orionis/luminate/services/environment/dot_env.py +87 -163
- orionis/luminate/services/environment/env.py +0 -11
- orionis/luminate/services/introspection/__init__.py +0 -0
- orionis/luminate/services/introspection/abstracts/__init__.py +0 -0
- orionis/luminate/services/introspection/abstracts/entities/__init__.py +0 -0
- orionis/luminate/services/introspection/abstracts/entities/abstract_class_attributes.py +37 -0
- orionis/luminate/{support → services}/introspection/abstracts/reflect_abstract.py +1 -1
- orionis/luminate/services/introspection/dependencies/__init__.py +0 -0
- orionis/luminate/services/introspection/dependencies/contracts/__init__.py +0 -0
- orionis/luminate/{support → services}/introspection/dependencies/contracts/reflect_dependencies.py +2 -2
- orionis/luminate/services/introspection/dependencies/entities/__init__.py +0 -0
- orionis/luminate/services/introspection/dependencies/entities/class_dependencies.py +41 -0
- orionis/luminate/services/introspection/dependencies/entities/method_dependencies.py +42 -0
- orionis/luminate/services/introspection/dependencies/entities/resolved_dependencies.py +49 -0
- orionis/luminate/{support → services}/introspection/dependencies/reflect_dependencies.py +4 -4
- orionis/luminate/services/parsers/__init__.py +0 -0
- orionis/luminate/services/parsers/contracts/__init__.py +0 -0
- orionis/luminate/{support/parsers/exception_parser.py → services/parsers/exception.py} +1 -1
- orionis/luminate/services/parsers/serializer.py +15 -0
- orionis/luminate/services/paths/__init__.py +0 -9
- orionis/luminate/services/paths/resolver.py +1 -1
- orionis/luminate/services/standard/__init__.py +0 -0
- orionis/luminate/services/standard/contracts/__init__.py +0 -0
- orionis/luminate/{support → services}/standard/std.py +1 -1
- orionis/luminate/services/system/__init__.py +0 -0
- orionis/luminate/services/system/contracts/__init__.py +0 -0
- orionis/luminate/services/system/contracts/imports.py +31 -0
- orionis/luminate/services/system/contracts/workers.py +18 -0
- orionis/luminate/services/system/imports.py +124 -0
- orionis/luminate/services/system/runtime_imports.py +70 -0
- orionis/luminate/services/{workers/maximum_workers.py → system/workers.py} +2 -1
- orionis/luminate/services/wrapper/__init__.py +0 -0
- orionis/luminate/services/wrapper/dicts/__init__.py +0 -0
- orionis/luminate/services/wrapper/dicts/dot_dict.py +115 -0
- orionis/luminate/support/introspection/__init__.py +0 -5
- orionis/luminate/support/introspection/container_integrity.py +2 -2
- orionis/luminate/support/introspection/instances/__init__.py +0 -5
- orionis/luminate/support/introspection/reflection.py +1 -1
- orionis/luminate/test/__init__.py +0 -23
- orionis/luminate/test/cases/test_async.py +41 -9
- orionis/luminate/test/cases/test_case.py +27 -13
- orionis/luminate/test/cases/test_sync.py +28 -6
- orionis/luminate/test/output/contracts/{test_std_out.py → dumper.py} +2 -1
- orionis/luminate/test/output/{test_std_out.py → dumper.py} +7 -4
- orionis/luminate/test/suites/__init__.py +0 -0
- orionis/luminate/test/suites/contracts/__init__.py +0 -0
- orionis/luminate/test/suites/contracts/test_suite.py +23 -0
- orionis/luminate/test/suites/test_suite.py +101 -0
- orionis/luminate/test/{core → suites}/test_unit.py +16 -8
- orionis/unittesting.py +43 -0
- {orionis-0.252.0.dist-info → orionis-0.265.0.dist-info}/METADATA +19 -3
- orionis-0.265.0.dist-info/RECORD +440 -0
- {orionis-0.252.0.dist-info → orionis-0.265.0.dist-info}/WHEEL +1 -1
- orionis-0.265.0.dist-info/entry_points.txt +2 -0
- orionis-0.265.0.dist-info/zip-safe +1 -0
- tests/example/test_example.py +1 -1
- tests/foundation/__init__.py +0 -0
- tests/foundation/config/__init__.py +0 -0
- tests/foundation/config/app/__init__.py +0 -0
- tests/foundation/config/app/test_app.py +140 -0
- tests/foundation/config/auth/__init__.py +0 -0
- tests/{config → foundation/config/auth}/test_auth.py +6 -3
- tests/foundation/config/cache/__init__.py +0 -0
- tests/foundation/config/cache/test_cache.py +98 -0
- tests/foundation/config/cache/test_cache_file.py +78 -0
- tests/foundation/config/cache/test_cache_stores.py +88 -0
- tests/foundation/config/cors/__init__.py +0 -0
- tests/foundation/config/cors/test_cors.py +121 -0
- tests/foundation/config/database/__init__.py +0 -0
- tests/foundation/config/database/test_database.py +108 -0
- tests/foundation/config/database/test_database_connections.py +129 -0
- tests/foundation/config/database/test_database_mysql.py +231 -0
- tests/foundation/config/database/test_database_oracle.py +204 -0
- tests/foundation/config/database/test_database_pgsql.py +187 -0
- tests/foundation/config/database/test_database_sqlite.py +153 -0
- tests/foundation/config/exceptions/__init__.py +0 -0
- tests/foundation/config/exceptions/test_exceptions_integrity.py +83 -0
- tests/foundation/config/filesystems/__init__.py +0 -0
- tests/foundation/config/filesystems/test_filesystems.py +110 -0
- tests/foundation/config/filesystems/test_filesystems_aws.py +133 -0
- tests/foundation/config/filesystems/test_filesystems_disks.py +114 -0
- tests/foundation/config/filesystems/test_filesystems_local.py +95 -0
- tests/foundation/config/filesystems/test_filesystems_public.py +120 -0
- tests/foundation/config/logging/__init__.py +0 -0
- tests/foundation/config/logging/test_logging.py +48 -0
- tests/foundation/config/logging/test_logging_channels.py +157 -0
- tests/foundation/config/logging/test_logging_chunked.py +166 -0
- tests/foundation/config/logging/test_logging_daily.py +153 -0
- tests/foundation/config/logging/test_logging_hourly.py +131 -0
- tests/foundation/config/logging/test_logging_monthly.py +133 -0
- tests/foundation/config/logging/test_logging_stack.py +124 -0
- tests/foundation/config/logging/test_logging_weekly.py +133 -0
- tests/foundation/config/mail/__init__.py +0 -0
- tests/foundation/config/mail/test_mail.py +73 -0
- tests/foundation/config/mail/test_mail_file.py +61 -0
- tests/foundation/config/mail/test_mail_mailers.py +58 -0
- tests/foundation/config/mail/test_mail_smtp.py +102 -0
- tests/foundation/config/queue/__init__.py +0 -0
- tests/foundation/config/queue/test_queue.py +58 -0
- tests/foundation/config/queue/test_queue_brokers.py +67 -0
- tests/foundation/config/queue/test_queue_database.py +95 -0
- tests/foundation/config/root/__init__.py +0 -0
- tests/foundation/config/root/test_root_paths.py +134 -0
- tests/foundation/config/session/__init__.py +0 -0
- tests/foundation/config/session/test_session.py +138 -0
- tests/foundation/config/startup/__init__.py +0 -0
- tests/foundation/config/startup/test_config_startup.py +134 -0
- tests/foundation/config/testing/__init__.py +0 -0
- tests/foundation/config/testing/test_testing.py +167 -0
- tests/patterns/singleton/test_singleton.py +2 -2
- tests/services/asynchrony/__init__.py +0 -0
- tests/{support/async_io/test_async_coroutine.py → services/asynchrony/test_async_io.py} +6 -5
- tests/services/environment/test_env.py +155 -33
- tests/services/inspection/__init__.py +0 -0
- tests/services/inspection/dependencies/__init__.py +0 -0
- tests/services/inspection/dependencies/mocks/__init__.py +0 -0
- tests/services/inspection/dependencies/mocks/mock_user.py +30 -0
- tests/services/inspection/dependencies/mocks/mock_user_controller.py +27 -0
- tests/services/inspection/dependencies/mocks/mock_users_permissions.py +41 -0
- tests/services/inspection/dependencies/test_reflect_dependencies.py +94 -0
- tests/services/parsers/__init__.py +0 -0
- tests/services/parsers/mocks/__init__.py +0 -0
- tests/services/parsers/mocks/mock_custom_error.py +15 -0
- tests/{support → services}/parsers/test_exception_parser.py +8 -8
- tests/services/path/__init__.py +0 -0
- tests/services/path/test_resolver.py +73 -0
- tests/services/standard/__init__.py +0 -0
- tests/services/standard/test_std.py +127 -0
- tests/services/wrapper/__init__.py +0 -0
- tests/services/wrapper/test_wrapper_doc_dict.py +129 -0
- tests/testing/__init__.py +0 -0
- tests/testing/test_testing_result.py +92 -0
- tests/testing/test_testing_unit.py +138 -0
- orionis/luminate/config/app/__init__.py +0 -10
- orionis/luminate/config/auth/__init__.py +0 -7
- orionis/luminate/config/cache/__init__.py +0 -9
- orionis/luminate/config/cache/entities/cache.py +0 -58
- orionis/luminate/config/cache/entities/file.py +0 -29
- orionis/luminate/config/cache/entities/stores.py +0 -35
- orionis/luminate/config/entities/cors.py +0 -58
- orionis/luminate/config/entities/database.py +0 -204
- orionis/luminate/config/entities/filesystems.py +0 -98
- orionis/luminate/config/entities/logging.py +0 -157
- orionis/luminate/config/entities/mail.py +0 -76
- orionis/luminate/config/entities/queue.py +0 -62
- orionis/luminate/config/entities/session.py +0 -58
- orionis/luminate/providers/files/paths_provider.py +0 -20
- orionis/luminate/services/workers/__init__.py +0 -10
- orionis/luminate/support/adapters/dot_dict.py +0 -29
- orionis/luminate/support/asynchrony/async_io.py +0 -40
- orionis/luminate/support/asynchrony/contracts/async_coroutine.py +0 -26
- orionis/luminate/support/introspection/abstracts/entities/abstract_class_attributes.py +0 -11
- orionis/luminate/support/introspection/dependencies/__init__.py +0 -5
- orionis/luminate/support/introspection/dependencies/entities/class_dependencies.py +0 -11
- orionis/luminate/support/introspection/dependencies/entities/method_dependencies.py +0 -11
- orionis/luminate/support/introspection/dependencies/entities/resolved_dependencies.py +0 -12
- orionis/luminate/support/paths/contracts/resolver.py +0 -67
- orionis/luminate/support/paths/resolver.py +0 -83
- orionis/luminate/test/core/contracts/test_suite.py +0 -30
- orionis/luminate/test/core/test_suite.py +0 -93
- orionis-0.252.0.dist-info/RECORD +0 -318
- orionis-0.252.0.dist-info/entry_points.txt +0 -2
- tests/config/test_app.py +0 -122
- tests/config/test_cache.py +0 -20
- tests/support/adapters/fakes/fake_dict.py +0 -15
- tests/support/adapters/test_doct_dict.py +0 -21
- tests/support/inspection/fakes/fake_reflect_dependencies.py +0 -25
- tests/support/inspection/test_reflect_dependencies.py +0 -67
- tests/support/parsers/fakes/fake_custom_error.py +0 -27
- tests/support/path/test_resolver.py +0 -33
- tests/support/standard/test_std.py +0 -62
- /orionis/{console.py → clinstall.py} +0 -0
- /orionis/luminate/{config → _container}/__init__.py +0 -0
- /orionis/luminate/{container → _container}/exception.py +0 -0
- /orionis/luminate/{container → _container}/lifetimes.py +0 -0
- /orionis/luminate/{config/app/entities → _contracts}/__init__.py +0 -0
- /orionis/luminate/{config/app/enums → _contracts/config}/__init__.py +0 -0
- /orionis/luminate/{config/contracts → _contracts/config}/config.py +0 -0
- /orionis/luminate/{config/auth/entities → _contracts/console}/__init__.py +0 -0
- /orionis/luminate/{config/cache/entities → _contracts/console/base}/__init__.py +0 -0
- /orionis/luminate/{contracts → _contracts}/console/base/command.py +0 -0
- /orionis/luminate/{contracts → _contracts}/console/command_filter.py +0 -0
- /orionis/luminate/{contracts → _contracts}/console/kernel.py +0 -0
- /orionis/luminate/{config/cache/enums → _contracts/console/output}/__init__.py +0 -0
- /orionis/luminate/{contracts → _contracts}/console/output/console.py +0 -0
- /orionis/luminate/{contracts → _contracts}/console/output/executor.py +0 -0
- /orionis/luminate/{contracts → _contracts}/console/output/progress_bar.py +0 -0
- /orionis/luminate/{contracts → _contracts}/console/parser.py +0 -0
- /orionis/luminate/{contracts → _contracts}/container/container.py +0 -0
- /orionis/luminate/{contracts → _contracts}/container/container_integrity.py +0 -0
- /orionis/luminate/{config/contracts → _contracts/facades}/__init__.py +0 -0
- /orionis/luminate/{config/exceptions → _contracts/facades/commands}/__init__.py +0 -0
- /orionis/luminate/{contracts → _contracts}/facades/commands/commands_facade.py +0 -0
- /orionis/luminate/{container → _contracts/facades/config}/__init__.py +0 -0
- /orionis/luminate/{contracts → _contracts}/facades/config/config_facade.py +0 -0
- /orionis/luminate/{contracts → _contracts/facades/environment}/__init__.py +0 -0
- /orionis/luminate/{contracts → _contracts}/facades/environment/environment_facade.py +0 -0
- /orionis/luminate/{contracts/config → _contracts/facades/files}/__init__.py +0 -0
- /orionis/luminate/{contracts → _contracts}/facades/files/path_facade.py +0 -0
- /orionis/luminate/{contracts/console → _contracts/facades/log}/__init__.py +0 -0
- /orionis/luminate/{contracts → _contracts}/facades/log/log_facade.py +0 -0
- /orionis/luminate/{contracts/console/base → _contracts/facades/tests}/__init__.py +0 -0
- /orionis/luminate/{contracts → _contracts}/facades/tests/tests_facade.py +0 -0
- /orionis/luminate/{contracts/console/output → _contracts/foundation}/__init__.py +0 -0
- /orionis/luminate/{contracts → _contracts}/foundation/bootstraper.py +0 -0
- /orionis/luminate/{contracts/facades → _contracts/foundation/config}/__init__.py +0 -0
- /orionis/luminate/{contracts → _contracts}/foundation/config/config_bootstrapper.py +0 -0
- /orionis/luminate/{contracts/facades/commands → _contracts/foundation/console}/__init__.py +0 -0
- /orionis/luminate/{contracts → _contracts}/foundation/console/command_bootstrapper.py +0 -0
- /orionis/luminate/{contracts/facades/config → _contracts/foundation/environment}/__init__.py +0 -0
- /orionis/luminate/{contracts → _contracts}/foundation/environment/environment_bootstrapper.py +0 -0
- /orionis/luminate/{contracts/facades/environment → _contracts/foundation/providers}/__init__.py +0 -0
- /orionis/luminate/{contracts/facades/files → _contracts/providers}/__init__.py +0 -0
- /orionis/luminate/{contracts/facades/log → _contracts/services}/__init__.py +0 -0
- /orionis/luminate/{contracts/facades/tests → _contracts/services/commands}/__init__.py +0 -0
- /orionis/luminate/{contracts → _contracts}/services/commands/reactor_commands_service.py +0 -0
- /orionis/luminate/{contracts → _contracts}/services/commands/schedule_service.py +0 -0
- /orionis/luminate/{contracts/foundation → _contracts/services/config}/__init__.py +0 -0
- /orionis/luminate/{contracts → _contracts}/services/config/config_service.py +0 -0
- /orionis/luminate/{contracts/foundation/config → _contracts/services/environment}/__init__.py +0 -0
- /orionis/luminate/{contracts → _contracts}/services/environment/environment_service.py +0 -0
- /orionis/luminate/{contracts/foundation/console → _contracts/services/files}/__init__.py +0 -0
- /orionis/luminate/{contracts → _contracts}/services/files/path_resolver_service.py +0 -0
- /orionis/luminate/{contracts/foundation/environment → _contracts/services/log}/__init__.py +0 -0
- /orionis/luminate/{contracts → _contracts}/services/log/log_service.py +0 -0
- /orionis/luminate/{contracts → _contracts}/support/exception_parse.py +0 -0
- /orionis/luminate/{contracts → _contracts}/support/reflection.py +0 -0
- /orionis/luminate/{contracts/foundation/providers → _facades}/__init__.py +0 -0
- /orionis/luminate/{contracts/providers → _facades/commands}/__init__.py +0 -0
- /orionis/luminate/{contracts/services → _facades/config}/__init__.py +0 -0
- /orionis/luminate/{contracts/services/commands → _facades/environment}/__init__.py +0 -0
- /orionis/luminate/{contracts/services/config → _facades/files}/__init__.py +0 -0
- /orionis/luminate/{contracts/services/environment → _facades/log}/__init__.py +0 -0
- /orionis/luminate/{contracts/services/files → _foundation}/__init__.py +0 -0
- /orionis/luminate/{contracts/services/log → _foundation/console}/__init__.py +0 -0
- /orionis/luminate/{facades → _foundation/environment}/__init__.py +0 -0
- /orionis/luminate/{facades/commands → _foundation/exceptions}/__init__.py +0 -0
- /orionis/luminate/{foundation → _foundation}/exceptions/exception_bootstrapper.py +0 -0
- /orionis/luminate/{foundation → _foundation}/exceptions/exception_providers.py +0 -0
- /orionis/luminate/{facades → _foundation/foundation}/config/__init__.py +0 -0
- /orionis/luminate/{facades/environment → _foundation/providers}/__init__.py +0 -0
- /orionis/luminate/{facades/files → _providers}/__init__.py +0 -0
- /orionis/luminate/{facades/log → _providers/commands}/__init__.py +0 -0
- /orionis/luminate/{foundation/console → _providers/config}/__init__.py +0 -0
- /orionis/luminate/{foundation → _providers}/environment/__init__.py +0 -0
- /orionis/luminate/{foundation/exceptions → _providers/files}/__init__.py +0 -0
- /orionis/luminate/{foundation/providers → _providers/log}/__init__.py +0 -0
- /orionis/luminate/{providers → _services}/__init__.py +0 -0
- /orionis/luminate/{providers → _services}/commands/__init__.py +0 -0
- /orionis/luminate/{providers → _services}/config/__init__.py +0 -0
- /orionis/luminate/{providers/environment → _services/log}/__init__.py +0 -0
- /orionis/luminate/{providers/files → foundation/config/app}/__init__.py +0 -0
- /orionis/luminate/{providers/log → foundation/config/app/entities}/__init__.py +0 -0
- /orionis/luminate/{services_ → foundation/config/app/enums}/__init__.py +0 -0
- /orionis/luminate/{config → foundation/config}/app/enums/ciphers.py +0 -0
- /orionis/luminate/{config → foundation/config}/app/enums/environments.py +0 -0
- /orionis/luminate/{services_/commands → foundation/config/auth}/__init__.py +0 -0
- /orionis/luminate/{services_/config → foundation/config/auth/entities}/__init__.py +0 -0
- /orionis/luminate/{services_/log → foundation/config/cache}/__init__.py +0 -0
- /orionis/luminate/{support/adapters → foundation/config/cache/entities}/__init__.py +0 -0
- /orionis/luminate/{support/asynchrony → foundation/config/cache/enums}/__init__.py +0 -0
- /orionis/luminate/{config → foundation/config}/cache/enums/drivers.py +0 -0
- /orionis/luminate/{support/asynchrony → foundation/config}/contracts/__init__.py +0 -0
- /orionis/luminate/{support/introspection/abstracts → foundation/config/cors}/__init__.py +0 -0
- /orionis/luminate/{support/introspection/abstracts → foundation/config/cors}/entities/__init__.py +0 -0
- /orionis/luminate/{support/introspection/dependencies/contracts → foundation/config/database}/__init__.py +0 -0
- /orionis/luminate/{support/introspection/dependencies → foundation/config/database}/entities/__init__.py +0 -0
- /orionis/luminate/{support/parsers → foundation/config/database/enums}/__init__.py +0 -0
- /orionis/luminate/{support/parsers/contracts → foundation/config/exceptions}/__init__.py +0 -0
- /orionis/luminate/{config/exceptions/integrity_exception.py → foundation/config/exceptions/integrity.py} +0 -0
- /orionis/luminate/{support/paths → foundation/config/filesystems}/__init__.py +0 -0
- /orionis/luminate/{support/paths/contracts → foundation/config/filesystems/entitites}/__init__.py +0 -0
- /orionis/luminate/{support/standard → foundation/config/logging}/__init__.py +0 -0
- /orionis/luminate/{support/standard/contracts → foundation/config/logging/entities}/__init__.py +0 -0
- /orionis/luminate/{test/core → foundation/config/logging/enums}/__init__.py +0 -0
- /orionis/luminate/{test/core/contracts → foundation/config/mail}/__init__.py +0 -0
- {tests/config → orionis/luminate/foundation/config/mail/entities}/__init__.py +0 -0
- {tests/support/adapters → orionis/luminate/foundation/config/queue}/__init__.py +0 -0
- {tests/support/adapters/fakes → orionis/luminate/foundation/config/queue/entities}/__init__.py +0 -0
- {tests/support/async_io → orionis/luminate/foundation/config/roots}/__init__.py +0 -0
- {tests/support/parsers → orionis/luminate/foundation/config/session}/__init__.py +0 -0
- {tests/support/parsers/fakes → orionis/luminate/foundation/config/session/entities}/__init__.py +0 -0
- {tests/support/path → orionis/luminate/foundation/config/session/enums}/__init__.py +0 -0
- {tests/support/standard → orionis/luminate/foundation/config/testing}/__init__.py +0 -0
- /orionis/luminate/{support → services}/parsers/contracts/exception_parser.py +0 -0
- /orionis/luminate/{support → services}/standard/contracts/std.py +0 -0
- /orionis/luminate/test/exceptions/{test_exception.py → test_failure_exception.py} +0 -0
- /orionis/luminate/test/{core → suites}/contracts/test_unit.py +0 -0
- {orionis-0.252.0.dist-info → orionis-0.265.0.dist-info/licenses}/LICENCE +0 -0
- {orionis-0.252.0.dist-info → orionis-0.265.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,128 @@
|
|
1
|
+
from dataclasses import asdict, dataclass, field
|
2
|
+
from orionis.luminate.foundation.config.exceptions.integrity import OrionisIntegrityException
|
3
|
+
from orionis.luminate.foundation.config.logging.enums.levels import Level
|
4
|
+
import re
|
5
|
+
|
6
|
+
@dataclass(unsafe_hash=True, kw_only=True)
|
7
|
+
class Chunked:
|
8
|
+
"""
|
9
|
+
Configuration for chunked log file rotation.
|
10
|
+
|
11
|
+
This class defines the configuration for managing log files by splitting them into chunks
|
12
|
+
based on file size and limiting the number of retained log files. This prevents log files
|
13
|
+
from growing indefinitely and helps manage disk usage.
|
14
|
+
|
15
|
+
Attributes
|
16
|
+
----------
|
17
|
+
path : str
|
18
|
+
Filesystem path where chunked log files are stored.
|
19
|
+
level : int | str | Level
|
20
|
+
Logging level for the log file. Accepts an integer, string, or Level enum.
|
21
|
+
mb_size : int
|
22
|
+
Maximum size (in megabytes) of a single log file before a new chunk is created.
|
23
|
+
files : int
|
24
|
+
Maximum number of log files to retain. Older files are deleted when this limit is exceeded.
|
25
|
+
"""
|
26
|
+
|
27
|
+
path: str = field(
|
28
|
+
default='storage/log/application.log',
|
29
|
+
metadata={
|
30
|
+
"description": "Filesystem path where chunked log files are stored.",
|
31
|
+
"default": "storage/log/application.log",
|
32
|
+
},
|
33
|
+
)
|
34
|
+
|
35
|
+
level: int | str | Level = field(
|
36
|
+
default=Level.INFO,
|
37
|
+
metadata={
|
38
|
+
"description": "Logging level for the log file. Accepts int, str, or Level enum.",
|
39
|
+
"default": Level.INFO,
|
40
|
+
},
|
41
|
+
)
|
42
|
+
|
43
|
+
mb_size: int = field(
|
44
|
+
default=10,
|
45
|
+
metadata={
|
46
|
+
"description": "Maximum size (in MB) of a log file before chunking.",
|
47
|
+
"default": 10,
|
48
|
+
},
|
49
|
+
)
|
50
|
+
|
51
|
+
files: int = field(
|
52
|
+
default=5,
|
53
|
+
metadata={
|
54
|
+
"description": "Maximum number of log files to retain.",
|
55
|
+
"default": 5,
|
56
|
+
},
|
57
|
+
)
|
58
|
+
|
59
|
+
def __post_init__(self):
|
60
|
+
# Validate 'path'
|
61
|
+
if not isinstance(self.path, str) or not self.path.strip():
|
62
|
+
raise OrionisIntegrityException(
|
63
|
+
f"Chunked log configuration error: 'path' must be a non-empty string, got {repr(self.path)}."
|
64
|
+
)
|
65
|
+
|
66
|
+
# Validate 'level'
|
67
|
+
valid_level_types = (int, str, Level)
|
68
|
+
if not isinstance(self.level, valid_level_types):
|
69
|
+
raise OrionisIntegrityException(
|
70
|
+
f"File cache configuration error: 'level' must be int, str, or Level enum, got {type(self.level).__name__}."
|
71
|
+
)
|
72
|
+
|
73
|
+
if isinstance(self.level, str):
|
74
|
+
_value = self.level.strip().upper()
|
75
|
+
if not _value:
|
76
|
+
raise OrionisIntegrityException(
|
77
|
+
"File cache configuration error: 'level' string cannot be empty."
|
78
|
+
)
|
79
|
+
if _value not in Level.__members__:
|
80
|
+
raise OrionisIntegrityException(
|
81
|
+
f"File cache configuration error: 'level' must be one of {list(Level.__members__.keys())}, got '{self.level}'."
|
82
|
+
)
|
83
|
+
self.level = Level[_value].value
|
84
|
+
elif isinstance(self.level, int):
|
85
|
+
valid_values = [level.value for level in Level]
|
86
|
+
if self.level not in valid_values:
|
87
|
+
raise OrionisIntegrityException(
|
88
|
+
f"File cache configuration error: 'level' must be one of {valid_values}, got '{self.level}'."
|
89
|
+
)
|
90
|
+
elif isinstance(self.level, Level):
|
91
|
+
self.level = self.level.value
|
92
|
+
|
93
|
+
# Validate 'mb_size'
|
94
|
+
if isinstance(self.mb_size, str):
|
95
|
+
match = re.match(r'^(\d+)\s*(MB|KB|B)?$', self.mb_size.strip(), re.IGNORECASE)
|
96
|
+
if not match:
|
97
|
+
raise OrionisIntegrityException(
|
98
|
+
f"Chunked log configuration error: 'mb_size' string must be like '10MB', '500KB', or integer, got '{self.mb_size}'."
|
99
|
+
)
|
100
|
+
size, unit = match.groups()
|
101
|
+
size = int(size)
|
102
|
+
if unit is None or unit.upper() == 'MB':
|
103
|
+
self.mb_size = size
|
104
|
+
elif unit.upper() == 'KB':
|
105
|
+
self.mb_size = max(1, size // 1024)
|
106
|
+
elif unit.upper() == 'B':
|
107
|
+
self.mb_size = max(1, size // (1024 * 1024))
|
108
|
+
if not isinstance(self.mb_size, int) or self.mb_size < 1:
|
109
|
+
raise OrionisIntegrityException(
|
110
|
+
f"Chunked log configuration error: 'mb_size' must be a positive integer (MB), got {self.mb_size}."
|
111
|
+
)
|
112
|
+
|
113
|
+
# Validate 'files'
|
114
|
+
if not isinstance(self.files, int) or self.files < 1:
|
115
|
+
raise OrionisIntegrityException(
|
116
|
+
f"Chunked log configuration error: 'files' must be a positive integer, got {self.files}."
|
117
|
+
)
|
118
|
+
|
119
|
+
def toDict(self) -> dict:
|
120
|
+
"""
|
121
|
+
Returns a dictionary representation of the Chunked configuration.
|
122
|
+
|
123
|
+
Returns
|
124
|
+
-------
|
125
|
+
dict
|
126
|
+
Dictionary containing all configuration fields and their values.
|
127
|
+
"""
|
128
|
+
return asdict(self)
|
@@ -0,0 +1,113 @@
|
|
1
|
+
from dataclasses import asdict, dataclass, field
|
2
|
+
from datetime import time
|
3
|
+
from orionis.luminate.foundation.config.exceptions.integrity import OrionisIntegrityException
|
4
|
+
from orionis.luminate.foundation.config.logging.enums.levels import Level
|
5
|
+
|
6
|
+
@dataclass(unsafe_hash=True, kw_only=True)
|
7
|
+
class Daily:
|
8
|
+
"""
|
9
|
+
Represents the configuration for daily log file rotation.
|
10
|
+
|
11
|
+
Attributes:
|
12
|
+
path (str): The file path where the log is stored.
|
13
|
+
level (int | str | Level): The logging level (e.g., 'info', 'error', 'debug').
|
14
|
+
retention_days (int): The number of days to retain log files before deletion.
|
15
|
+
at (time): The time of day when the log rotation should occur.
|
16
|
+
"""
|
17
|
+
|
18
|
+
path: str = field(
|
19
|
+
default='storage/log/application.log',
|
20
|
+
metadata={
|
21
|
+
"description": "The file path where the log is stored.",
|
22
|
+
"default": "storage/log/application.log",
|
23
|
+
},
|
24
|
+
)
|
25
|
+
|
26
|
+
level: int | str | Level = field(
|
27
|
+
default=Level.INFO,
|
28
|
+
metadata={
|
29
|
+
"description": "The logging level (e.g., 'info', 'error', 'debug').",
|
30
|
+
"default": Level.INFO,
|
31
|
+
},
|
32
|
+
)
|
33
|
+
|
34
|
+
retention_days: int = field(
|
35
|
+
default=7,
|
36
|
+
metadata={
|
37
|
+
"description": "The number of days to retain log files before deletion.",
|
38
|
+
"default": 7,
|
39
|
+
},
|
40
|
+
)
|
41
|
+
|
42
|
+
at: time = field(
|
43
|
+
default=time(0, 0),
|
44
|
+
metadata={
|
45
|
+
"description": "The time of day when the log rotation should occur.",
|
46
|
+
"default": time(0, 0),
|
47
|
+
},
|
48
|
+
)
|
49
|
+
|
50
|
+
def __post_init__(self):
|
51
|
+
"""
|
52
|
+
Validates and normalizes the attributes after dataclass initialization.
|
53
|
+
|
54
|
+
Raises:
|
55
|
+
OrionisIntegrityException: If any attribute is invalid.
|
56
|
+
"""
|
57
|
+
# Validate 'path'
|
58
|
+
if not isinstance(self.path, str) or not self.path.strip():
|
59
|
+
raise OrionisIntegrityException(
|
60
|
+
f"File cache configuration error: 'path' must be a non-empty string, got {repr(self.path)}."
|
61
|
+
)
|
62
|
+
|
63
|
+
# Validate 'level'
|
64
|
+
valid_level_types = (int, str, Level)
|
65
|
+
if not isinstance(self.level, valid_level_types):
|
66
|
+
raise OrionisIntegrityException(
|
67
|
+
f"File cache configuration error: 'level' must be int, str, or Level enum, got {type(self.level).__name__}."
|
68
|
+
)
|
69
|
+
|
70
|
+
# Normalize 'level' to int
|
71
|
+
if isinstance(self.level, str):
|
72
|
+
_value = self.level.strip().upper()
|
73
|
+
if not _value:
|
74
|
+
raise OrionisIntegrityException(
|
75
|
+
"File cache configuration error: 'level' string cannot be empty."
|
76
|
+
)
|
77
|
+
if _value not in Level.__members__:
|
78
|
+
raise OrionisIntegrityException(
|
79
|
+
f"File cache configuration error: 'level' must be one of {list(Level.__members__.keys())}, got '{self.level}'."
|
80
|
+
)
|
81
|
+
self.level = Level[_value].value
|
82
|
+
elif isinstance(self.level, int):
|
83
|
+
valid_values = [level.value for level in Level]
|
84
|
+
if self.level not in valid_values:
|
85
|
+
raise OrionisIntegrityException(
|
86
|
+
f"File cache configuration error: 'level' must be one of {valid_values}, got '{self.level}'."
|
87
|
+
)
|
88
|
+
elif isinstance(self.level, Level):
|
89
|
+
self.level = self.level.value
|
90
|
+
|
91
|
+
# Validate 'retention_days'
|
92
|
+
if not isinstance(self.retention_days, int) or self.retention_days < 1 or self.retention_days > 90:
|
93
|
+
raise OrionisIntegrityException(
|
94
|
+
f"File cache configuration error: 'retention_days' must be a positive integer between 1 and 90, got {repr(self.retention_days)}."
|
95
|
+
)
|
96
|
+
|
97
|
+
# Validate 'at'
|
98
|
+
if not isinstance(self.at, time):
|
99
|
+
raise OrionisIntegrityException(
|
100
|
+
f"File cache configuration error: 'at' must be a datetime.time instance, got {type(self.at).__name__}."
|
101
|
+
)
|
102
|
+
|
103
|
+
# Convert 'at' to "HH:MM:SS" string format
|
104
|
+
self.at = self.at.strftime("%H:%M:%S")
|
105
|
+
|
106
|
+
def toDict(self) -> dict:
|
107
|
+
"""
|
108
|
+
Converts the Daily object to a dictionary representation.
|
109
|
+
|
110
|
+
Returns:
|
111
|
+
dict: A dictionary containing the dataclass fields and their values.
|
112
|
+
"""
|
113
|
+
return asdict(self)
|
@@ -0,0 +1,100 @@
|
|
1
|
+
from dataclasses import asdict, dataclass, field
|
2
|
+
from orionis.luminate.foundation.config.exceptions.integrity import OrionisIntegrityException
|
3
|
+
from orionis.luminate.foundation.config.logging.enums.levels import Level
|
4
|
+
|
5
|
+
@dataclass(unsafe_hash=True, kw_only=True)
|
6
|
+
class Hourly:
|
7
|
+
"""
|
8
|
+
Represents the configuration for hourly log file management.
|
9
|
+
|
10
|
+
Attributes:
|
11
|
+
path (str): The file path where the log is stored.
|
12
|
+
level (int | str | Level): The logging level (e.g., 'info', 'error', 'debug').
|
13
|
+
retention_hours (int): The number of hours to retain log files before deletion.
|
14
|
+
"""
|
15
|
+
|
16
|
+
path: str = field(
|
17
|
+
default='storage/log/application.log',
|
18
|
+
metadata={
|
19
|
+
"description": "The file path where the log is stored.",
|
20
|
+
"default": "storage/log/application.log",
|
21
|
+
},
|
22
|
+
)
|
23
|
+
|
24
|
+
level: int | str | Level = field(
|
25
|
+
default=Level.INFO,
|
26
|
+
metadata={
|
27
|
+
"description": "The logging level (e.g., 'info', 'error', 'debug').",
|
28
|
+
"default": Level.INFO,
|
29
|
+
},
|
30
|
+
)
|
31
|
+
|
32
|
+
retention_hours: int = field(
|
33
|
+
default=24,
|
34
|
+
metadata={
|
35
|
+
"description": "The number of hours to retain log files before deletion.",
|
36
|
+
"default": 24,
|
37
|
+
},
|
38
|
+
)
|
39
|
+
|
40
|
+
def __post_init__(self):
|
41
|
+
"""
|
42
|
+
Validates the attributes after dataclass initialization.
|
43
|
+
|
44
|
+
Raises:
|
45
|
+
OrionisIntegrityException: If any attribute is invalid.
|
46
|
+
- 'path' must be a non-empty string.
|
47
|
+
- 'level' must be an int, str, or Level enum, and a valid value.
|
48
|
+
- 'retention_hours' must be an integer between 1 and 168.
|
49
|
+
"""
|
50
|
+
# Validate 'path'
|
51
|
+
if not isinstance(self.path, str) or not self.path.strip():
|
52
|
+
raise OrionisIntegrityException(
|
53
|
+
f"File cache configuration error: 'path' must be a non-empty string, got {repr(self.path)}."
|
54
|
+
)
|
55
|
+
|
56
|
+
# Validate 'level'
|
57
|
+
valid_level_types = (int, str, Level)
|
58
|
+
if not isinstance(self.level, valid_level_types):
|
59
|
+
raise OrionisIntegrityException(
|
60
|
+
f"File cache configuration error: 'level' must be int, str, or Level enum, got {type(self.level).__name__}."
|
61
|
+
)
|
62
|
+
|
63
|
+
if isinstance(self.level, str):
|
64
|
+
_value = self.level.strip().upper()
|
65
|
+
if not _value:
|
66
|
+
raise OrionisIntegrityException(
|
67
|
+
"File cache configuration error: 'level' string cannot be empty."
|
68
|
+
)
|
69
|
+
if _value not in Level.__members__:
|
70
|
+
raise OrionisIntegrityException(
|
71
|
+
f"File cache configuration error: 'level' must be one of {list(Level.__members__.keys())}, got '{self.level}'."
|
72
|
+
)
|
73
|
+
self.level = Level[_value].value
|
74
|
+
elif isinstance(self.level, int):
|
75
|
+
valid_values = [level.value for level in Level]
|
76
|
+
if self.level not in valid_values:
|
77
|
+
raise OrionisIntegrityException(
|
78
|
+
f"File cache configuration error: 'level' must be one of {valid_values}, got '{self.level}'."
|
79
|
+
)
|
80
|
+
elif isinstance(self.level, Level):
|
81
|
+
self.level = self.level.value
|
82
|
+
|
83
|
+
# Validate 'retention_hours'
|
84
|
+
if not isinstance(self.retention_hours, int) or self.retention_hours < 0:
|
85
|
+
raise OrionisIntegrityException(
|
86
|
+
f"File cache configuration error: 'retention_hours' must be a non-negative integer, got {self.retention_hours}."
|
87
|
+
)
|
88
|
+
if self.retention_hours < 1 or self.retention_hours > 168:
|
89
|
+
raise OrionisIntegrityException(
|
90
|
+
f"File cache configuration error: 'retention_hours' must be between 1 and 168, got {self.retention_hours}."
|
91
|
+
)
|
92
|
+
|
93
|
+
def toDict(self) -> dict:
|
94
|
+
"""
|
95
|
+
Converts the Hourly object to a dictionary representation.
|
96
|
+
|
97
|
+
Returns:
|
98
|
+
dict: A dictionary containing all the dataclass fields and their values.
|
99
|
+
"""
|
100
|
+
return asdict(self)
|
@@ -0,0 +1,51 @@
|
|
1
|
+
from dataclasses import dataclass, field, asdict, fields
|
2
|
+
from orionis.luminate.foundation.config.logging.entities.channels import Channels
|
3
|
+
from orionis.luminate.foundation.config.exceptions.integrity import OrionisIntegrityException
|
4
|
+
|
5
|
+
@dataclass(unsafe_hash=True, kw_only=True)
|
6
|
+
class Logging:
|
7
|
+
"""
|
8
|
+
Represents the logging system configuration.
|
9
|
+
|
10
|
+
Attributes
|
11
|
+
----------
|
12
|
+
default : str
|
13
|
+
The default logging channel to use.
|
14
|
+
channels : Channels
|
15
|
+
A collection of available logging channels.
|
16
|
+
"""
|
17
|
+
default: str = field(
|
18
|
+
default="stack",
|
19
|
+
metadata={
|
20
|
+
"description": "The default logging channel to use.",
|
21
|
+
"default": "stack",
|
22
|
+
}
|
23
|
+
)
|
24
|
+
channels: Channels = field(
|
25
|
+
default_factory=Channels,
|
26
|
+
metadata={
|
27
|
+
"description": "A collection of available logging channels.",
|
28
|
+
"default": "Channels()",
|
29
|
+
}
|
30
|
+
)
|
31
|
+
|
32
|
+
def __post_init__(self):
|
33
|
+
"""
|
34
|
+
Validates the types of the attributes after initialization.
|
35
|
+
"""
|
36
|
+
options = [field.name for field in fields(Channels)]
|
37
|
+
if not isinstance(self.default, str) or self.default not in options:
|
38
|
+
raise OrionisIntegrityException(
|
39
|
+
f"The 'default' property must be a string and match one of the available options ({options})."
|
40
|
+
)
|
41
|
+
|
42
|
+
if not isinstance(self.channels, Channels):
|
43
|
+
raise OrionisIntegrityException(
|
44
|
+
"The 'channels' property must be an instance of Channels."
|
45
|
+
)
|
46
|
+
|
47
|
+
def toDict(self) -> dict:
|
48
|
+
"""
|
49
|
+
Converts the current instance into a dictionary representation.
|
50
|
+
"""
|
51
|
+
return asdict(self)
|
@@ -0,0 +1,100 @@
|
|
1
|
+
from dataclasses import asdict, dataclass, field
|
2
|
+
from orionis.luminate.foundation.config.exceptions.integrity import OrionisIntegrityException
|
3
|
+
from orionis.luminate.foundation.config.logging.enums.levels import Level
|
4
|
+
|
5
|
+
@dataclass(unsafe_hash=True, kw_only=True)
|
6
|
+
class Monthly:
|
7
|
+
"""
|
8
|
+
Configuration entity for monthly log file management.
|
9
|
+
|
10
|
+
Attributes:
|
11
|
+
path (str): The file path where the log is stored.
|
12
|
+
level (int | str | Level): The logging level (e.g., 'info', 'error', 'debug').
|
13
|
+
retention_months (int): The number of months to retain log files before deletion.
|
14
|
+
"""
|
15
|
+
|
16
|
+
path: str = field(
|
17
|
+
default='storage/log/application.log',
|
18
|
+
metadata={
|
19
|
+
"description": "The file path where the log is stored.",
|
20
|
+
"default": "storage/log/application.log",
|
21
|
+
},
|
22
|
+
)
|
23
|
+
|
24
|
+
level: int | str | Level = field(
|
25
|
+
default=Level.INFO,
|
26
|
+
metadata={
|
27
|
+
"description": "The logging level (e.g., 'info', 'error', 'debug').",
|
28
|
+
"default": Level.INFO,
|
29
|
+
},
|
30
|
+
)
|
31
|
+
|
32
|
+
retention_months: int = field(
|
33
|
+
default=4,
|
34
|
+
metadata={
|
35
|
+
"description": "The number of months to retain log files before deletion.",
|
36
|
+
"default": 4,
|
37
|
+
},
|
38
|
+
)
|
39
|
+
|
40
|
+
def __post_init__(self):
|
41
|
+
"""
|
42
|
+
Validates the 'path', 'level', and 'retention_months' attributes after dataclass initialization.
|
43
|
+
|
44
|
+
Raises:
|
45
|
+
OrionisIntegrityException: If any attribute is invalid.
|
46
|
+
- 'path' must be a non-empty string.
|
47
|
+
- 'level' must be an int, str, or Level enum, and a valid logging level.
|
48
|
+
- 'retention_months' must be an integer between 1 and 12 (inclusive).
|
49
|
+
"""
|
50
|
+
# Validate 'path'
|
51
|
+
if not isinstance(self.path, str) or not self.path.strip():
|
52
|
+
raise OrionisIntegrityException(
|
53
|
+
f"File cache configuration error: 'path' must be a non-empty string, got {repr(self.path)}."
|
54
|
+
)
|
55
|
+
|
56
|
+
# Validate 'level'
|
57
|
+
valid_level_types = (int, str, Level)
|
58
|
+
if not isinstance(self.level, valid_level_types):
|
59
|
+
raise OrionisIntegrityException(
|
60
|
+
f"File cache configuration error: 'level' must be int, str, or Level enum, got {type(self.level).__name__}."
|
61
|
+
)
|
62
|
+
|
63
|
+
if isinstance(self.level, str):
|
64
|
+
_value = self.level.strip().upper()
|
65
|
+
if not _value:
|
66
|
+
raise OrionisIntegrityException(
|
67
|
+
"File cache configuration error: 'level' string cannot be empty."
|
68
|
+
)
|
69
|
+
if _value not in Level.__members__:
|
70
|
+
raise OrionisIntegrityException(
|
71
|
+
f"File cache configuration error: 'level' must be one of {list(Level.__members__.keys())}, got '{self.level}'."
|
72
|
+
)
|
73
|
+
self.level = Level[_value].value
|
74
|
+
elif isinstance(self.level, int):
|
75
|
+
valid_values = [level.value for level in Level]
|
76
|
+
if self.level not in valid_values:
|
77
|
+
raise OrionisIntegrityException(
|
78
|
+
f"File cache configuration error: 'level' must be one of {valid_values}, got '{self.level}'."
|
79
|
+
)
|
80
|
+
elif isinstance(self.level, Level):
|
81
|
+
self.level = self.level.value
|
82
|
+
|
83
|
+
# Validate 'retention_months'
|
84
|
+
if not isinstance(self.retention_months, int) or self.retention_months < 0:
|
85
|
+
raise OrionisIntegrityException(
|
86
|
+
f"File cache configuration error: 'retention_months' must be a non-negative integer, got {self.retention_months}."
|
87
|
+
)
|
88
|
+
if self.retention_months < 1 or self.retention_months > 12:
|
89
|
+
raise OrionisIntegrityException(
|
90
|
+
f"File cache configuration error: 'retention_months' must be between 1 and 12, got {self.retention_months}."
|
91
|
+
)
|
92
|
+
|
93
|
+
def toDict(self) -> dict:
|
94
|
+
"""
|
95
|
+
Converts the Monthly object to a dictionary representation.
|
96
|
+
|
97
|
+
Returns:
|
98
|
+
dict: A dictionary containing all dataclass fields and their values.
|
99
|
+
"""
|
100
|
+
return asdict(self)
|
@@ -0,0 +1,74 @@
|
|
1
|
+
from dataclasses import asdict, dataclass, field
|
2
|
+
from orionis.luminate.foundation.config.exceptions.integrity import OrionisIntegrityException
|
3
|
+
from orionis.luminate.foundation.config.logging.enums.levels import Level
|
4
|
+
|
5
|
+
@dataclass(unsafe_hash=True, kw_only=True)
|
6
|
+
class Stack:
|
7
|
+
"""
|
8
|
+
Represents the configuration for a logging stack, including the log file path and logging level.
|
9
|
+
"""
|
10
|
+
|
11
|
+
path: str = field(
|
12
|
+
default='storage/log/application.log',
|
13
|
+
metadata={
|
14
|
+
"description": "The file path where the log is stored.",
|
15
|
+
"default": "storage/log/application.log",
|
16
|
+
},
|
17
|
+
)
|
18
|
+
|
19
|
+
level: int | str | Level = field(
|
20
|
+
default=Level.INFO,
|
21
|
+
metadata={
|
22
|
+
"description": "The logging level (e.g., 'info', 'error', 'debug').",
|
23
|
+
"default": Level.INFO,
|
24
|
+
},
|
25
|
+
)
|
26
|
+
|
27
|
+
def __post_init__(self):
|
28
|
+
"""
|
29
|
+
Validates the 'path' and 'level' attributes after dataclass initialization.
|
30
|
+
|
31
|
+
Raises:
|
32
|
+
OrionisIntegrityException: If 'path' is not a non-empty string, or if 'level' is not a valid type or value.
|
33
|
+
"""
|
34
|
+
# Validate 'path'
|
35
|
+
if not isinstance(self.path, str) or not self.path.strip():
|
36
|
+
raise OrionisIntegrityException(
|
37
|
+
f"File cache configuration error: 'path' must be a non-empty string, got {repr(self.path)}."
|
38
|
+
)
|
39
|
+
|
40
|
+
# Validate 'level'
|
41
|
+
valid_level_types = (int, str, Level)
|
42
|
+
if not isinstance(self.level, valid_level_types):
|
43
|
+
raise OrionisIntegrityException(
|
44
|
+
f"File cache configuration error: 'level' must be int, str, or Level enum, got {type(self.level).__name__}."
|
45
|
+
)
|
46
|
+
|
47
|
+
if isinstance(self.level, str):
|
48
|
+
_value = self.level.strip().upper()
|
49
|
+
if not _value:
|
50
|
+
raise OrionisIntegrityException(
|
51
|
+
"File cache configuration error: 'level' string cannot be empty."
|
52
|
+
)
|
53
|
+
if _value not in Level.__members__:
|
54
|
+
raise OrionisIntegrityException(
|
55
|
+
f"File cache configuration error: 'level' must be one of {list(Level.__members__.keys())}, got '{self.level}'."
|
56
|
+
)
|
57
|
+
self.level = Level[_value].value
|
58
|
+
elif isinstance(self.level, int):
|
59
|
+
valid_values = [level.value for level in Level]
|
60
|
+
if self.level not in valid_values:
|
61
|
+
raise OrionisIntegrityException(
|
62
|
+
f"File cache configuration error: 'level' must be one of {valid_values}, got '{self.level}'."
|
63
|
+
)
|
64
|
+
elif isinstance(self.level, Level):
|
65
|
+
self.level = self.level.value
|
66
|
+
|
67
|
+
def toDict(self) -> dict:
|
68
|
+
"""
|
69
|
+
Converts the Stack instance to a dictionary representation.
|
70
|
+
|
71
|
+
Returns:
|
72
|
+
dict: A dictionary containing all fields of the Stack instance.
|
73
|
+
"""
|
74
|
+
return asdict(self)
|
@@ -0,0 +1,102 @@
|
|
1
|
+
from dataclasses import asdict, dataclass, field
|
2
|
+
from orionis.luminate.foundation.config.exceptions.integrity import OrionisIntegrityException
|
3
|
+
from orionis.luminate.foundation.config.logging.enums.levels import Level
|
4
|
+
|
5
|
+
@dataclass(unsafe_hash=True, kw_only=True)
|
6
|
+
class Weekly:
|
7
|
+
"""
|
8
|
+
Configuration entity for weekly log file management.
|
9
|
+
|
10
|
+
Attributes:
|
11
|
+
path (str): The file path where the log is stored.
|
12
|
+
level (int | str | Level): The logging level (e.g., 'info', 'error', 'debug').
|
13
|
+
retention_weeks (int): The number of weeks to retain log files before deletion.
|
14
|
+
"""
|
15
|
+
|
16
|
+
path: str = field(
|
17
|
+
default='storage/log/application.log',
|
18
|
+
metadata={
|
19
|
+
"description": "The file path where the log is stored.",
|
20
|
+
"default": "storage/log/application.log",
|
21
|
+
},
|
22
|
+
)
|
23
|
+
|
24
|
+
level: int | str | Level = field(
|
25
|
+
default=Level.INFO,
|
26
|
+
metadata={
|
27
|
+
"description": "The logging level (e.g., 'info', 'error', 'debug').",
|
28
|
+
"default": Level.INFO,
|
29
|
+
},
|
30
|
+
)
|
31
|
+
|
32
|
+
retention_weeks: int = field(
|
33
|
+
default=4,
|
34
|
+
metadata={
|
35
|
+
"description": "The number of weeks to retain log files before deletion.",
|
36
|
+
"default": 4,
|
37
|
+
},
|
38
|
+
)
|
39
|
+
|
40
|
+
def __post_init__(self):
|
41
|
+
"""
|
42
|
+
Post-initialization validation for Weekly configuration.
|
43
|
+
|
44
|
+
Validates:
|
45
|
+
- 'path' is a non-empty string.
|
46
|
+
- 'level' is a valid int, str, or Level enum member.
|
47
|
+
- 'retention_weeks' is an integer between 1 and 12 (inclusive).
|
48
|
+
|
49
|
+
Raises:
|
50
|
+
OrionisIntegrityException: If any attribute is invalid.
|
51
|
+
"""
|
52
|
+
# Validate 'path'
|
53
|
+
if not isinstance(self.path, str) or not self.path.strip():
|
54
|
+
raise OrionisIntegrityException(
|
55
|
+
f"File cache configuration error: 'path' must be a non-empty string, got {repr(self.path)}."
|
56
|
+
)
|
57
|
+
|
58
|
+
# Validate 'level'
|
59
|
+
valid_level_types = (int, str, Level)
|
60
|
+
if not isinstance(self.level, valid_level_types):
|
61
|
+
raise OrionisIntegrityException(
|
62
|
+
f"File cache configuration error: 'level' must be int, str, or Level enum, got {type(self.level).__name__}."
|
63
|
+
)
|
64
|
+
|
65
|
+
if isinstance(self.level, str):
|
66
|
+
_value = self.level.strip().upper()
|
67
|
+
if not _value:
|
68
|
+
raise OrionisIntegrityException(
|
69
|
+
"File cache configuration error: 'level' string cannot be empty."
|
70
|
+
)
|
71
|
+
if _value not in Level.__members__:
|
72
|
+
raise OrionisIntegrityException(
|
73
|
+
f"File cache configuration error: 'level' must be one of {list(Level.__members__.keys())}, got '{self.level}'."
|
74
|
+
)
|
75
|
+
self.level = Level[_value].value
|
76
|
+
elif isinstance(self.level, int):
|
77
|
+
valid_values = [level.value for level in Level]
|
78
|
+
if self.level not in valid_values:
|
79
|
+
raise OrionisIntegrityException(
|
80
|
+
f"File cache configuration error: 'level' must be one of {valid_values}, got '{self.level}'."
|
81
|
+
)
|
82
|
+
elif isinstance(self.level, Level):
|
83
|
+
self.level = self.level.value
|
84
|
+
|
85
|
+
# Validate 'retention_weeks'
|
86
|
+
if not isinstance(self.retention_weeks, int) or self.retention_weeks < 0:
|
87
|
+
raise OrionisIntegrityException(
|
88
|
+
f"File cache configuration error: 'retention_weeks' must be a non-negative integer, got {self.retention_weeks}."
|
89
|
+
)
|
90
|
+
if self.retention_weeks < 1 or self.retention_weeks > 12:
|
91
|
+
raise OrionisIntegrityException(
|
92
|
+
f"File cache configuration error: 'retention_weeks' must be between 1 and 12, got {self.retention_weeks}."
|
93
|
+
)
|
94
|
+
|
95
|
+
def toDict(self) -> dict:
|
96
|
+
"""
|
97
|
+
Converts the Weekly configuration object to a dictionary.
|
98
|
+
|
99
|
+
Returns:
|
100
|
+
dict: Dictionary representation of the Weekly configuration.
|
101
|
+
"""
|
102
|
+
return asdict(self)
|