swiftpy-framework 0.3.1__tar.gz → 0.3.7__tar.gz
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.
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/.env.example +15 -1
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/CHANGELOG.md +59 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/PKG-INFO +22 -5
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/README.md +21 -4
- swiftpy_framework-0.3.7/app/schemas/user_schema.py +22 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/config/auth.py +6 -0
- swiftpy_framework-0.3.7/config/http.py +42 -0
- swiftpy_framework-0.3.7/config/schedule.py +25 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/documentations/2026-11-14-installation-quick-start.md +1 -1
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/documentations/2026-11-15-authentication-and-security.md +1 -1
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/documentations/2026-11-15-cache-events-and-queues.md +2 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/documentations/2026-11-15-database-query-builder-and-migrations.md +109 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/documentations/2026-11-15-http-routing-middleware-and-exceptions.md +8 -6
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/documentations/2026-11-15-orm-models-and-relationships.md +56 -3
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/documentations/2026-11-15-validation-and-form-requests.md +17 -1
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/documentations/2026-11-15-websockets-and-admin.md +1 -0
- swiftpy_framework-0.3.7/documentations/2026-11-19-application-schemas.md +255 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/documentations/2026-11-19-cli-and-testing.md +10 -2
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/documentations/2026-11-20-request-and-responses.md +9 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/documentations/2026-11-21-application-architecture-and-project-structure.md +1 -1
- swiftpy_framework-0.3.7/documentations/2026-11-22-task-scheduling.md +247 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/pyproject.toml +1 -1
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/__init__.py +30 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/auth/auth_manager.py +42 -26
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/auth/throttle.py +86 -12
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/console/cli.py +2 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/console/commands/new.py +102 -22
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/console/commands/queue.py +8 -56
- swiftpy_framework-0.3.7/swiftpy/console/commands/schedule.py +227 -0
- swiftpy_framework-0.3.7/swiftpy/console/loader.py +110 -0
- swiftpy_framework-0.3.7/swiftpy/console/stubs/repository.stub +13 -0
- swiftpy_framework-0.3.7/swiftpy/console/stubs/schema.stub +11 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/core/application.py +137 -100
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/core/container.py +2 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/database/__init__.py +2 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/database/exceptions.py +5 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/database/identifiers.py +41 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/database/orm/model.py +618 -87
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/database/query_builder.py +975 -54
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/helpers/helper.py +22 -0
- swiftpy_framework-0.3.7/swiftpy/http/client_ip.py +285 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/http/request.py +89 -1
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/http/response.py +2 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/http/router.py +6 -2
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/queue/worker.py +233 -4
- swiftpy_framework-0.3.7/swiftpy/scheduling/__init__.py +145 -0
- swiftpy_framework-0.3.7/swiftpy/scheduling/_redis_lua.py +1135 -0
- swiftpy_framework-0.3.7/swiftpy/scheduling/cron.py +479 -0
- swiftpy_framework-0.3.7/swiftpy/scheduling/events.py +86 -0
- swiftpy_framework-0.3.7/swiftpy/scheduling/exceptions.py +40 -0
- swiftpy_framework-0.3.7/swiftpy/scheduling/jobs.py +97 -0
- swiftpy_framework-0.3.7/swiftpy/scheduling/models.py +353 -0
- swiftpy_framework-0.3.7/swiftpy/scheduling/scheduler.py +1745 -0
- swiftpy_framework-0.3.7/swiftpy/scheduling/signing.py +106 -0
- swiftpy_framework-0.3.7/swiftpy/scheduling/store.py +1563 -0
- swiftpy_framework-0.3.7/swiftpy/schemas/__init__.py +19 -0
- swiftpy_framework-0.3.7/swiftpy/schemas/base.py +1527 -0
- swiftpy_framework-0.3.7/swiftpy/schemas/fields.py +207 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/websockets/connection.py +39 -1
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/auth/test_auth_throttle.py +193 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/console/test_new_command.py +17 -1
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/console/test_phase9_cli_remediation.py +1 -1
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/console/test_stubs_and_make.py +1 -1
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/core/test_helpers.py +24 -0
- swiftpy_framework-0.3.7/tests/database/test_query_helpers_v036.py +1742 -0
- swiftpy_framework-0.3.7/tests/http/test_client_ip.py +515 -0
- swiftpy_framework-0.3.7/tests/logging/__init__.py +1 -0
- swiftpy_framework-0.3.7/tests/scheduling/test_cron_and_timezone.py +203 -0
- swiftpy_framework-0.3.7/tests/scheduling/test_scheduler_core.py +595 -0
- swiftpy_framework-0.3.7/tests/scheduling/test_scheduler_lifecycle_and_cli.py +367 -0
- swiftpy_framework-0.3.7/tests/scheduling/test_scheduler_queue_integration.py +486 -0
- swiftpy_framework-0.3.7/tests/scheduling/test_scheduler_recovery_and_failures.py +498 -0
- swiftpy_framework-0.3.7/tests/scheduling/test_scheduler_redis_store.py +564 -0
- swiftpy_framework-0.3.7/tests/scheduling/test_scheduler_worker_lifecycle.py +587 -0
- swiftpy_framework-0.3.7/tests/schemas/__init__.py +1 -0
- swiftpy_framework-0.3.7/tests/schemas/test_schema_auth.py +184 -0
- swiftpy_framework-0.3.7/tests/schemas/test_schema_orm_and_cli.py +193 -0
- swiftpy_framework-0.3.7/tests/schemas/test_schema_routing.py +372 -0
- swiftpy_framework-0.3.7/tests/schemas/test_schemas.py +458 -0
- swiftpy_framework-0.3.7/tests/typing/test_orm_typing.py +333 -0
- swiftpy_framework-0.3.7/tests/typing/test_schema_typing.py +65 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/uv.lock +1 -1
- swiftpy_framework-0.3.1/app/schemas/user_schema.py +0 -35
- swiftpy_framework-0.3.1/documentations/2026-11-19-application-schemas.md +0 -276
- swiftpy_framework-0.3.1/swiftpy/console/loader.py +0 -33
- swiftpy_framework-0.3.1/swiftpy/console/stubs/repository.stub +0 -8
- swiftpy_framework-0.3.1/swiftpy/console/stubs/schema.stub +0 -12
- swiftpy_framework-0.3.1/tests/typing/test_orm_typing.py +0 -181
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/.dockerignore +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/.github/workflows/ci.yml +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/.github/workflows/publish.yml +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/.gitignore +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/CONTRIBUTING.md +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/Dockerfile +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/LICENSE +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/app/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/app/ai/agents/assistant_agent.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/app/ai/observers/.gitkeep +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/app/ai/pipelines/.gitkeep +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/app/ai/providers/.gitkeep +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/app/ai/tools/system_status_tool.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/app/ai/vectorstores/.gitkeep +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/app/events/user_registered.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/app/http/controllers/user_controller.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/app/http/handler/exceptions.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/app/http/middleware/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/app/http/middleware/admin_middleware.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/app/http/middleware/auth_middleware.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/app/http/middleware/test_middleware.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/app/http/requests/create_user_request.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/app/http/resources/user_resource.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/app/jobs/send_notification_job.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/app/listeners/send_welcome_notification.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/app/mail/welcome_email.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/app/models/user.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/app/providers/app_service_provider.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/app/providers/auth_service_provider.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/app/providers/cache_service_provider.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/app/providers/database_service_provider.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/app/providers/event_service_provider.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/app/providers/filesystem_service_provider.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/app/providers/mail_service_provider.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/app/providers/queue_service_provider.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/app/repositories/user_repository.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/app/services/user_service.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/bootstrap/cache/.gitkeep +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/config/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/config/ai.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/config/app.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/config/cache.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/config/cors.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/config/database.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/config/events.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/config/filesystems.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/config/logging.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/config/mail.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/config/queue.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/database/migrations/2026_01_01_000000_create_users_table.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/database/seeders/database_seeder.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/docker-compose.yml +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/documentations/2026-11-15-ai-subsystem.md +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/documentations/2026-11-15-core-application-di-and-config.md +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/documentations/2026-11-15-filesystem-storage-and-mail.md +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/documentations/2026-11-19-database-schema-and-blueprint.md +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/documentations/2026-11-20-error-handling.md +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/documentations/2026-11-20-logging.md +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/documentations/2026-11-21-cors.md +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/main.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/prompts/classify.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/prompts/summarise.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/red-black.png +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/routes/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/routes/api.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/.gitignore +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/ai/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/ai/_deterministic.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/ai/_fake.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/ai/agents/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/ai/agents/base_agent.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/ai/agents/memory.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/ai/client.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/ai/conversation.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/ai/embeddings.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/ai/exceptions.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/ai/history_strategies.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/ai/middleware.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/ai/observability/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/ai/observability/drivers.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/ai/observability/observer.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/ai/pool.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/ai/pricing.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/ai/prompts/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/ai/prompts/loader.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/ai/providers/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/ai/providers/anthropic_provider.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/ai/providers/base.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/ai/providers/openai_provider.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/ai/rag/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/ai/rag/context_formatter.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/ai/rag/pipeline_builder.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/ai/rag/reranker.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/ai/rag/result.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/ai/rag/retriever.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/ai/redis_store.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/ai/streaming.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/ai/tools/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/ai/tools/base_tool.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/ai/tools/first_party.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/ai/tools/tool_loop.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/ai/vectorstore/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/ai/vectorstore/base.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/ai/vectorstore/chroma_adapter.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/ai/vectorstore/in_memory_adapter.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/ai/vectorstore/lancedb_adapter.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/ai/vectorstore/pgvector_adapter.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/ai/vectorstore/pinecone_adapter.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/ai/vectorstore/qdrant_adapter.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/auth/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/auth/api_key_guard.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/auth/events.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/auth/exceptions.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/auth/jwt_guard.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/auth/jwt_issuer.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/auth/token_blacklist.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/auth/user_context.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/auth_manager.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/cache/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/cache/cache.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/cache/driver.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/cache/drivers/memory.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/cache/drivers/redis.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/console/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/console/commands/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/console/commands/cache.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/console/commands/make.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/console/commands/migrate.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/console/commands/seed.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/console/commands/start.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/console/commands/storage.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/console/stubs/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/console/stubs/agent.stub +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/console/stubs/controller.stub +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/console/stubs/event.stub +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/console/stubs/job.stub +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/console/stubs/listener.stub +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/console/stubs/mail.stub +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/console/stubs/middleware.stub +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/console/stubs/migration.alter.stub +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/console/stubs/migration.api_keys.stub +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/console/stubs/migration.blank.stub +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/console/stubs/migration.create.stub +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/console/stubs/migration.stub +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/console/stubs/migration.update.stub +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/console/stubs/model.stub +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/console/stubs/prompt.stub +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/console/stubs/provider.stub +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/console/stubs/request.stub +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/console/stubs/resource.stub +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/console/stubs/seeder.stub +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/console/stubs/service.stub +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/console/stubs/tool.stub +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/core/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/core/bootstrap.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/core/config.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/core/container_exceptions.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/core/context.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/core/exceptions.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/core/providers/base.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/database/migrations/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/database/migrations/blueprint.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/database/migrations/lock.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/database/migrations/migration.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/database/migrations/migrator.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/database/migrations/schema.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/database/orm/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/database/orm/fields.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/database/orm/registry.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/database/orm/relationships.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/database/pagination/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/database/pagination/contracts.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/database/pagination/paginator.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/database/pagination/simple_paginator.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/database/pool.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/database/seeder.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/database/transaction.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/events/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/events/dispatcher.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/events/redis_bus.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/filesystem/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/filesystem/disk.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/filesystem/drivers/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/filesystem/drivers/base.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/filesystem/drivers/local.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/filesystem/drivers/s3.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/filesystem/events.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/filesystem/exceptions.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/filesystem/manager.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/filesystem/metadata.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/filesystem/paths.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/filesystem/service_provider.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/filesystem/uploads/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/filesystem/uploads/handlers.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/filesystem/uploads/uploaded_file.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/filesystem/uploads/validators.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/filesystem/visibility.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/helpers/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/http/exceptions.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/http/middleware.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/logging/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/logging/channels.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/logging/log.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/logging/manager.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/mail/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/mail/attachments.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/mail/config.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/mail/envelope.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/mail/exceptions.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/mail/facade.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/mail/mailable.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/mail/manager.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/mail/message.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/mail/models.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/mail/queue/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/mail/queue/job.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/mail/service_provider.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/mail/templates/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/mail/templates/renderer.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/mail/transports/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/mail/transports/api/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/mail/transports/api/base.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/mail/transports/api/mailgun.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/mail/transports/api/resend.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/mail/transports/api/sendgrid.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/mail/transports/base.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/mail/transports/console.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/mail/transports/sendmail.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/mail/transports/smtp.py +0 -0
- /swiftpy_framework-0.3.1/tests/logging/__init__.py → /swiftpy_framework-0.3.7/swiftpy/py.typed +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/queue/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/queue/dispatcher.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/queue/job.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/support/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/support/hashing.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/support/keys.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/support/redis_config.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/support/strings.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/testing/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/testing/fakes/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/testing/fakes/ai_fake.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/testing/fakes/vectorstore_fake.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/testing/fixtures.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/testing/http_client.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/testing/test_case.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/validation/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/validation/exceptions.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/validation/form_request.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/validation/protocols.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/validation/rules/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/validation/rules/builtin.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/validation/rules/exists.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/validation/rules/registry.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/validation/rules/required.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/validation/rules/unique.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/validation/validator.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/websockets/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/swiftpy/websockets/manager.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/ai/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/ai/conftest.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/ai/integration/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/ai/integration/test_chroma.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/ai/integration/test_lancedb.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/ai/integration/test_pinecone.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/ai/integration/test_qdrant.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/ai/integration/test_rag_integration.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/ai/test_agents.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/ai/test_ai_fake.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/ai/test_ai_fake_isolation.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/ai/test_client.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/ai/test_conversation.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/ai/test_embeddings.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/ai/test_middleware.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/ai/test_middleware_concurrency.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/ai/test_observability.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/ai/test_observability_resilience.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/ai/test_phase7_ai_remediation.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/ai/test_phase8_agents_tools_prompts_remediation.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/ai/test_phase8_rag_remediation.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/ai/test_phase8_vectorstore_remediation.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/ai/test_prompts.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/ai/test_prompts_security.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/ai/test_providers.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/ai/test_rag.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/ai/test_streaming.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/ai/test_tools.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/ai/test_vectorstore.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/ai/test_vectorstore_adapters.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/app/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/app/test_application_providers.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/app/test_starter_auth.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/auth/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/auth/test_api_key_guard.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/auth/test_auth_attempt.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/auth/test_auth_context_on_issue.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/auth/test_auth_manager.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/auth/test_auth_proxy.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/auth/test_auth_remediation.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/auth/test_auth_security.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/auth/test_jwt_defaults.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/auth/test_jwt_issuer.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/auth/test_password_hashing.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/auth/test_refresh_and_logout.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/auth/test_token_blacklist.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/benchmarks.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/cache/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/cache/test_cache_concurrency.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/cache/test_cache_manager.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/cache/test_driver_correctness.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/cache/test_memory_cache.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/cache/test_redis_cache.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/concurrency/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/concurrency/test_circular_dependency.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/concurrency/test_container_semantics.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/concurrency/test_resolution.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/concurrency/test_resolution2.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/conftest.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/console/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/console/test_cache_commands.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/console/test_cli.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/console/test_start.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/console/test_storage_command.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/core/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/core/test_application_config_isolation.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/core/test_core_config.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/core/test_exceptions.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/core/test_instance_singletons.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/core/test_lifespan.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/database/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/database/test_orm_expansion.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/database/test_orm_vector.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/database/test_pagination_and_grouping.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/database/test_pagination_pg_integration.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/database/test_pgvector_integration.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/database/test_phase4_remediation.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/database/test_query_expansion.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/database/test_query_expansion_pg_integration.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/database/test_seeder.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/database/test_sequence_gaps.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/db/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/db/load_test_database.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/db/load_test_database2.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/db/test_arbitrary_primary_keys.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/db/test_identifiers.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/db/test_mass_writes.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/db/test_pool_config.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/db/test_query_builder_terminals.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/db/test_sql_injections.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/db/test_transaction_isolation.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/docs/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/docs/test_readme_examples.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/e2e/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/e2e/test_concurrent_auth.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/e2e/test_crud_auth_e2e.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/events/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/events/test_event_dispatcher.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/events/test_model_events.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/events/test_redis_bus.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/events/test_redis_bus_reliability.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/filesystem/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/filesystem/test_cli_storage_link.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/filesystem/test_disk.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/filesystem/test_filesystem_concurrency.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/filesystem/test_filesystem_config.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/filesystem/test_http_integration.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/filesystem/test_local_driver.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/filesystem/test_multipart.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/filesystem/test_paths.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/filesystem/test_phase6_filesystem_remediation.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/filesystem/test_s3_driver.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/filesystem/test_signed_urls.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/filesystem/test_storage_facade.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/filesystem/test_uploaded_file.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/filesystem/test_validation.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/http/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/http/test_controller_routing.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/http/test_error_pipeline.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/http/test_http_remediation.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/http/test_include_router.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/http/test_request.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/http/test_request_router_abort.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/http/test_response.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/http/test_route_groups.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/http/test_router.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/http/test_router_405_and_has_file.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/integration/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/integration/test_queue_event_websocket.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/logging/test_logging.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/mail/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/mail/test_api_transports.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/mail/test_attachments.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/mail/test_cli_make_mail.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/mail/test_console_transport.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/mail/test_envelope.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/mail/test_facade_and_fake.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/mail/test_mailable.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/mail/test_manager_and_config.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/mail/test_message.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/mail/test_phase6_mail_remediation.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/mail/test_queue_integration.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/mail/test_service_provider_and_helpers.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/mail/test_smtp_and_sendmail.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/mail/test_templates.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/migrations/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/migrations/test_migrations.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/orm/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/orm/test_defaults_dirty.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/orm/test_eager_loading.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/orm/test_hidden.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/orm/test_instance_update.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/orm/test_mass_assignment.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/orm/test_model_events_transaction.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/orm/test_relationships_hardening.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/orm/test_where_has.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/queue/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/queue/test_after_commit.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/queue/test_phase5_remediation.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/queue/test_poison_messages.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/queue/test_queue.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/queue/test_reliability.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/queue/test_signing.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/queue/test_worker_behavior.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/security/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/security/test_security_audit.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/stress/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/stress/test_context_isolation.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/support/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/support/test_redis_config.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/support/test_strings.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/testing/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/testing/test_fixtures.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/testing/test_phase9_testing_remediation.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/testing/test_test_client.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/typing/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/validation/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/validation/test_db_rules.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/validation/test_form_request_fail_closed.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/validation/test_form_request_pipeline.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/validation/test_phase6_validation_remediation.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/validation/test_rules_hardening.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/validation/test_validation_concurrency.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/validation/test_validation_ergonomics.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/validation/test_validator_rules.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/websockets/__init__.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/websockets/test_broadcast.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/websockets/test_handshake.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/websockets/test_lifecycle.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/websockets/test_websocket_concurrency.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/websockets/test_websocket_connection.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/websockets/test_websocket_manager.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/websockets/test_websocket_remediation.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/tests/websockets/test_websocket_routing_and_lifecycle.py +0 -0
- {swiftpy_framework-0.3.1 → swiftpy_framework-0.3.7}/views/mail/template.html +0 -0
|
@@ -6,11 +6,12 @@ APP_KEY=
|
|
|
6
6
|
APP_DEBUG=false
|
|
7
7
|
APP_URL=http://localhost:8000
|
|
8
8
|
|
|
9
|
-
# Server (Uvicorn)
|
|
9
|
+
# Server (Uvicorn) & HTTP Proxy Trust
|
|
10
10
|
SERVER_HOST=127.0.0.1
|
|
11
11
|
SERVER_PORT=8000
|
|
12
12
|
SERVER_WORKERS=1
|
|
13
13
|
SERVER_RELOAD=true
|
|
14
|
+
TRUSTED_PROXIES=
|
|
14
15
|
|
|
15
16
|
# Database (PostgreSQL / asyncpg)
|
|
16
17
|
DB_CONNECTION=postgresql
|
|
@@ -48,6 +49,17 @@ QUEUE_DRIVER=redis
|
|
|
48
49
|
QUEUE_PREFIX=swiftpy_queue:
|
|
49
50
|
QUEUE_NAME=default
|
|
50
51
|
|
|
52
|
+
# Task Scheduler
|
|
53
|
+
SCHEDULE_DRIVER=redis
|
|
54
|
+
SCHEDULE_TIMEZONE=UTC
|
|
55
|
+
SCHEDULE_AUTO_START=false
|
|
56
|
+
SCHEDULE_POLL_INTERVAL=1.0
|
|
57
|
+
SCHEDULE_GRACE_SECONDS=60.0
|
|
58
|
+
SCHEDULE_DISPATCH_LEASE_SECONDS=30.0
|
|
59
|
+
SCHEDULE_MAX_DISPATCH_ATTEMPTS=5
|
|
60
|
+
SCHEDULE_DEFAULT_LOCK_TTL=900
|
|
61
|
+
SCHEDULE_PREFIX=swiftpy_schedule:
|
|
62
|
+
|
|
51
63
|
# Filesystems & Storage
|
|
52
64
|
FILESYSTEM_DISK=local
|
|
53
65
|
STORAGE_LOCAL_ROOT=storage/app/private
|
|
@@ -91,6 +103,8 @@ AUTH_THROTTLE_ENABLED=true
|
|
|
91
103
|
AUTH_THROTTLE_MAX_ATTEMPTS=5
|
|
92
104
|
AUTH_THROTTLE_DECAY_SECONDS=60
|
|
93
105
|
AUTH_THROTTLE_LOCKOUT_SECONDS=60
|
|
106
|
+
AUTH_THROTTLE_IDENTIFIER_MAX_ATTEMPTS=0
|
|
107
|
+
AUTH_THROTTLE_IDENTIFIER_WINDOW_SECONDS=3600
|
|
94
108
|
|
|
95
109
|
# CORS (use explicit comma-separated origins; never pair '*' with CORS_ALLOW_CREDENTIALS=true)
|
|
96
110
|
CORS_ALLOWED_ORIGINS=http://localhost:3000,http://localhost:8000
|
|
@@ -4,6 +4,65 @@ All notable changes to SwiftPY will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.3.7] - 2026-11-25
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- **PEP 561 Static Typing Support (`swiftpy/py.typed`):** Added the PEP 561 `py.typed` marker packaged into distributions, and updated `Model` / `ModelQueryBuilder[T]` fluent query annotations so repository chains (`await self.model.with_(...).where(...).first()` and `.get()`) preserve concrete model return types in Pyrefly, Mypy, and Pyright.
|
|
11
|
+
- **Declarative Application Schemas (`swiftpy.schemas`):** Added zero-dependency declarative schema module exporting `BaseSchema`, `Schema` (alias of `BaseSchema`), `Field`, `SchemaField`, `SchemaFieldInfo`, `@field_validator`, and `@model_validator` with `@dataclass_transform(kw_only_default=True, field_specifiers=(Field, SchemaField, SchemaFieldInfo))`.
|
|
12
|
+
- Supports automatic type coercion (`str`, `int`, `float`, `bool`, `Decimal`, `UUID`, `date`, `datetime`, `time`, `Enum`, `IntEnum`, `Literal`, `Annotated`, unions, nested schemas, and container generics) and `Field(...)` constraints (`gt`, `ge`, `lt`, `le`, `multiple_of`, `min_length`, `max_length`, `pattern`, `strip_whitespace`, `to_lower`, `to_upper`, `alias`, `exclude`, `default_factory`), raising HTTP 422 `ValidationException` on failure.
|
|
13
|
+
- Added `.validate()`, `.from_dict()`, `.model_validate()`, `await .from_request()`, `.from_model()`, `.to_dict(exclude_none=..., exclude_unset=..., by_alias=...)`, `.model_dump()`, `.fields_set`, and `.is_set()`.
|
|
14
|
+
- **HTTP Schema Auto-Injection & Serialization (`Router`, `Container`, `Application`, `Response`):** Route functions and controller handlers declaring a `BaseSchema` / `Schema` parameter automatically parse JSON, `application/x-www-form-urlencoded`, or `multipart/form-data` payloads into the validated schema before execution; unbound `BaseSchema` subclasses are excluded from DI auto-wiring; handlers returning `BaseSchema` (or `list[BaseSchema]`) auto-serialize to JSON (including `set` / `frozenset` -> JSON arrays via `_json_default`).
|
|
15
|
+
- **ORM & Auth Interoperability:** `Model.create()`, `Model.force_create()`, `model.update()`, and `model.force_update()` accept `BaseSchema` instances directly (`to_dict()` on create with keyword overrides, `to_dict(exclude_unset=True)` on update to preserve omitted fields); `Auth.attempt()`, `Auth.attempt_when()`, and `Auth.once()` (along with `AuthManager` / `AuthProxy`) accept `BaseSchema` payloads; and `isset()` resolves canonical schema fields, aliases, nested schemas, and `__extra_fields__`.
|
|
16
|
+
- **Schema Hardening & Performance:** `BaseSchema` tracks post-validation field mutations in `__fields_set__`, enforces `Annotated[T, Field(...)]` constraints inside generic collections, normalizes mixed `Decimal`/float bounds, rejects `_`-prefixed keys and prevents method shadowing under `extra = "allow"`, supports single-mapping and positional runtime constructors, skips `copy.deepcopy()` on immutable defaults, and avoids duplicate `request.input(_preload=True)` body parsing when handlers take both `Request` and `BaseSchema`/`FormRequest`.
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
- **CLI Scaffolding (`make:schema`, `make:repository`, `swiftpy new`):** Updated `schema.stub` and starter `app/schemas/user_schema.py` to generate declarative `BaseSchema` DTOs (`UserCreateSchema` / `UserResponseSchema`), updated `repository.stub` with typed `model: type[YourModel]` guidance, and bumped the `swiftpy-framework` dependency floor to `>=0.3.7` (package version `0.3.7`).
|
|
20
|
+
|
|
21
|
+
### Documentation
|
|
22
|
+
- Updated Application Schemas, Validation & Form Requests, HTTP Routing, ORM Models, CLI & Testing, Application Architecture, and Installation Quick Start guides for `swiftpy.schemas`, typed repositories, and `0.3.7`.
|
|
23
|
+
|
|
24
|
+
## [0.3.6] - 2026-11-24
|
|
25
|
+
|
|
26
|
+
### Added
|
|
27
|
+
- **Query Builder Predicates:** Added `where_column()`, correlated `where_exists()` / `where_not_exists()` (including OR variants), grouped `where_any()` / `where_all()` / `where_none()`, and `where_past()` / `where_future()` with ORM parity.
|
|
28
|
+
- **JSON Query Support:** Added strict `column->path` expressions for `where()`, `where_in()` and query-builder `update()` keys, plus JSON containment, key-existence, and array-length helpers with ORM parity. JSON paths are bound as PostgreSQL `text[]`; JSON path updates do not create missing intermediate parents.
|
|
29
|
+
- **Query Builder Unions & Row Locks:** Added `union()` / `union_all()` to `QueryBuilder`, plus `shared_lock()` / `lock_for_update()` on query builders and model queries. Row locks require an active transaction; unsupported lock combinations and union terminals raise `QueryError`.
|
|
30
|
+
- **Query Debugging:** Added `to_raw_sql()`, `dump()`, `dump_raw_sql()`, `dd()`, and `dd_raw_sql()` to `QueryBuilder` and `ModelQueryBuilder`, plus the exported `QueryDumpError`. Rendered SQL and logged bindings are for development/debugging only and must not be executed or used to build queries.
|
|
31
|
+
|
|
32
|
+
### Changed
|
|
33
|
+
- **Packaging & Scaffolding:** Bumped `swiftpy-framework` and the `swiftpy new` dependency floor to `0.3.6`.
|
|
34
|
+
|
|
35
|
+
## [0.3.5] - 2026-11-23
|
|
36
|
+
|
|
37
|
+
### Added
|
|
38
|
+
- **Proxy-Aware Client IP Detection (`swiftpy.http.client_ip`, `swiftpy.http.request`, `swiftpy.websockets.connection`, `swiftpy.auth.auth_manager`):**
|
|
39
|
+
- Added pure stateless resolver module `swiftpy.http.client_ip` (`parse_trusted_proxies`, `extract_trusted_proxies_from_config`, `resolve_client_ip`) defaulting `http.trusted_proxies` fail-safely to `[]` via [`config/http.py`](config/http.py) (`TRUSTED_PROXIES`, `HTTP_TRUSTED_PROXIES`).
|
|
40
|
+
- Added dual instance/class descriptor `request.ip()` and `Request.ip()` on `Request`, `WebSocketConnection.ip()`, WebSocket handshake `Request` context binding in `Application`, and unified `Auth` / `LoginThrottle` IP extraction via `req.ip() or "unknown"`.
|
|
41
|
+
- Enforces strict CIDR validation (`strict=True`), IPv4-mapped IPv6 unwrapping (`::ffff:172.30.0.5` -> `172.30.0.5`), right-to-left `X-Forwarded-For` traversal with header/hop bounds (`4096` bytes / `32` hops) and port/zone-ID/hostname rejection, and conservative resolution to direct peer (without consulting `X-Real-IP`) whenever `X-Forwarded-For` is malformed, empty, or all-trusted.
|
|
42
|
+
- **Native Task Scheduler (`swiftpy.scheduling`):**
|
|
43
|
+
- Added zero-dependency strict 5-field Vixie cron + IANA `ZoneInfo` engine (`cron.py`: macros, ranges, steps, lists, named month/weekday aliases, DOM/DOW OR rule, impossible calendar date rejection with `InvalidCronError`, DST spring-forward/fall-back handling with `fold=0` single firing, `UTC` default).
|
|
44
|
+
- Separated persistent `ScheduleRecord` definitions from `ScheduleOccurrence` execution lifecycles (`pending` -> `claimed` -> `dispatch_pending` -> `dispatched` -> `running` -> `completed` | `failed` | `skipped` | `cancelled`).
|
|
45
|
+
- Added fluent `Schedule` facade, `Scheduler` singleton, `scheduler()` helper, and builders (`cron`, `every_minute`, `every(N).seconds()/minutes()/hours()/days()`, `hourly`, `hourly_at`, `daily`, `daily_at`, `weekly`, `weekly_at`, `monthly`, `monthly_at`, `schedule(at=...)`, `delay(seconds=...)`, `@scheduler.task(...)`, `upsert()`, `update()`, `enable()`, `disable()`, `cancel()`, `get()`, `list_schedules()`, `get_occurrence()`).
|
|
46
|
+
- Added durable `RedisScheduleStore` on `REDIS_QUEUE_DB` (`swiftpy_schedule:`) using atomic Lua scripts (`SAVE_SCHEDULE_LUA`, `CLAIM_DUE_LUA`, `RECLAIM_PENDING_LUA`, `CONFIRM_DISPATCHED_LUA`, compare-and-del `RELEASE_OVERLAP_LOCK_LUA`, monotonic state guards, bounded occurrence history + retention TTLs), plus non-durable process-local `MemoryScheduleStore` (`is_durable = False`, production `ConfigurationError` guard unless opted in) and typed `scheduler.*` lifecycle events (`ScheduleRegistered`, `ScheduledTaskDue`, `ScheduledTaskDispatched`, `ScheduledTaskSkipped`, `ScheduledTaskCompleted`, `ScheduledTaskFailed`).
|
|
47
|
+
- Integrated `QueueWorker` (`running` / `completed` / `failed` hooks, retry overlap lock retention, DLQ lock release, standalone worker Redis prefix resolution), `FrameworkServiceProvider` (`schedule.auto_start = False` default, `SCHEDULE_AUTO_START=true`, clean loop cancellation on shutdown), and CLI commands `schedule:list [--app] [--json] [--prefix]`, `schedule:run [--app] [--limit] [--prefix]`, and `schedule:work [--app] [--sleep] [--max-ticks] [--prefix]`.
|
|
48
|
+
|
|
49
|
+
### Changed
|
|
50
|
+
- **Packaging, Configuration & Scaffolding:** Bumped `swiftpy-framework` and `swiftpy new` dependency floor to `0.3.5`, added [`config/http.py`](config/http.py) and [`config/schedule.py`](config/schedule.py), added `SCHEDULE_*` keys to [`.env.example`](.env.example), and updated `swiftpy new` templates accordingly.
|
|
51
|
+
|
|
52
|
+
### Fixed
|
|
53
|
+
- **`Application(trusted_proxies="a,b")`:** a comma-separated string passed validation but was stored in config as a single invalid entry, making every `request.ip()` (and therefore `Auth.attempt`) raise `ConfigurationError`. The normalized network list is now stored.
|
|
54
|
+
- **Scheduler wake-up cost:** the scheduler loop no longer lists every schedule per iteration; it reads the earliest due time through the new `ScheduleStore.next_due_at()` (`ZRANGE ... 0 0` on Redis) and backs off instead of spinning when overdue work cannot be claimed.
|
|
55
|
+
- **Overlap lock lifetime:** `without_overlapping()` locks are re-armed to their full `lock_ttl` when the worker starts the job, kept alive by a worker heartbeat while the job runs, and extended across retry backoff delays, so queue wait time or long runs no longer allow overlapping executions. Added `ScheduleStore.extend_overlap_lock()` (token-verified compare-and-pexpire).
|
|
56
|
+
- **Duplicate delivery:** `QueueWorker` acknowledges and skips a scheduled job whose occurrence has already completed. Delivery stays at-least-once; use `job.data["_swiftpy_schedule_occurrence"]` as an idempotency key for non-idempotent work.
|
|
57
|
+
- **Request/Scheduler internals:** `request.ip()` is memoized per request, `_instantiate_job_class` no longer relies on `assert`, and the production `memory` schedule-driver guard is shared through `ensure_memory_driver_allowed()`.
|
|
58
|
+
|
|
59
|
+
### Security
|
|
60
|
+
- **Login throttle (`LoginThrottle`):** IPv6 clients are bucketed by `/64` (IPv4-mapped IPv6 collapses to IPv4) so rotating addresses inside one prefix cannot bypass lockouts; the per-key generation counter now expires (`2 * (lockout_seconds + decay_seconds)`) instead of living forever; added optional identifier-wide cap across all IPs via `auth.throttle.identifier_max_attempts` / `identifier_window_seconds` (`AUTH_THROTTLE_IDENTIFIER_MAX_ATTEMPTS`, `AUTH_THROTTLE_IDENTIFIER_WINDOW_SECONDS`; disabled by default because it lets an attacker lock a known account for `lockout_seconds`).
|
|
61
|
+
- **Signed schedules:** schedule records now carry an HMAC-SHA256 `signature` (APP_KEY, previous keys accepted) over `task_kind`, `task_name`, `args`, `kwargs`, and `queue`. The signature is copied onto each occurrence and verified before a job is built; tampered or unsigned records (for example rewritten directly in Redis) are marked `failed` with `ScheduleSignatureError` and never pushed. Schedules registered before an `APP_KEY` was configured must be re-registered.
|
|
62
|
+
|
|
63
|
+
### Documentation
|
|
64
|
+
- Added dedicated Task Scheduler user guide [`documentations/2026-11-22-task-scheduling.md`](documentations/2026-11-22-task-scheduling.md) and updated Requests & Responses, WebSockets, Authentication & Security, Cache/Events/Queues, CLI & Testing, Installation Quick Start, [`docs/2026-11-14_documentation_plan.md`](docs/2026-11-14_documentation_plan.md), and [`README.md`](README.md) for `v0.3.5`.
|
|
65
|
+
|
|
7
66
|
## [0.3.1] - 2026-11-22
|
|
8
67
|
|
|
9
68
|
### Added
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: swiftpy-framework
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.7
|
|
4
4
|
Summary: SwiftPY is a new generation async-first Python framework purpose built for the modern API and AI economy.
|
|
5
5
|
Project-URL: Homepage, https://github.com/obrainwave/swiftpy
|
|
6
6
|
Project-URL: Repository, https://github.com/obrainwave/swiftpy
|
|
@@ -60,7 +60,7 @@ SwiftPY brings the joy and productivity of Laravel to the modern asynchronous Py
|
|
|
60
60
|
- **Native AI Subsystem (`swiftpy.ai`)**: Fluent async `AI` client across OpenAI and Anthropic providers with shared `AIHttpPool` pooling and SSE streaming, batched `EmbeddingsClient`, unified `VectorStore` adapters (`PgVectorAdapter` for PostgreSQL `pgvector`, `InMemoryVectorStore`, Qdrant, Pinecone, Chroma, LanceDB), nonce-bounded RAG pipelines (`rag()`, `Retriever`, Cohere/CrossEncoder rerankers), autonomous `@tool` / `Agent` loops (`app/ai/{agents,tools,pipelines,providers,vectorstores,observers}/`), versioned `messages`-list prompt templates (`Prompt.load("summarise.v2")`, `prompts/`), moderation/rate-limit/budget middlewares, observability telemetry, and `AIFake` / `VectorStoreFake` test doubles.
|
|
61
61
|
- **Database Engine & Native Transactions**: Connection pool management, automatic transaction propagation across context variables, nested transaction savepoints, and strict SQL injection prevention with full identifier quoting for reserved words.
|
|
62
62
|
- **Fluent Migration DSL & Schema Builder**: Laravel-inspired `Blueprint` table definitions, safe statement ordering (drops executed before adds), column comments, unsigned checks, composite keys, and distributed PostgreSQL advisory locks.
|
|
63
|
-
- **At-Least-Once Queues & Signed Bus**: Robust background jobs with Redis visibility timeout leases, HMAC-SHA256 envelope signing, dead-letter routing, and a cryptographically protected cross-worker event bus.
|
|
63
|
+
- **At-Least-Once Queues, Task Scheduler & Signed Bus**: Robust background jobs with Redis visibility timeout leases, HMAC-SHA256 envelope signing, dead-letter routing, proxy-aware client IP resolution (`request.ip()`, `Request.ip()`, `websocket.ip()` behind `TRUSTED_PROXIES`), a native 5-field Vixie cron + `ZoneInfo` task scheduler (`Schedule` / `Scheduler`, crash-recoverable `RedisScheduleStore`, overlap locks, `schedule:work` / `schedule:run` / `schedule:list`), and a cryptographically protected cross-worker event bus.
|
|
64
64
|
- **WebSocket Gateway**: Structured WebSocket connection management, topic subscriptions, broadcast fan-out, ping/pong heartbeats, and strict same-origin handshake validation.
|
|
65
65
|
- **Zero-Config Provider Auto-Discovery**: Automatic service provider discovery in `app/providers/` that registers container dependencies behind the scenes without manual entrypoint registration.
|
|
66
66
|
- **Developer CLI (`swiftpy`)**: Built-in CLI for scaffolding new projects (`new`) and components (`make:*`), running/rolling back/resetting/seeding migrations (`migrate*`, `db:seed`), linking public storage, managing queue workers and failed jobs, precompiling caches, and starting the ASGI server.
|
|
@@ -93,8 +93,11 @@ All core architectural, storage, AI, and security hardening phases have been com
|
|
|
93
93
|
| **Release v0.2.2: Model `.update()`, `isset()`, `has_file()`, & Auth TTL** | `Model.update()` / `force_update()`, `JWT_ACCESS_TTL=3600`, 405 `"for route"` detail, `isset()` helper, `request.has_file()` (sync & `await`), CORS guide | ✅ Completed |
|
|
94
94
|
| **Release v0.3.0: Project Structure, AI/Prompts & Controller Routing** | Standardized `app/` + `app/ai/{agents,tools,pipelines,providers,vectorstores,observers}/` + `prompts/` scaffolding, `Prompt.load("summarise.v2")` & `messages` lists, direct unbound controller method DI (`router.get(..., Controller.index)`), `make:agent`/`make:tool`/`make:prompt`, Admin Dashboard removal | ✅ Completed |
|
|
95
95
|
| **Release v0.3.1: Auth Ergonomics, ORM `has()` & Login Throttling** | `Auth.attempt()`, `Callback` conditions + ORM `has()`/`where_has()`, `attempt_when()`, Remember Me cookies (`Blueprint.remember_token()`, `via_remember()`), `login_using_id()`, `once()`, default `LoginThrottle` (`429 TooManyRequestsError`), `Request.cookies` | ✅ Completed |
|
|
96
|
+
| **Release v0.3.5: Client IP Detection & Native Task Scheduler** | Fail-safe `request.ip()` / `Request.ip()` / `websocket.ip()` & `LoginThrottle` IP trust via `TRUSTED_PROXIES`, zero-dependency 5-field cron + `ZoneInfo` scheduler (`Schedule` / `Scheduler`), Redis crash recovery (`_CLAIM_DUE_LUA` / `_RECLAIM_PENDING_LUA`), worker overlap locks, `schedule:list`/`run`/`work` | ✅ Completed |
|
|
97
|
+
| **Release v0.3.6: Query Builder Helpers** | `where_column()`, correlated `where_exists()`, `where_any()`/`where_all()`/`where_none()`, `where_past()`/`where_future()`, JSON `column->path` queries & updates, `union()`/`union_all()`, `shared_lock()`/`lock_for_update()`, debug helpers (`to_raw_sql()`, `dump()`, `dd()`) with ORM parity | ✅ Completed |
|
|
98
|
+
| **Release v0.3.7: Declarative Schemas (`swiftpy.schemas`) & Pyrefly/PEP 561 Typing** | `swiftpy/py.typed` PEP 561 marker, `Model` / `ModelQueryBuilder[T]` fluent generic preservation, `BaseSchema` / `Schema` & `Field(...)` constraints, `@field_validator` / `@model_validator`, Router/Controller auto-injection & JSON serialization, ORM `create()`/`update()` schema interop, `make:schema` & `swiftpy new` updates | ✅ Completed |
|
|
96
99
|
|
|
97
|
-
*See [`documentations/2026-11-14-installation-quick-start.md`](./documentations/2026-11-14-installation-quick-start.md)
|
|
100
|
+
*See [`documentations/2026-11-14-installation-quick-start.md`](./documentations/2026-11-14-installation-quick-start.md), [`documentations/2026-11-21-application-architecture-and-project-structure.md`](./documentations/2026-11-21-application-architecture-and-project-structure.md), and [`documentations/2026-11-22-task-scheduling.md`](./documentations/2026-11-22-task-scheduling.md) for the complete documentation series and [`CHANGELOG.md`](./CHANGELOG.md) for release notes.*
|
|
98
101
|
|
|
99
102
|
---
|
|
100
103
|
|
|
@@ -487,6 +490,11 @@ swiftpy queue:failed --limit 50
|
|
|
487
490
|
swiftpy queue:retry --all
|
|
488
491
|
swiftpy queue:flush
|
|
489
492
|
|
|
493
|
+
# List, trigger once, or run the dedicated task scheduler loop
|
|
494
|
+
swiftpy schedule:list --app main:app
|
|
495
|
+
swiftpy schedule:run --app main:app
|
|
496
|
+
swiftpy schedule:work --app main:app --sleep 1.0
|
|
497
|
+
|
|
490
498
|
# Run, inspect, rollback, reset, and seed database migrations
|
|
491
499
|
swiftpy migrate
|
|
492
500
|
swiftpy migrate:status
|
|
@@ -544,6 +552,10 @@ SwiftPY reads environment variables and YAML/Python configuration files with str
|
|
|
544
552
|
| `CORS_ALLOWED_ORIGINS` | `cors.allowed_origins` | `[]` | Comma-separated list of exact allowed CORS origins (never pair `"*"` with `CORS_ALLOW_CREDENTIALS=true`). See the [CORS Guide](./documentations/2026-11-21-cors.md). |
|
|
545
553
|
| `CORS_ALLOW_CREDENTIALS` | `cors.allow_credentials` | `False` | Whether cross-origin requests may include credentials/cookies. |
|
|
546
554
|
| `CORS_MAX_AGE` | `cors.max_age` | `600` | Preflight `OPTIONS` cache duration (`Access-Control-Max-Age`) in seconds. |
|
|
555
|
+
| `TRUSTED_PROXIES` | `http.trusted_proxies` | `[]` | Comma-separated or JSON array of trusted proxy IPs / strict CIDRs for `request.ip()`, `ws.ip()`, and `LoginThrottle`. |
|
|
556
|
+
| `SCHEDULE_DRIVER` | `schedule.driver` | `"redis"` | Scheduler persistence backend (`"redis"` on `REDIS_QUEUE_DB` or non-durable `"memory"`). See the [Task Scheduling Guide](./documentations/2026-11-22-task-scheduling.md). |
|
|
557
|
+
| `SCHEDULE_TIMEZONE` | `schedule.timezone` | `"UTC"` | Default IANA timezone name for scheduled cron/one-time tasks (`fallbacks` to `APP_TIMEZONE` then `"UTC"`). |
|
|
558
|
+
| `SCHEDULE_AUTO_START` | `schedule.auto_start` | `False` | Opt-in in-process scheduler loop during `Application.startup()` (keep `False` when scaling multiple web workers). |
|
|
547
559
|
| `AI_ENABLED` | `ai.enabled` | `True` | Master toggle for `swiftpy.ai` requests (raises `AIModuleDisabledError` when disabled). |
|
|
548
560
|
| `AI_DEFAULT_PROVIDER` | `ai.default` | `"openai"` | Default LLM provider (`"openai"` or `"anthropic"`) when not inferred from model name. |
|
|
549
561
|
| `OPENAI_API_KEY` | `ai.providers.openai.api_key` | `""` | OpenAI API key for chat, streaming, and embeddings. |
|
|
@@ -638,9 +650,11 @@ SwiftPY follows a clean, intuitive layout inspired by modern application archite
|
|
|
638
650
|
│ ├── database.py
|
|
639
651
|
│ ├── events.py
|
|
640
652
|
│ ├── filesystems.py
|
|
653
|
+
│ ├── http.py
|
|
641
654
|
│ ├── logging.py
|
|
642
655
|
│ ├── mail.py
|
|
643
|
-
│
|
|
656
|
+
│ ├── queue.py
|
|
657
|
+
│ └── schedule.py
|
|
644
658
|
├── database/
|
|
645
659
|
│ └── migrations/ # Timestamped database migrations
|
|
646
660
|
├── prompts/ # Named & versioned AI prompt templates (summarise.py, classify.py)
|
|
@@ -659,10 +673,13 @@ SwiftPY follows a clean, intuitive layout inspired by modern application archite
|
|
|
659
673
|
│ ├── logging/ # Log facade, LogManager, async QueueHandler/QueueListener drivers
|
|
660
674
|
│ ├── mail/ # Mailables, SMTP/Sendmail/API transports, templates
|
|
661
675
|
│ ├── queue/ # At-least-once queue workers, job serialization
|
|
676
|
+
│ ├── scheduling/ # 5-field cron engine, Redis/Memory stores, Scheduler & builders
|
|
677
|
+
│ ├── schemas/ # Declarative BaseSchema / Schema DTOs, Field constraints & validators
|
|
662
678
|
│ ├── support/ # Shared identifiers, keys, Redis config, string inflection
|
|
663
679
|
│ ├── testing/ # TestClient, TestCase, AIFake, MailFake, VectorStoreFake, DB fixtures
|
|
664
680
|
│ ├── validation/ # FormRequest, fail-closed Validator, builtin & DB rules
|
|
665
|
-
│
|
|
681
|
+
│ ├── websockets/ # WebSocket manager, connections, broadcast
|
|
682
|
+
│ └── py.typed # PEP 561 static typing marker
|
|
666
683
|
├── tests/ # Automated pytest suite
|
|
667
684
|
├── docker-compose.yml # Hardened local PostgreSQL & Redis environment
|
|
668
685
|
├── Dockerfile # Multi-stage production container
|
|
@@ -30,7 +30,7 @@ SwiftPY brings the joy and productivity of Laravel to the modern asynchronous Py
|
|
|
30
30
|
- **Native AI Subsystem (`swiftpy.ai`)**: Fluent async `AI` client across OpenAI and Anthropic providers with shared `AIHttpPool` pooling and SSE streaming, batched `EmbeddingsClient`, unified `VectorStore` adapters (`PgVectorAdapter` for PostgreSQL `pgvector`, `InMemoryVectorStore`, Qdrant, Pinecone, Chroma, LanceDB), nonce-bounded RAG pipelines (`rag()`, `Retriever`, Cohere/CrossEncoder rerankers), autonomous `@tool` / `Agent` loops (`app/ai/{agents,tools,pipelines,providers,vectorstores,observers}/`), versioned `messages`-list prompt templates (`Prompt.load("summarise.v2")`, `prompts/`), moderation/rate-limit/budget middlewares, observability telemetry, and `AIFake` / `VectorStoreFake` test doubles.
|
|
31
31
|
- **Database Engine & Native Transactions**: Connection pool management, automatic transaction propagation across context variables, nested transaction savepoints, and strict SQL injection prevention with full identifier quoting for reserved words.
|
|
32
32
|
- **Fluent Migration DSL & Schema Builder**: Laravel-inspired `Blueprint` table definitions, safe statement ordering (drops executed before adds), column comments, unsigned checks, composite keys, and distributed PostgreSQL advisory locks.
|
|
33
|
-
- **At-Least-Once Queues & Signed Bus**: Robust background jobs with Redis visibility timeout leases, HMAC-SHA256 envelope signing, dead-letter routing, and a cryptographically protected cross-worker event bus.
|
|
33
|
+
- **At-Least-Once Queues, Task Scheduler & Signed Bus**: Robust background jobs with Redis visibility timeout leases, HMAC-SHA256 envelope signing, dead-letter routing, proxy-aware client IP resolution (`request.ip()`, `Request.ip()`, `websocket.ip()` behind `TRUSTED_PROXIES`), a native 5-field Vixie cron + `ZoneInfo` task scheduler (`Schedule` / `Scheduler`, crash-recoverable `RedisScheduleStore`, overlap locks, `schedule:work` / `schedule:run` / `schedule:list`), and a cryptographically protected cross-worker event bus.
|
|
34
34
|
- **WebSocket Gateway**: Structured WebSocket connection management, topic subscriptions, broadcast fan-out, ping/pong heartbeats, and strict same-origin handshake validation.
|
|
35
35
|
- **Zero-Config Provider Auto-Discovery**: Automatic service provider discovery in `app/providers/` that registers container dependencies behind the scenes without manual entrypoint registration.
|
|
36
36
|
- **Developer CLI (`swiftpy`)**: Built-in CLI for scaffolding new projects (`new`) and components (`make:*`), running/rolling back/resetting/seeding migrations (`migrate*`, `db:seed`), linking public storage, managing queue workers and failed jobs, precompiling caches, and starting the ASGI server.
|
|
@@ -63,8 +63,11 @@ All core architectural, storage, AI, and security hardening phases have been com
|
|
|
63
63
|
| **Release v0.2.2: Model `.update()`, `isset()`, `has_file()`, & Auth TTL** | `Model.update()` / `force_update()`, `JWT_ACCESS_TTL=3600`, 405 `"for route"` detail, `isset()` helper, `request.has_file()` (sync & `await`), CORS guide | ✅ Completed |
|
|
64
64
|
| **Release v0.3.0: Project Structure, AI/Prompts & Controller Routing** | Standardized `app/` + `app/ai/{agents,tools,pipelines,providers,vectorstores,observers}/` + `prompts/` scaffolding, `Prompt.load("summarise.v2")` & `messages` lists, direct unbound controller method DI (`router.get(..., Controller.index)`), `make:agent`/`make:tool`/`make:prompt`, Admin Dashboard removal | ✅ Completed |
|
|
65
65
|
| **Release v0.3.1: Auth Ergonomics, ORM `has()` & Login Throttling** | `Auth.attempt()`, `Callback` conditions + ORM `has()`/`where_has()`, `attempt_when()`, Remember Me cookies (`Blueprint.remember_token()`, `via_remember()`), `login_using_id()`, `once()`, default `LoginThrottle` (`429 TooManyRequestsError`), `Request.cookies` | ✅ Completed |
|
|
66
|
+
| **Release v0.3.5: Client IP Detection & Native Task Scheduler** | Fail-safe `request.ip()` / `Request.ip()` / `websocket.ip()` & `LoginThrottle` IP trust via `TRUSTED_PROXIES`, zero-dependency 5-field cron + `ZoneInfo` scheduler (`Schedule` / `Scheduler`), Redis crash recovery (`_CLAIM_DUE_LUA` / `_RECLAIM_PENDING_LUA`), worker overlap locks, `schedule:list`/`run`/`work` | ✅ Completed |
|
|
67
|
+
| **Release v0.3.6: Query Builder Helpers** | `where_column()`, correlated `where_exists()`, `where_any()`/`where_all()`/`where_none()`, `where_past()`/`where_future()`, JSON `column->path` queries & updates, `union()`/`union_all()`, `shared_lock()`/`lock_for_update()`, debug helpers (`to_raw_sql()`, `dump()`, `dd()`) with ORM parity | ✅ Completed |
|
|
68
|
+
| **Release v0.3.7: Declarative Schemas (`swiftpy.schemas`) & Pyrefly/PEP 561 Typing** | `swiftpy/py.typed` PEP 561 marker, `Model` / `ModelQueryBuilder[T]` fluent generic preservation, `BaseSchema` / `Schema` & `Field(...)` constraints, `@field_validator` / `@model_validator`, Router/Controller auto-injection & JSON serialization, ORM `create()`/`update()` schema interop, `make:schema` & `swiftpy new` updates | ✅ Completed |
|
|
66
69
|
|
|
67
|
-
*See [`documentations/2026-11-14-installation-quick-start.md`](./documentations/2026-11-14-installation-quick-start.md)
|
|
70
|
+
*See [`documentations/2026-11-14-installation-quick-start.md`](./documentations/2026-11-14-installation-quick-start.md), [`documentations/2026-11-21-application-architecture-and-project-structure.md`](./documentations/2026-11-21-application-architecture-and-project-structure.md), and [`documentations/2026-11-22-task-scheduling.md`](./documentations/2026-11-22-task-scheduling.md) for the complete documentation series and [`CHANGELOG.md`](./CHANGELOG.md) for release notes.*
|
|
68
71
|
|
|
69
72
|
---
|
|
70
73
|
|
|
@@ -457,6 +460,11 @@ swiftpy queue:failed --limit 50
|
|
|
457
460
|
swiftpy queue:retry --all
|
|
458
461
|
swiftpy queue:flush
|
|
459
462
|
|
|
463
|
+
# List, trigger once, or run the dedicated task scheduler loop
|
|
464
|
+
swiftpy schedule:list --app main:app
|
|
465
|
+
swiftpy schedule:run --app main:app
|
|
466
|
+
swiftpy schedule:work --app main:app --sleep 1.0
|
|
467
|
+
|
|
460
468
|
# Run, inspect, rollback, reset, and seed database migrations
|
|
461
469
|
swiftpy migrate
|
|
462
470
|
swiftpy migrate:status
|
|
@@ -514,6 +522,10 @@ SwiftPY reads environment variables and YAML/Python configuration files with str
|
|
|
514
522
|
| `CORS_ALLOWED_ORIGINS` | `cors.allowed_origins` | `[]` | Comma-separated list of exact allowed CORS origins (never pair `"*"` with `CORS_ALLOW_CREDENTIALS=true`). See the [CORS Guide](./documentations/2026-11-21-cors.md). |
|
|
515
523
|
| `CORS_ALLOW_CREDENTIALS` | `cors.allow_credentials` | `False` | Whether cross-origin requests may include credentials/cookies. |
|
|
516
524
|
| `CORS_MAX_AGE` | `cors.max_age` | `600` | Preflight `OPTIONS` cache duration (`Access-Control-Max-Age`) in seconds. |
|
|
525
|
+
| `TRUSTED_PROXIES` | `http.trusted_proxies` | `[]` | Comma-separated or JSON array of trusted proxy IPs / strict CIDRs for `request.ip()`, `ws.ip()`, and `LoginThrottle`. |
|
|
526
|
+
| `SCHEDULE_DRIVER` | `schedule.driver` | `"redis"` | Scheduler persistence backend (`"redis"` on `REDIS_QUEUE_DB` or non-durable `"memory"`). See the [Task Scheduling Guide](./documentations/2026-11-22-task-scheduling.md). |
|
|
527
|
+
| `SCHEDULE_TIMEZONE` | `schedule.timezone` | `"UTC"` | Default IANA timezone name for scheduled cron/one-time tasks (`fallbacks` to `APP_TIMEZONE` then `"UTC"`). |
|
|
528
|
+
| `SCHEDULE_AUTO_START` | `schedule.auto_start` | `False` | Opt-in in-process scheduler loop during `Application.startup()` (keep `False` when scaling multiple web workers). |
|
|
517
529
|
| `AI_ENABLED` | `ai.enabled` | `True` | Master toggle for `swiftpy.ai` requests (raises `AIModuleDisabledError` when disabled). |
|
|
518
530
|
| `AI_DEFAULT_PROVIDER` | `ai.default` | `"openai"` | Default LLM provider (`"openai"` or `"anthropic"`) when not inferred from model name. |
|
|
519
531
|
| `OPENAI_API_KEY` | `ai.providers.openai.api_key` | `""` | OpenAI API key for chat, streaming, and embeddings. |
|
|
@@ -608,9 +620,11 @@ SwiftPY follows a clean, intuitive layout inspired by modern application archite
|
|
|
608
620
|
│ ├── database.py
|
|
609
621
|
│ ├── events.py
|
|
610
622
|
│ ├── filesystems.py
|
|
623
|
+
│ ├── http.py
|
|
611
624
|
│ ├── logging.py
|
|
612
625
|
│ ├── mail.py
|
|
613
|
-
│
|
|
626
|
+
│ ├── queue.py
|
|
627
|
+
│ └── schedule.py
|
|
614
628
|
├── database/
|
|
615
629
|
│ └── migrations/ # Timestamped database migrations
|
|
616
630
|
├── prompts/ # Named & versioned AI prompt templates (summarise.py, classify.py)
|
|
@@ -629,10 +643,13 @@ SwiftPY follows a clean, intuitive layout inspired by modern application archite
|
|
|
629
643
|
│ ├── logging/ # Log facade, LogManager, async QueueHandler/QueueListener drivers
|
|
630
644
|
│ ├── mail/ # Mailables, SMTP/Sendmail/API transports, templates
|
|
631
645
|
│ ├── queue/ # At-least-once queue workers, job serialization
|
|
646
|
+
│ ├── scheduling/ # 5-field cron engine, Redis/Memory stores, Scheduler & builders
|
|
647
|
+
│ ├── schemas/ # Declarative BaseSchema / Schema DTOs, Field constraints & validators
|
|
632
648
|
│ ├── support/ # Shared identifiers, keys, Redis config, string inflection
|
|
633
649
|
│ ├── testing/ # TestClient, TestCase, AIFake, MailFake, VectorStoreFake, DB fixtures
|
|
634
650
|
│ ├── validation/ # FormRequest, fail-closed Validator, builtin & DB rules
|
|
635
|
-
│
|
|
651
|
+
│ ├── websockets/ # WebSocket manager, connections, broadcast
|
|
652
|
+
│ └── py.typed # PEP 561 static typing marker
|
|
636
653
|
├── tests/ # Automated pytest suite
|
|
637
654
|
├── docker-compose.yml # Hardened local PostgreSQL & Redis environment
|
|
638
655
|
├── Dockerfile # Multi-stage production container
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from swiftpy.schemas import BaseSchema, Field
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class UserCreateSchema(BaseSchema):
|
|
7
|
+
"""Input validation schema for user creation requests."""
|
|
8
|
+
|
|
9
|
+
name: str = Field(..., min_length=2, max_length=100)
|
|
10
|
+
email: str = Field(..., max_length=255)
|
|
11
|
+
password: str = Field(..., min_length=8)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class UserResponseSchema(BaseSchema):
|
|
15
|
+
"""Output serialization schema for user responses."""
|
|
16
|
+
|
|
17
|
+
id: int
|
|
18
|
+
name: str
|
|
19
|
+
email: str
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
UserSchema = UserResponseSchema
|
|
@@ -19,6 +19,12 @@ CONFIG: dict[str, object] = {
|
|
|
19
19
|
"max_attempts": int(env("AUTH_THROTTLE_MAX_ATTEMPTS", "5")),
|
|
20
20
|
"decay_seconds": int(env("AUTH_THROTTLE_DECAY_SECONDS", "60")),
|
|
21
21
|
"lockout_seconds": int(env("AUTH_THROTTLE_LOCKOUT_SECONDS", "60")),
|
|
22
|
+
"identifier_max_attempts": int(
|
|
23
|
+
env("AUTH_THROTTLE_IDENTIFIER_MAX_ATTEMPTS", "0")
|
|
24
|
+
),
|
|
25
|
+
"identifier_window_seconds": int(
|
|
26
|
+
env("AUTH_THROTTLE_IDENTIFIER_WINDOW_SECONDS", "3600")
|
|
27
|
+
),
|
|
22
28
|
"prefix": env("AUTH_THROTTLE_PREFIX", "auth:throttle"),
|
|
23
29
|
},
|
|
24
30
|
"guards": {
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import json
|
|
4
|
+
from typing import Any
|
|
5
|
+
|
|
6
|
+
from swiftpy.helpers.helper import env
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def _parse_proxy_env(raw: Any) -> Any:
|
|
10
|
+
if isinstance(raw, list):
|
|
11
|
+
return raw
|
|
12
|
+
if not isinstance(raw, str):
|
|
13
|
+
return raw
|
|
14
|
+
stripped = raw.strip()
|
|
15
|
+
if not stripped:
|
|
16
|
+
return []
|
|
17
|
+
if stripped.startswith("[") and stripped.endswith("]"):
|
|
18
|
+
try:
|
|
19
|
+
parsed = json.loads(stripped)
|
|
20
|
+
except (json.JSONDecodeError, ValueError):
|
|
21
|
+
return [stripped]
|
|
22
|
+
if isinstance(parsed, list):
|
|
23
|
+
return parsed
|
|
24
|
+
return parsed
|
|
25
|
+
return [entry.strip() for entry in stripped.split(",")]
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
_RAW_TRUSTED_PROXIES = env("TRUSTED_PROXIES", env("HTTP_TRUSTED_PROXIES", "")) or ""
|
|
29
|
+
_RAW_MAX_CONTENT_LENGTH = env("HTTP_MAX_CONTENT_LENGTH", None)
|
|
30
|
+
|
|
31
|
+
CONFIG: dict[str, Any] = {
|
|
32
|
+
"trusted_proxies": _parse_proxy_env(_RAW_TRUSTED_PROXIES),
|
|
33
|
+
"max_body_size": int(
|
|
34
|
+
env("HTTP_MAX_BODY_SIZE", str(2 * 1024 * 1024)) or (2 * 1024 * 1024)
|
|
35
|
+
),
|
|
36
|
+
"max_content_length": (
|
|
37
|
+
int(_RAW_MAX_CONTENT_LENGTH)
|
|
38
|
+
if _RAW_MAX_CONTENT_LENGTH not in (None, "")
|
|
39
|
+
else None
|
|
40
|
+
),
|
|
41
|
+
"max_json_depth": int(env("HTTP_MAX_JSON_DEPTH", "32") or "32"),
|
|
42
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from swiftpy.helpers.helper import env, env_bool
|
|
4
|
+
|
|
5
|
+
CONFIG: dict[str, object] = {
|
|
6
|
+
"driver": env("SCHEDULE_DRIVER", "redis"),
|
|
7
|
+
"timezone": env("SCHEDULE_TIMEZONE", env("APP_TIMEZONE", "UTC")),
|
|
8
|
+
"auto_start": env_bool("SCHEDULE_AUTO_START", False),
|
|
9
|
+
"poll_interval": float(env("SCHEDULE_POLL_INTERVAL", "1.0") or "1.0"),
|
|
10
|
+
"grace_seconds": float(env("SCHEDULE_GRACE_SECONDS", "60.0") or "60.0"),
|
|
11
|
+
"dispatch_lease_seconds": float(
|
|
12
|
+
env("SCHEDULE_DISPATCH_LEASE_SECONDS", "30.0") or "30.0"
|
|
13
|
+
),
|
|
14
|
+
"max_dispatch_attempts": int(
|
|
15
|
+
env("SCHEDULE_MAX_DISPATCH_ATTEMPTS", "5") or "5"
|
|
16
|
+
),
|
|
17
|
+
"default_lock_ttl": int(env("SCHEDULE_DEFAULT_LOCK_TTL", "900") or "900"),
|
|
18
|
+
"prefix": env("SCHEDULE_PREFIX", "swiftpy_schedule:"),
|
|
19
|
+
"retention_seconds": int(
|
|
20
|
+
env("SCHEDULE_RETENTION_SECONDS", str(7 * 24 * 3600)) or str(7 * 24 * 3600)
|
|
21
|
+
),
|
|
22
|
+
"max_occurrences_per_schedule": int(
|
|
23
|
+
env("SCHEDULE_MAX_OCCURRENCES", "200") or "200"
|
|
24
|
+
),
|
|
25
|
+
}
|
|
@@ -411,7 +411,7 @@ Supported `Auth` login patterns:
|
|
|
411
411
|
...
|
|
412
412
|
```
|
|
413
413
|
|
|
414
|
-
- **Default Login Throttling (`LoginThrottle`):** Enabled by default on `Auth.attempt()` and `Auth.attempt_when()` (`max_attempts=5`, `decay_seconds=60`, `lockout_seconds=60` in `config/auth.py`). Exceeding `max_attempts` dispatches a `Lockout` event (`"auth.lockout"`) and raises `TooManyRequestsError`, mapping automatically to HTTP `429 Too Many Requests` with a `Retry-After` header. Call `await Auth.too_many_attempts(...)`, `await Auth.available_in(...)`, or `await Auth.clear_throttle(...)` to inspect or reset counters manually, or disable globally with `AUTH_THROTTLE_ENABLED=false`.
|
|
414
|
+
- **Default Login Throttling (`LoginThrottle`):** Enabled by default on `Auth.attempt()` and `Auth.attempt_when()` (`max_attempts=5`, `decay_seconds=60`, `lockout_seconds=60` in `config/auth.py`). Keys rate-limit counters and `Failed` / `Lockout` event client IPs through `request.ip()` so verified `X-Forwarded-For` client IPs work cleanly behind `TRUSTED_PROXIES` while forged forwarding headers from untrusted peers are ignored. Exceeding `max_attempts` dispatches a `Lockout` event (`"auth.lockout"`) and raises `TooManyRequestsError`, mapping automatically to HTTP `429 Too Many Requests` with a `Retry-After` header. Call `await Auth.too_many_attempts(...)`, `await Auth.available_in(...)`, or `await Auth.clear_throttle(...)` to inspect or reset counters manually, or disable globally with `AUTH_THROTTLE_ENABLED=false`. IPv6 clients share one bucket per `/64` prefix (IPv4-mapped IPv6 uses the IPv4 bucket), so rotating addresses inside a prefix does not reset the counter. Optionally set `AUTH_THROTTLE_IDENTIFIER_MAX_ATTEMPTS` (> 0, default `0` = off) to also cap failures per identifier across all IPs within `AUTH_THROTTLE_IDENTIFIER_WINDOW_SECONDS` (default `3600`); when the cap is hit every IP is locked out for `lockout_seconds`, which also lets an attacker who knows an identifier lock that account out temporarily. `Auth.attempt(..., ip=...)` trusts the supplied `ip` as-is, so never pass a raw request header value.
|
|
415
415
|
|
|
416
416
|
### 5. Token Revocation, `auth().logout()` & `auth().logout_all()`
|
|
417
417
|
|
|
@@ -296,6 +296,8 @@ swiftpy queue:retry all --queue emails --app main:app
|
|
|
296
296
|
swiftpy queue:flush --queue emails --app main:app
|
|
297
297
|
```
|
|
298
298
|
|
|
299
|
+
When `QueueWorker` executes tasks submitted by the [Task Scheduler](2026-11-22-task-scheduling.md), it automatically records `running`, `completed`, and `failed` occurrence transitions in Redis, retains `.without_overlapping()` locks across intermediate backoff retries, and releases locks via compare-and-delete Lua upon `ack()` or final DLQ exhaustion.
|
|
300
|
+
|
|
299
301
|
---
|
|
300
302
|
|
|
301
303
|
## Important Defaults & Production Safeguards
|
|
@@ -170,6 +170,9 @@ Key filtering methods:
|
|
|
170
170
|
- **`NULL` handling:** `.where("deleted_at", None)` compiles to `IS NULL` and `.where("deleted_at", "!=", None)` compiles to `IS NOT NULL` (or use `.where_null()`, `.or_where_null()`, `.where_not_null()`, `.or_where_not_null()`). Passing `None` with `<`, `>`, `LIKE`, or `IN` raises `QueryError`.
|
|
171
171
|
- **Lists & subqueries:** `.where_in(col, values)`, `.or_where_in(...)`, `.where_not_in(...)`, `.or_where_not_in(...)`. Empty lists compile safely (`IN []` -> `WHERE FALSE`; `NOT IN []` -> `WHERE TRUE`).
|
|
172
172
|
- **Ranges:** `.where_between(col, (min_v, max_v))`, `.where_not_between(...)`, `.or_where_between(...)`, `.or_where_not_between(...)`.
|
|
173
|
+
- **Multi-column comparisons:** `.where_any(columns, operator, value)`, `.where_all(...)`, and `.where_none(...)` compare the same value against a non-empty list/tuple of columns. `where_any` matches one or more columns, `where_all` requires every comparison, and `where_none` negates the OR group. Each value is bound separately; the one-argument form defaults to equality.
|
|
174
|
+
- **Column comparisons & existence:** `.where_column("orders.user_id", "=", "users.id")` compares two validated identifiers. `.where_exists(query)` / `.where_not_exists(query)` accept a `QueryBuilder`, including a correlated subquery; use the outer table's real name in `where_column`. Table aliases are not supported, and the subquery must use a different table.
|
|
175
|
+
- **Time comparisons:** `.where_past("due_at")` and `.where_future("starts_at")` compare against PostgreSQL `CURRENT_TIMESTAMP`; `or_where_past` and `or_where_future` are available. `CURRENT_TIMESTAMP` is fixed at the start of the current transaction. For `timestamp without time zone`, PostgreSQL's session time zone applies. SQL NULL timestamps do not match.
|
|
173
176
|
- **Escaped `LIKE` / `ILIKE`:** `.where_like(col, value, case_insensitive=False, match="contains")` and `.where_ilike(...)` (plus `or_where_like` / `or_where_ilike`). Supported `match` modes are `"contains"`, `"starts_with"` / `"prefix"`, `"ends_with"` / `"suffix"`, and `"exact"`. User characters `%`, `_`, and `\` are automatically escaped via `escape_like()` with `ESCAPE '\'`.
|
|
174
177
|
- **Nested parentheses:** `.where_group(callback)` / `.or_where_group(callback)` group boolean expressions (`AND (...)` / `OR (...)`).
|
|
175
178
|
- **Conditionals:** `.when(cond, fn, default=None)` and `.unless(cond, fn, default=None)`.
|
|
@@ -178,6 +181,112 @@ Key filtering methods:
|
|
|
178
181
|
> [!CAUTION]
|
|
179
182
|
> Never pass untrusted user strings directly into `select_raw()`, `where_raw()`, or `having_raw()`. Always use `?` placeholders in `sql` and pass user values in `bindings`.
|
|
180
183
|
|
|
184
|
+
### JSON Columns
|
|
185
|
+
|
|
186
|
+
JSON paths use PostgreSQL's `->` separator, not dots. Dots already qualify identifiers (`users.settings` means a table-qualified column); `users.settings.theme` would otherwise be ambiguous. A path is a validated column followed by one or more identifier or non-negative array-index segments:
|
|
187
|
+
|
|
188
|
+
```python
|
|
189
|
+
from swiftpy.database import Query
|
|
190
|
+
|
|
191
|
+
query = (
|
|
192
|
+
Query.table("users")
|
|
193
|
+
.where("settings->theme", "dark")
|
|
194
|
+
.where_in("settings->languages", ["en", "fr"])
|
|
195
|
+
.where_json_contains("settings->roles", "editor")
|
|
196
|
+
.where_json_contains_key("settings->theme")
|
|
197
|
+
)
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
In addition to plain columns, `->` paths are accepted only in `where`/`or_where`, `where_in`/`where_not_in` and their `or_` variants, the `where_json_*` methods, and `update()` keys. The path is sent as a bound `text[]`; values remain bound parameters. JSON paths are not accepted in `select`, `order_by`, `group_by`, `pluck`, `value`, null/range filters, joins, inserts, upserts, counters, or direct instance `Model.update(...)`.
|
|
201
|
+
|
|
202
|
+
For `where()` and `where_in()` on a JSON path:
|
|
203
|
+
|
|
204
|
+
| Operator | Value | Behavior |
|
|
205
|
+
|---|---|---|
|
|
206
|
+
| `=` | JSON value | JSONB equality; Python values are JSON-encoded at registration |
|
|
207
|
+
| `=` / `!=` / `<>` | `None` | `=` matches JSON null and missing paths; `!=` / `<>` matches only non-null JSON values |
|
|
208
|
+
| `!=` / `<>` | non-`None` value | JSONB inequality; missing paths and SQL NULL do not match |
|
|
209
|
+
| `<`, `>`, `<=`, `>=` | string or number (not bool) | Compare only rows whose JSON type matches, so mixed-type rows do not raise cast errors |
|
|
210
|
+
| `LIKE`, `ILIKE` | string | Compare JSON string values only |
|
|
211
|
+
| `IN`, `NOT IN` | list/tuple of JSON scalars | Compare JSONB values; an empty list becomes `FALSE` / `TRUE` |
|
|
212
|
+
|
|
213
|
+
Use the dedicated helpers for PostgreSQL containment, key existence, and array length:
|
|
214
|
+
|
|
215
|
+
```python
|
|
216
|
+
from swiftpy.database import Query
|
|
217
|
+
|
|
218
|
+
query = (
|
|
219
|
+
Query.table("users")
|
|
220
|
+
.where_json_contains("settings->roles", "editor")
|
|
221
|
+
.where_json_doesnt_contain("settings->roles", "banned")
|
|
222
|
+
.where_json_contains_key("settings->theme")
|
|
223
|
+
.where_json_doesnt_contain_key("settings->retired")
|
|
224
|
+
.where_json_length("settings->languages", ">=", 2)
|
|
225
|
+
)
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
Containment follows PostgreSQL `jsonb @>` semantics: the scalar `"editor"` is contained in an array such as `["editor", "admin"]`; an array value means that all its elements must be present. `where_json_doesnt_contain()` also matches a missing path or SQL NULL. A JSON `null` value counts as an existing key. `where_json_length()` compares array lengths only; an object, scalar, missing path, or SQL NULL never matches, including for `!=`.
|
|
229
|
+
|
|
230
|
+
JSON path updates use `jsonb_set()` and can be mixed with ordinary assignments:
|
|
231
|
+
|
|
232
|
+
```python
|
|
233
|
+
from swiftpy.database import Query
|
|
234
|
+
|
|
235
|
+
await (
|
|
236
|
+
Query.table("users")
|
|
237
|
+
.where("id", user_id)
|
|
238
|
+
.update({"settings->theme": "dark", "settings->notifications->email": True})
|
|
239
|
+
)
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
A SQL NULL JSON column is treated as `{}`, and assigning Python `None` writes JSON `null`. PostgreSQL `jsonb_set()` does not create missing intermediate parents: when `settings->notifications` does not already exist, setting `settings->notifications->email` leaves the document unchanged. Updating both an entire JSON column and one of its paths in the same statement is rejected. JSON path updates are available through query-builder `.update(...)`, not a persisted model instance's `update(...)`.
|
|
243
|
+
|
|
244
|
+
### Unions
|
|
245
|
+
|
|
246
|
+
`QueryBuilder.union(query)` removes duplicate rows; `union_all(query)` preserves them. Each branch must be a `QueryBuilder` that selects the same number of compatible columns. A branch's own ordering and pagination stay inside that branch; ordering/limit/offset on the base builder apply to the combined result. An order column must name an output column. Clauses added after `union()` still belong to the base query. Nested unions and union methods on `ModelQueryBuilder` / `Model` are not supported.
|
|
247
|
+
|
|
248
|
+
```python
|
|
249
|
+
from swiftpy.database import Query
|
|
250
|
+
|
|
251
|
+
combined = (
|
|
252
|
+
Query.table("current_users").select("id", "email")
|
|
253
|
+
.union_all(Query.table("archived_users").select("id", "email"))
|
|
254
|
+
.order_by("id")
|
|
255
|
+
.limit(50)
|
|
256
|
+
)
|
|
257
|
+
rows = await combined.get()
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
Union queries support `get()`, `first()`, `simple_paginate()`, `to_sql()`, and the debugging helpers below. Aggregates, `exists()`, `paginate()`, `pluck()`, `value()`, writes, and chunking raise `QueryError` rather than silently operating on only one branch. A union builder can be used as a subquery.
|
|
261
|
+
|
|
262
|
+
### Pessimistic Row Locks
|
|
263
|
+
|
|
264
|
+
`shared_lock()` emits `FOR SHARE`; `lock_for_update()` emits `FOR UPDATE`. Locks require a live SwiftPY transaction when a read is executed:
|
|
265
|
+
|
|
266
|
+
```python
|
|
267
|
+
from swiftpy.database import Query, db
|
|
268
|
+
|
|
269
|
+
async with db.transaction():
|
|
270
|
+
user = await Query.table("users").where("id", user_id).lock_for_update().first()
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
The lock is applied to reads such as `get()`, `first()`, `value()`, and `simple_paginate()`. Calling `to_sql()` only compiles SQL and does not require a transaction. Locks cannot be combined with `DISTINCT`, `GROUP BY`, `HAVING`, or unions; they are rejected on write operations. Aggregates and the count query in `paginate()` do not carry the row lock, while the page's data query does.
|
|
274
|
+
|
|
275
|
+
### Query Debugging
|
|
276
|
+
|
|
277
|
+
`to_raw_sql()` produces a human-readable rendering; `dump()` logs parameterized SQL plus bindings, and `dump_raw_sql()` logs the rendering. The `dd()` variants log and raise `QueryDumpError` to stop the current flow. Enable INFO logging for `swiftpy.database.query_builder` to see these records.
|
|
278
|
+
|
|
279
|
+
```python
|
|
280
|
+
from swiftpy.database import Query
|
|
281
|
+
|
|
282
|
+
query = Query.table("users").where("email", "ada@example.com")
|
|
283
|
+
sql, bindings = query.to_sql() # Parameterized SQL and safe binding values
|
|
284
|
+
debug_sql = query.to_raw_sql() # Human-readable only
|
|
285
|
+
query.dump()
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
`to_raw_sql()` output is for human debugging only: never execute it or use it to construct another query. Its string escaping assumes PostgreSQL's default `standard_conforming_strings=on`, and values that cannot be represented as ordinary PostgreSQL text literals (such as Python strings containing NUL bytes or unsupported custom objects) are rendered diagnostically rather than as executable SQL literals. Bindings may contain credentials or tokens, so keep `dump*()` and `dd*()` out of production code paths.
|
|
289
|
+
|
|
181
290
|
### Grouping, `HAVING`, Ordering & Terminals
|
|
182
291
|
|
|
183
292
|
```python
|
|
@@ -210,9 +210,10 @@ SwiftPY inspects your route handler's signature and automatically binds any comb
|
|
|
210
210
|
1. `request: Request` — the incoming HTTP request.
|
|
211
211
|
2. **Path parameters** matching `{param_name}` in the route pattern.
|
|
212
212
|
3. **`FormRequest` subclasses** — automatically parsed and validated before your handler executes (covered in Guide #4).
|
|
213
|
-
4.
|
|
214
|
-
5. **
|
|
215
|
-
6. **
|
|
213
|
+
4. **`BaseSchema` / `Schema` subclasses** — automatically parsed from JSON, form-urlencoded, or multipart bodies, coerced to your field annotations, and validated via `Field(...)` constraints (HTTP `422` on failure; covered in [Application Schemas](2026-11-19-application-schemas.md)).
|
|
214
|
+
5. **Uploaded files** — `UploadedFile` or `list[UploadedFile]` matching the multipart field name.
|
|
215
|
+
6. **DI container services** — any class or binding registered in the application container (such as `OrderService`, `Config`, or repository classes).
|
|
216
|
+
7. **Optional defaulted parameters** — parameters with default values when not satisfied by path or DI bindings.
|
|
216
217
|
|
|
217
218
|
```python
|
|
218
219
|
@router.post("/orders/{order_id}/receipt")
|
|
@@ -473,14 +474,15 @@ async def bulk_import(request: Request) -> dict[str, str]:
|
|
|
473
474
|
|
|
474
475
|
## Returning Responses (`Response` & Helpers)
|
|
475
476
|
|
|
476
|
-
### Auto-JSON Serialization for `dict` and `
|
|
477
|
+
### Auto-JSON Serialization for `dict`, `list`, and `BaseSchema`
|
|
477
478
|
|
|
478
|
-
Any `dict` or `
|
|
479
|
+
Any `dict`, `list`, or `BaseSchema` / `Schema` instance returned from a handler is automatically wrapped into an `application/json` `Response`. SwiftPY's JSON encoder handles:
|
|
479
480
|
|
|
480
481
|
- `datetime`, `date`, `time` -> ISO-8601 strings
|
|
481
482
|
- `UUID` and `Decimal` -> strings
|
|
482
483
|
- `Enum` -> `.value`
|
|
483
|
-
-
|
|
484
|
+
- `set` and `frozenset` -> JSON arrays
|
|
485
|
+
- `BaseSchema` and other objects with `.to_dict()` -> dictionary output with excluded (`exclude=True`) or `__hidden__` fields removed
|
|
484
486
|
|
|
485
487
|
For safety and RFC compliance, `NaN`/`Infinity` floats and raw `bytes` values raise `TypeError` during JSON serialization.
|
|
486
488
|
|