wappa 0.1.4__tar.gz → 0.2.4__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.
- {wappa-0.1.4 → wappa-0.2.4}/.gitignore +1 -1
- wappa-0.2.4/CHANGELOG.md +76 -0
- {wappa-0.1.4 → wappa-0.2.4}/PKG-INFO +369 -32
- wappa-0.2.4/README.md +364 -0
- wappa-0.2.4/cache/tables/493419253863068_tables.json +25 -0
- wappa-0.2.4/cache/users/493419253863068_573168227670.json +17 -0
- {wappa-0.1.4 → wappa-0.2.4}/pyproject.toml +9 -35
- {wappa-0.1.4 → wappa-0.2.4}/uv.lock +161 -676
- wappa-0.2.4/wappa/__init__.py +33 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/api/controllers/webhook_controller.py +43 -15
- {wappa-0.1.4 → wappa-0.2.4}/wappa/api/dependencies/__init__.py +7 -5
- wappa-0.2.4/wappa/api/dependencies/cache_dependencies.py +101 -0
- wappa-0.2.4/wappa/api/dependencies/event_dependencies.py +76 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/api/dependencies/whatsapp_dependencies.py +9 -36
- {wappa-0.1.4 → wappa-0.2.4}/wappa/api/middleware/error_handler.py +0 -9
- {wappa-0.1.4 → wappa-0.2.4}/wappa/api/middleware/owner.py +37 -15
- wappa-0.2.4/wappa/api/models/handler_models.py +59 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/api/routes/webhooks.py +2 -2
- {wappa-0.1.4 → wappa-0.2.4}/wappa/api/routes/whatsapp/__init__.py +4 -0
- wappa-0.2.4/wappa/api/routes/whatsapp/whatsapp_health.py +86 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/api/routes/whatsapp/whatsapp_interactive.py +76 -137
- {wappa-0.1.4 → wappa-0.2.4}/wappa/api/routes/whatsapp/whatsapp_media.py +45 -36
- {wappa-0.1.4 → wappa-0.2.4}/wappa/api/routes/whatsapp/whatsapp_messages.py +25 -37
- {wappa-0.1.4 → wappa-0.2.4}/wappa/api/routes/whatsapp/whatsapp_specialized.py +55 -126
- wappa-0.2.4/wappa/api/routes/whatsapp/whatsapp_state_handlers.py +195 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/api/routes/whatsapp/whatsapp_templates.py +106 -157
- {wappa-0.1.4 → wappa-0.2.4}/wappa/api/routes/whatsapp_combined.py +4 -0
- wappa-0.2.4/wappa/api/services/__init__.py +9 -0
- wappa-0.2.4/wappa/api/services/handler_state_service.py +151 -0
- wappa-0.2.4/wappa/api/services/template_state_service.py +184 -0
- wappa-0.2.4/wappa/api/utils/__init__.py +38 -0
- wappa-0.2.4/wappa/api/utils/error_helpers.py +160 -0
- wappa-0.2.4/wappa/api/utils/event_decorators.py +148 -0
- wappa-0.2.4/wappa/api/utils/response_helpers.py +85 -0
- wappa-0.2.4/wappa/api/utils/tenant_helpers.py +26 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/cli/__init__.py +1 -1
- wappa-0.2.4/wappa/cli/examples/db_redis_echo_example/README.md +449 -0
- wappa-0.2.4/wappa/cli/examples/db_redis_echo_example/app/__init__.py +20 -0
- wappa-0.2.4/wappa/cli/examples/db_redis_echo_example/app/config/__init__.py +5 -0
- wappa-0.2.4/wappa/cli/examples/db_redis_echo_example/app/config/config.py +51 -0
- wappa-0.2.4/wappa/cli/examples/db_redis_echo_example/app/handlers/__init__.py +21 -0
- wappa-0.2.4/wappa/cli/examples/db_redis_echo_example/app/handlers/command_handlers.py +295 -0
- wappa-0.2.4/wappa/cli/examples/db_redis_echo_example/app/handlers/message_handlers.py +353 -0
- wappa-0.2.4/wappa/cli/examples/db_redis_echo_example/app/main.py +242 -0
- wappa-0.2.4/wappa/cli/examples/db_redis_echo_example/app/master_event.py +258 -0
- wappa-0.2.4/wappa/cli/examples/db_redis_echo_example/app/models/__init__.py +34 -0
- wappa-0.2.4/wappa/cli/examples/db_redis_echo_example/app/models/cache_models.py +96 -0
- wappa-0.2.4/wappa/cli/examples/db_redis_echo_example/app/models/database_models.py +428 -0
- wappa-0.2.4/wappa/cli/examples/db_redis_echo_example/app/utils/__init__.py +28 -0
- wappa-0.2.4/wappa/cli/examples/db_redis_echo_example/app/utils/cache_utils.py +176 -0
- wappa-0.2.4/wappa/cli/examples/db_redis_echo_example/app/utils/database_utils.py +239 -0
- wappa-0.2.4/wappa/cli/examples/db_redis_echo_example/app/utils/extraction_utils.py +267 -0
- wappa-0.2.4/wappa/cli/examples/init/.env.example +33 -0
- wappa-0.2.4/wappa/cli/examples/init/app/__init__.py +0 -0
- wappa-0.2.4/wappa/cli/examples/init/app/main.py +9 -0
- wappa-0.2.4/wappa/cli/examples/init/app/master_event.py +10 -0
- wappa-0.2.4/wappa/cli/examples/json_cache_example/.env.example +33 -0
- wappa-0.2.4/wappa/cli/examples/json_cache_example/.gitignore +69 -0
- wappa-0.2.4/wappa/cli/examples/json_cache_example/README.md +190 -0
- wappa-0.2.4/wappa/cli/examples/json_cache_example/app/__init__.py +1 -0
- wappa-0.2.4/wappa/cli/examples/json_cache_example/app/main.py +247 -0
- wappa-0.2.4/wappa/cli/examples/json_cache_example/app/master_event.py +450 -0
- wappa-0.2.4/wappa/cli/examples/json_cache_example/app/models/__init__.py +1 -0
- wappa-0.2.4/wappa/cli/examples/json_cache_example/app/models/json_demo_models.py +256 -0
- wappa-0.2.4/wappa/cli/examples/json_cache_example/app/scores/__init__.py +35 -0
- wappa-0.2.4/wappa/cli/examples/json_cache_example/app/scores/constants.py +12 -0
- wappa-0.2.4/wappa/cli/examples/json_cache_example/app/scores/score_base.py +199 -0
- wappa-0.2.4/wappa/cli/examples/json_cache_example/app/scores/score_cache_statistics.py +265 -0
- wappa-0.2.4/wappa/cli/examples/json_cache_example/app/scores/score_message_history.py +193 -0
- wappa-0.2.4/wappa/cli/examples/json_cache_example/app/scores/score_state_commands.py +269 -0
- wappa-0.2.4/wappa/cli/examples/json_cache_example/app/scores/score_user_management.py +234 -0
- wappa-0.2.4/wappa/cli/examples/json_cache_example/app/utils/__init__.py +26 -0
- wappa-0.2.4/wappa/cli/examples/json_cache_example/app/utils/cache_utils.py +154 -0
- wappa-0.2.4/wappa/cli/examples/json_cache_example/app/utils/message_utils.py +251 -0
- wappa-0.2.4/wappa/cli/examples/openai_transcript/.gitignore +69 -0
- wappa-0.2.4/wappa/cli/examples/openai_transcript/README.md +0 -0
- wappa-0.2.4/wappa/cli/examples/openai_transcript/app/__init__.py +0 -0
- wappa-0.2.4/wappa/cli/examples/openai_transcript/app/main.py +9 -0
- wappa-0.2.4/wappa/cli/examples/openai_transcript/app/master_event.py +62 -0
- wappa-0.2.4/wappa/cli/examples/openai_transcript/app/openai_utils/__init__.py +3 -0
- wappa-0.2.4/wappa/cli/examples/openai_transcript/app/openai_utils/audio_processing.py +89 -0
- wappa-0.2.4/wappa/cli/examples/redis_cache_example/.env.example +33 -0
- wappa-0.2.4/wappa/cli/examples/redis_cache_example/.gitignore +69 -0
- wappa-0.2.4/wappa/cli/examples/redis_cache_example/README.md +0 -0
- wappa-0.2.4/wappa/cli/examples/redis_cache_example/app/__init__.py +6 -0
- wappa-0.2.4/wappa/cli/examples/redis_cache_example/app/main.py +246 -0
- wappa-0.2.4/wappa/cli/examples/redis_cache_example/app/master_event.py +495 -0
- wappa-0.2.4/wappa/cli/examples/redis_cache_example/app/models/redis_demo_models.py +256 -0
- wappa-0.2.4/wappa/cli/examples/redis_cache_example/app/scores/__init__.py +38 -0
- wappa-0.2.4/wappa/cli/examples/redis_cache_example/app/scores/constants.py +12 -0
- wappa-0.2.4/wappa/cli/examples/redis_cache_example/app/scores/score_base.py +199 -0
- wappa-0.2.4/wappa/cli/examples/redis_cache_example/app/scores/score_cache_statistics.py +265 -0
- wappa-0.2.4/wappa/cli/examples/redis_cache_example/app/scores/score_message_history.py +193 -0
- wappa-0.2.4/wappa/cli/examples/redis_cache_example/app/scores/score_state_commands.py +269 -0
- wappa-0.2.4/wappa/cli/examples/redis_cache_example/app/scores/score_user_management.py +234 -0
- wappa-0.2.4/wappa/cli/examples/redis_cache_example/app/utils/__init__.py +26 -0
- wappa-0.2.4/wappa/cli/examples/redis_cache_example/app/utils/cache_utils.py +174 -0
- wappa-0.2.4/wappa/cli/examples/redis_cache_example/app/utils/message_utils.py +251 -0
- wappa-0.2.4/wappa/cli/examples/redis_pubsub_example/.env.example +12 -0
- wappa-0.2.4/wappa/cli/examples/redis_pubsub_example/.gitignore +41 -0
- wappa-0.2.4/wappa/cli/examples/redis_pubsub_example/README.md +215 -0
- wappa-0.2.4/wappa/cli/examples/redis_pubsub_example/app/__init__.py +5 -0
- wappa-0.2.4/wappa/cli/examples/redis_pubsub_example/app/main.py +227 -0
- wappa-0.2.4/wappa/cli/examples/redis_pubsub_example/app/master_event.py +161 -0
- wappa-0.2.4/wappa/cli/examples/redis_pubsub_example/app/pubsub_listener.py +227 -0
- wappa-0.2.4/wappa/cli/examples/redis_pubsub_example/app/scores/__init__.py +6 -0
- wappa-0.2.4/wappa/cli/examples/simple_echo_example/.env.example +33 -0
- wappa-0.2.4/wappa/cli/examples/simple_echo_example/.gitignore +69 -0
- wappa-0.2.4/wappa/cli/examples/simple_echo_example/README.md +0 -0
- wappa-0.2.4/wappa/cli/examples/simple_echo_example/app/__init__.py +7 -0
- wappa-0.2.4/wappa/cli/examples/simple_echo_example/app/main.py +191 -0
- wappa-0.2.4/wappa/cli/examples/simple_echo_example/app/master_event.py +230 -0
- wappa-0.2.4/wappa/cli/examples/wappa_expiry_example/README.md +320 -0
- wappa-0.2.4/wappa/cli/examples/wappa_expiry_example/app/__init__.py +1 -0
- wappa-0.2.4/wappa/cli/examples/wappa_expiry_example/app/expiry_handlers.py +189 -0
- wappa-0.2.4/wappa/cli/examples/wappa_expiry_example/app/main.py +30 -0
- wappa-0.2.4/wappa/cli/examples/wappa_expiry_example/app/master_event.py +187 -0
- wappa-0.2.4/wappa/cli/examples/wappa_expiry_example/app/utils.py +102 -0
- wappa-0.2.4/wappa/cli/examples/wappa_full_example/.dockerignore +171 -0
- wappa-0.2.4/wappa/cli/examples/wappa_full_example/.env.example +33 -0
- wappa-0.2.4/wappa/cli/examples/wappa_full_example/.gitignore +69 -0
- wappa-0.2.4/wappa/cli/examples/wappa_full_example/Dockerfile +85 -0
- wappa-0.2.4/wappa/cli/examples/wappa_full_example/RAILWAY_DEPLOYMENT.md +366 -0
- wappa-0.2.4/wappa/cli/examples/wappa_full_example/README.md +322 -0
- wappa-0.2.4/wappa/cli/examples/wappa_full_example/app/__init__.py +6 -0
- wappa-0.2.4/wappa/cli/examples/wappa_full_example/app/handlers/__init__.py +5 -0
- wappa-0.2.4/wappa/cli/examples/wappa_full_example/app/handlers/command_handlers.py +799 -0
- wappa-0.2.4/wappa/cli/examples/wappa_full_example/app/handlers/message_handlers.py +559 -0
- wappa-0.2.4/wappa/cli/examples/wappa_full_example/app/handlers/state_handlers.py +721 -0
- wappa-0.2.4/wappa/cli/examples/wappa_full_example/app/main.py +269 -0
- wappa-0.2.4/wappa/cli/examples/wappa_full_example/app/master_event.py +613 -0
- wappa-0.2.4/wappa/cli/examples/wappa_full_example/app/media/README.md +54 -0
- wappa-0.2.4/wappa/cli/examples/wappa_full_example/app/media/buttons/README.md +62 -0
- wappa-0.2.4/wappa/cli/examples/wappa_full_example/app/media/buttons/kitty.png +0 -0
- wappa-0.2.4/wappa/cli/examples/wappa_full_example/app/media/buttons/puppy.png +0 -0
- wappa-0.2.4/wappa/cli/examples/wappa_full_example/app/media/list/README.md +110 -0
- wappa-0.2.4/wappa/cli/examples/wappa_full_example/app/media/list/audio.mp3 +0 -0
- wappa-0.2.4/wappa/cli/examples/wappa_full_example/app/media/list/document.pdf +0 -0
- wappa-0.2.4/wappa/cli/examples/wappa_full_example/app/media/list/image.png +0 -0
- wappa-0.2.4/wappa/cli/examples/wappa_full_example/app/media/list/video.mp4 +0 -0
- wappa-0.2.4/wappa/cli/examples/wappa_full_example/app/models/__init__.py +5 -0
- wappa-0.2.4/wappa/cli/examples/wappa_full_example/app/models/api_tracking_models.py +147 -0
- wappa-0.2.4/wappa/cli/examples/wappa_full_example/app/models/state_models.py +434 -0
- wappa-0.2.4/wappa/cli/examples/wappa_full_example/app/models/user_models.py +303 -0
- wappa-0.2.4/wappa/cli/examples/wappa_full_example/app/models/webhook_metadata.py +327 -0
- wappa-0.2.4/wappa/cli/examples/wappa_full_example/app/utils/__init__.py +5 -0
- wappa-0.2.4/wappa/cli/examples/wappa_full_example/app/utils/cache_utils.py +679 -0
- wappa-0.2.4/wappa/cli/examples/wappa_full_example/app/utils/media_handler.py +516 -0
- wappa-0.2.4/wappa/cli/examples/wappa_full_example/app/utils/metadata_extractor.py +337 -0
- wappa-0.2.4/wappa/cli/examples/wappa_full_example/docker-compose.yml +170 -0
- wappa-0.2.4/wappa/cli/examples/wappa_full_example/nginx.conf +177 -0
- wappa-0.2.4/wappa/cli/examples/wappa_full_example/railway.toml +30 -0
- wappa-0.2.4/wappa/cli/main.py +560 -0
- wappa-0.2.4/wappa/cli/templates/__init__.py.template +0 -0
- wappa-0.2.4/wappa/cli/templates/env.template +77 -0
- wappa-0.2.4/wappa/cli/templates/gitignore.template +165 -0
- wappa-0.2.4/wappa/cli/templates/main.py.template +8 -0
- wappa-0.2.4/wappa/cli/templates/master_event.py.template +8 -0
- wappa-0.2.4/wappa/core/__init__.py +103 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/core/config/settings.py +39 -4
- {wappa-0.1.4 → wappa-0.2.4}/wappa/core/events/__init__.py +2 -0
- wappa-0.2.4/wappa/core/events/api_event_dispatcher.py +79 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/core/events/default_handlers.py +1 -1
- {wappa-0.1.4 → wappa-0.2.4}/wappa/core/events/event_handler.py +127 -8
- {wappa-0.1.4 → wappa-0.2.4}/wappa/core/events/webhook_factory.py +29 -19
- wappa-0.2.4/wappa/core/expiry/__init__.py +91 -0
- wappa-0.2.4/wappa/core/expiry/app_context.py +113 -0
- wappa-0.2.4/wappa/core/expiry/connection.py +143 -0
- wappa-0.2.4/wappa/core/expiry/context_helpers.py +206 -0
- wappa-0.2.4/wappa/core/expiry/dispatcher.py +98 -0
- wappa-0.2.4/wappa/core/expiry/listener.py +141 -0
- wappa-0.2.4/wappa/core/expiry/parser.py +136 -0
- wappa-0.2.4/wappa/core/expiry/reconnection.py +138 -0
- wappa-0.2.4/wappa/core/expiry/registry.py +153 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/core/factory/wappa_builder.py +38 -25
- {wappa-0.1.4 → wappa-0.2.4}/wappa/core/plugins/__init__.py +10 -2
- {wappa-0.1.4 → wappa-0.2.4}/wappa/core/plugins/auth_plugin.py +4 -4
- {wappa-0.1.4 → wappa-0.2.4}/wappa/core/plugins/cors_plugin.py +2 -2
- wappa-0.2.4/wappa/core/plugins/expiry_plugin.py +244 -0
- wappa-0.2.4/wappa/core/plugins/postgres_database_plugin.py +410 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/core/plugins/rate_limit_plugin.py +4 -4
- {wappa-0.1.4 → wappa-0.2.4}/wappa/core/plugins/redis_plugin.py +1 -3
- wappa-0.2.4/wappa/core/plugins/redis_pubsub_plugin.py +200 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/core/plugins/wappa_core_plugin.py +16 -5
- wappa-0.2.4/wappa/core/pubsub/__init__.py +38 -0
- wappa-0.2.4/wappa/core/pubsub/handlers.py +176 -0
- wappa-0.2.4/wappa/core/pubsub/messenger_wrapper.py +315 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/core/types.py +14 -14
- {wappa-0.1.4 → wappa-0.2.4}/wappa/core/wappa_app.py +20 -11
- wappa-0.2.4/wappa/database/__init__.py +36 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/database/adapters/mysql_adapter.py +8 -8
- {wappa-0.1.4 → wappa-0.2.4}/wappa/database/adapters/postgresql_adapter.py +6 -6
- {wappa-0.1.4 → wappa-0.2.4}/wappa/database/adapters/sqlite_adapter.py +7 -6
- wappa-0.2.4/wappa/database/session_manager.py +618 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/domain/enums/messenger_platform.py +3 -4
- wappa-0.2.4/wappa/domain/events/__init__.py +11 -0
- wappa-0.2.4/wappa/domain/events/api_message_event.py +80 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/domain/factories/media_factory.py +5 -20
- {wappa-0.1.4 → wappa-0.2.4}/wappa/domain/factories/message_factory.py +19 -55
- {wappa-0.1.4 → wappa-0.2.4}/wappa/domain/factories/messenger_factory.py +2 -4
- {wappa-0.1.4 → wappa-0.2.4}/wappa/domain/interfaces/__init__.py +11 -2
- {wappa-0.1.4 → wappa-0.2.4}/wappa/domain/interfaces/cache_factory.py +54 -8
- {wappa-0.1.4 → wappa-0.2.4}/wappa/domain/interfaces/cache_interface.py +40 -11
- wappa-0.2.4/wappa/domain/interfaces/cache_interfaces.py +880 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/domain/interfaces/media_interface.py +54 -3
- {wappa-0.1.4 → wappa-0.2.4}/wappa/domain/interfaces/messaging_interface.py +4 -0
- wappa-0.2.4/wappa/domain/interfaces/pubsub_interface.py +50 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/domain/models/media_result.py +41 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/domain/models/platforms/platform_config.py +1 -3
- wappa-0.2.4/wappa/messaging/__init__.py +54 -0
- wappa-0.2.4/wappa/messaging/whatsapp/handlers/whatsapp_interactive_handler.py +605 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/messaging/whatsapp/handlers/whatsapp_media_handler.py +110 -4
- {wappa-0.1.4 → wappa-0.2.4}/wappa/messaging/whatsapp/handlers/whatsapp_specialized_handler.py +6 -6
- {wappa-0.1.4 → wappa-0.2.4}/wappa/messaging/whatsapp/handlers/whatsapp_template_handler.py +7 -7
- {wappa-0.1.4 → wappa-0.2.4}/wappa/messaging/whatsapp/messenger/whatsapp_messenger.py +52 -99
- {wappa-0.1.4 → wappa-0.2.4}/wappa/messaging/whatsapp/models/__init__.py +0 -2
- wappa-0.2.4/wappa/messaging/whatsapp/models/basic_models.py +224 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/messaging/whatsapp/models/interactive_models.py +0 -25
- {wappa-0.1.4 → wappa-0.2.4}/wappa/messaging/whatsapp/models/media_models.py +88 -19
- {wappa-0.1.4 → wappa-0.2.4}/wappa/messaging/whatsapp/models/specialized_models.py +0 -24
- {wappa-0.1.4 → wappa-0.2.4}/wappa/messaging/whatsapp/models/template_models.py +117 -20
- wappa-0.2.4/wappa/messaging/whatsapp/utils/__init__.py +11 -0
- wappa-0.2.4/wappa/messaging/whatsapp/utils/error_helpers.py +104 -0
- wappa-0.2.4/wappa/models/__init__.py +93 -0
- wappa-0.2.4/wappa/persistence/__init__.py +52 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/persistence/cache_factory.py +0 -1
- {wappa-0.1.4 → wappa-0.2.4}/wappa/persistence/json/__init__.py +1 -1
- wappa-0.2.4/wappa/persistence/json/handlers/ai_state.py +311 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/persistence/json/handlers/state_handler.py +75 -58
- {wappa-0.1.4 → wappa-0.2.4}/wappa/persistence/json/handlers/table_handler.py +100 -54
- {wappa-0.1.4 → wappa-0.2.4}/wappa/persistence/json/handlers/user_handler.py +77 -60
- {wappa-0.1.4 → wappa-0.2.4}/wappa/persistence/json/handlers/utils/file_manager.py +42 -39
- {wappa-0.1.4 → wappa-0.2.4}/wappa/persistence/json/handlers/utils/key_factory.py +1 -1
- {wappa-0.1.4 → wappa-0.2.4}/wappa/persistence/json/handlers/utils/serialization.py +13 -11
- wappa-0.2.4/wappa/persistence/json/json_cache_factory.py +89 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/persistence/json/storage_manager.py +99 -79
- {wappa-0.1.4 → wappa-0.2.4}/wappa/persistence/memory/__init__.py +1 -1
- wappa-0.2.4/wappa/persistence/memory/handlers/ai_state.py +311 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/persistence/memory/handlers/state_handler.py +74 -57
- {wappa-0.1.4 → wappa-0.2.4}/wappa/persistence/memory/handlers/table_handler.py +102 -71
- {wappa-0.1.4 → wappa-0.2.4}/wappa/persistence/memory/handlers/user_handler.py +81 -60
- {wappa-0.1.4 → wappa-0.2.4}/wappa/persistence/memory/handlers/utils/key_factory.py +1 -1
- {wappa-0.1.4 → wappa-0.2.4}/wappa/persistence/memory/handlers/utils/memory_store.py +75 -71
- {wappa-0.1.4 → wappa-0.2.4}/wappa/persistence/memory/handlers/utils/ttl_manager.py +59 -67
- {wappa-0.1.4 → wappa-0.2.4}/wappa/persistence/memory/memory_cache_factory.py +34 -21
- {wappa-0.1.4 → wappa-0.2.4}/wappa/persistence/memory/storage_manager.py +52 -62
- wappa-0.2.4/wappa/persistence/redis/__init__.py +33 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/persistence/redis/ops.py +11 -11
- wappa-0.2.4/wappa/persistence/redis/pubsub_subscriber.py +213 -0
- wappa-0.2.4/wappa/persistence/redis/redis_cache_factory.py +115 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/persistence/redis/redis_client.py +19 -17
- wappa-0.2.4/wappa/persistence/redis/redis_handler/ai_state.py +199 -0
- wappa-0.2.4/wappa/persistence/redis/redis_handler/expiry.py +212 -0
- wappa-0.2.4/wappa/persistence/redis/redis_handler/pubsub.py +84 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/persistence/redis/redis_handler/state_handler.py +30 -2
- {wappa-0.1.4 → wappa-0.2.4}/wappa/persistence/redis/redis_handler/table.py +80 -2
- {wappa-0.1.4 → wappa-0.2.4}/wappa/persistence/redis/redis_handler/user.py +25 -1
- wappa-0.2.4/wappa/persistence/redis/redis_handler/utils/key_factory.py +189 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/persistence/redis/redis_manager.py +12 -4
- {wappa-0.1.4 → wappa-0.2.4}/wappa/processors/factory.py +9 -9
- {wappa-0.1.4 → wappa-0.2.4}/wappa/processors/whatsapp_processor.py +17 -5
- wappa-0.2.4/wappa/schemas/core/__init__.py +43 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/schemas/factory.py +6 -9
- {wappa-0.1.4 → wappa-0.2.4}/wappa/schemas/whatsapp/base_models.py +77 -9
- {wappa-0.1.4 → wappa-0.2.4}/wappa/schemas/whatsapp/message_types/errors.py +3 -12
- {wappa-0.1.4 → wappa-0.2.4}/wappa/schemas/whatsapp/validators.py +3 -3
- {wappa-0.1.4 → wappa-0.2.4}/wappa/schemas/whatsapp/webhook_container.py +29 -2
- wappa-0.2.4/wappa/webhooks/__init__.py +65 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/webhooks/core/webhook_interfaces/base_components.py +65 -8
- {wappa-0.1.4 → wappa-0.2.4}/wappa/webhooks/core/webhook_interfaces/universal_webhooks.py +38 -7
- {wappa-0.1.4 → wappa-0.2.4}/wappa/webhooks/factory.py +7 -9
- wappa-0.2.4/wappa/webhooks/whatsapp/__init__.py +57 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/webhooks/whatsapp/base_models.py +77 -9
- {wappa-0.1.4 → wappa-0.2.4}/wappa/webhooks/whatsapp/message_types/audio.py +34 -21
- {wappa-0.1.4 → wappa-0.2.4}/wappa/webhooks/whatsapp/message_types/button.py +20 -17
- {wappa-0.1.4 → wappa-0.2.4}/wappa/webhooks/whatsapp/message_types/contact.py +20 -17
- {wappa-0.1.4 → wappa-0.2.4}/wappa/webhooks/whatsapp/message_types/document.py +25 -26
- {wappa-0.1.4 → wappa-0.2.4}/wappa/webhooks/whatsapp/message_types/errors.py +13 -12
- {wappa-0.1.4 → wappa-0.2.4}/wappa/webhooks/whatsapp/message_types/image.py +45 -27
- {wappa-0.1.4 → wappa-0.2.4}/wappa/webhooks/whatsapp/message_types/interactive.py +20 -18
- {wappa-0.1.4 → wappa-0.2.4}/wappa/webhooks/whatsapp/message_types/location.py +21 -38
- {wappa-0.1.4 → wappa-0.2.4}/wappa/webhooks/whatsapp/message_types/order.py +20 -17
- {wappa-0.1.4 → wappa-0.2.4}/wappa/webhooks/whatsapp/message_types/reaction.py +20 -17
- {wappa-0.1.4 → wappa-0.2.4}/wappa/webhooks/whatsapp/message_types/sticker.py +25 -22
- {wappa-0.1.4 → wappa-0.2.4}/wappa/webhooks/whatsapp/message_types/system.py +56 -21
- {wappa-0.1.4 → wappa-0.2.4}/wappa/webhooks/whatsapp/message_types/text.py +50 -20
- {wappa-0.1.4 → wappa-0.2.4}/wappa/webhooks/whatsapp/message_types/unsupported.py +20 -17
- {wappa-0.1.4 → wappa-0.2.4}/wappa/webhooks/whatsapp/message_types/video.py +44 -38
- {wappa-0.1.4 → wappa-0.2.4}/wappa/webhooks/whatsapp/status_models.py +60 -19
- {wappa-0.1.4 → wappa-0.2.4}/wappa/webhooks/whatsapp/validators.py +3 -3
- {wappa-0.1.4 → wappa-0.2.4}/wappa/webhooks/whatsapp/webhook_container.py +29 -2
- wappa-0.1.4/README.md +0 -10
- wappa-0.1.4/examples/echo_project/README.md +0 -372
- wappa-0.1.4/examples/echo_project/constants.py +0 -243
- wappa-0.1.4/examples/echo_project/echo_handler.py +0 -464
- wappa-0.1.4/examples/echo_project/interactive_builder.py +0 -437
- wappa-0.1.4/examples/echo_project/logic/__init__.py +0 -83
- wappa-0.1.4/examples/echo_project/logic/audio_echo.py +0 -145
- wappa-0.1.4/examples/echo_project/logic/button_activation.py +0 -91
- wappa-0.1.4/examples/echo_project/logic/button_prompt.py +0 -85
- wappa-0.1.4/examples/echo_project/logic/button_selection.py +0 -135
- wappa-0.1.4/examples/echo_project/logic/contact_echo.py +0 -237
- wappa-0.1.4/examples/echo_project/logic/cta_activation.py +0 -63
- wappa-0.1.4/examples/echo_project/logic/document_echo.py +0 -134
- wappa-0.1.4/examples/echo_project/logic/image_echo.py +0 -132
- wappa-0.1.4/examples/echo_project/logic/list_activation.py +0 -91
- wappa-0.1.4/examples/echo_project/logic/list_prompt.py +0 -84
- wappa-0.1.4/examples/echo_project/logic/list_selection.py +0 -166
- wappa-0.1.4/examples/echo_project/logic/location_activation.py +0 -63
- wappa-0.1.4/examples/echo_project/logic/location_echo.py +0 -150
- wappa-0.1.4/examples/echo_project/logic/message_confirmation.py +0 -114
- wappa-0.1.4/examples/echo_project/logic/metadata_extraction.py +0 -235
- wappa-0.1.4/examples/echo_project/logic/state_management.py +0 -283
- wappa-0.1.4/examples/echo_project/logic/text_echo.py +0 -138
- wappa-0.1.4/examples/echo_project/logic/user_storage.py +0 -157
- wappa-0.1.4/examples/echo_project/logic/video_echo.py +0 -132
- wappa-0.1.4/examples/echo_project/main.py +0 -154
- wappa-0.1.4/examples/echo_project/media/README.md +0 -63
- wappa-0.1.4/examples/echo_project/media/WeDancin_RawImg.png +0 -0
- wappa-0.1.4/examples/echo_project/media/audio.ogg +0 -5
- wappa-0.1.4/examples/echo_project/media/cf592_POST.png +0 -0
- wappa-0.1.4/examples/echo_project/media/document.pdf +0 -49
- wappa-0.1.4/examples/echo_project/media/image.png +0 -0
- wappa-0.1.4/examples/echo_project/media/video.mp4 +0 -5
- wappa-0.1.4/examples/echo_project/media_processor.py +0 -472
- wappa-0.1.4/examples/echo_project/state_manager.py +0 -416
- wappa-0.1.4/examples/echo_project/test_architecture.py +0 -48
- wappa-0.1.4/examples/simple_echo/main.py +0 -402
- wappa-0.1.4/examples/simple_wappa/main.py +0 -259
- wappa-0.1.4/wappa/__init__.py +0 -85
- wappa-0.1.4/wappa/cli/main.py +0 -206
- wappa-0.1.4/wappa/core/__init__.py +0 -6
- wappa-0.1.4/wappa/database/__init__.py +0 -18
- wappa-0.1.4/wappa/domain/interfaces/webhooks/__init__.py +0 -1
- wappa-0.1.4/wappa/messaging/__init__.py +0 -7
- wappa-0.1.4/wappa/messaging/whatsapp/handlers/whatsapp_interactive_handler.py +0 -653
- wappa-0.1.4/wappa/messaging/whatsapp/models/basic_models.py +0 -65
- wappa-0.1.4/wappa/persistence/json/cache_adapters.py +0 -271
- wappa-0.1.4/wappa/persistence/json/handlers/__init__.py +0 -1
- wappa-0.1.4/wappa/persistence/json/handlers/utils/__init__.py +0 -1
- wappa-0.1.4/wappa/persistence/json/json_cache_factory.py +0 -76
- wappa-0.1.4/wappa/persistence/memory/cache_adapters.py +0 -271
- wappa-0.1.4/wappa/persistence/memory/handlers/__init__.py +0 -1
- wappa-0.1.4/wappa/persistence/memory/handlers/utils/__init__.py +0 -1
- wappa-0.1.4/wappa/persistence/redis/__init__.py +0 -11
- wappa-0.1.4/wappa/persistence/redis/cache_adapters.py +0 -285
- wappa-0.1.4/wappa/persistence/redis/redis_cache_factory.py +0 -71
- wappa-0.1.4/wappa/persistence/redis/redis_handler/utils/key_factory.py +0 -32
- wappa-0.1.4/wappa/schemas/core/webhook_interfaces/base_components.py +0 -293
- wappa-0.1.4/wappa/schemas/core/webhook_interfaces/universal_webhooks.py +0 -348
- wappa-0.1.4/wappa/schemas/webhooks/__init__.py +0 -3
- wappa-0.1.4/wappa/webhooks/__init__.py +0 -17
- wappa-0.1.4/wappa/webhooks/core/__init__.py +0 -71
- wappa-0.1.4/wappa/webhooks/core/webhook_interfaces/__init__.py +0 -48
- wappa-0.1.4/wappa/webhooks/whatsapp/__init__.py +0 -6
- {wappa-0.1.4 → wappa-0.2.4}/.python-version +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/LICENSE +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/api/__init__.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/api/controllers/__init__.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/api/dependencies/whatsapp_media_dependencies.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/api/middleware/__init__.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/api/middleware/request_logging.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/api/routes/__init__.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/api/routes/health.py +0 -0
- {wappa-0.1.4/examples/redis_cache_example → wappa-0.2.4/wappa/cli/examples/init}/.gitignore +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/core/config/__init__.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/core/events/event_dispatcher.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/core/factory/__init__.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/core/factory/plugin.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/core/logging/__init__.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/core/logging/context.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/core/logging/logger.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/core/plugins/custom_middleware_plugin.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/core/plugins/database_plugin.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/core/plugins/webhook_plugin.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/database/adapter.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/database/adapters/__init__.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/domain/__init__.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/domain/builders/__init__.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/domain/builders/message_builder.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/domain/entities/__init__.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/domain/factories/__init__.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/domain/interfaces/base_repository.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/domain/interfaces/expiry_repository.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/domain/interfaces/pubsub_repository.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/domain/interfaces/repository_factory.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/domain/interfaces/shared_state_repository.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/domain/interfaces/state_repository.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/domain/interfaces/tables_repository.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/domain/interfaces/user_repository.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/domain/models/platforms/__init__.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/domain/services/__init__.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/domain/services/tenant_credentials_service.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/messaging/whatsapp/__init__.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/messaging/whatsapp/client/__init__.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/messaging/whatsapp/client/whatsapp_client.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/messaging/whatsapp/handlers/__init__.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/messaging/whatsapp/messenger/__init__.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/persistence/redis/README.md +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/persistence/redis/redis_handler/__init__.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/persistence/redis/redis_handler/utils/__init__.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/persistence/redis/redis_handler/utils/serde.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/persistence/redis/redis_handler/utils/tenant_cache.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/processors/__init__.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/processors/base_processor.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/schemas/__init__.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/schemas/core/base_message.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/schemas/core/base_status.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/schemas/core/base_webhook.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/schemas/core/types.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/schemas/whatsapp/__init__.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/schemas/whatsapp/message_types/__init__.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/schemas/whatsapp/message_types/audio.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/schemas/whatsapp/message_types/button.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/schemas/whatsapp/message_types/contact.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/schemas/whatsapp/message_types/document.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/schemas/whatsapp/message_types/image.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/schemas/whatsapp/message_types/interactive.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/schemas/whatsapp/message_types/location.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/schemas/whatsapp/message_types/order.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/schemas/whatsapp/message_types/reaction.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/schemas/whatsapp/message_types/sticker.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/schemas/whatsapp/message_types/system.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/schemas/whatsapp/message_types/text.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/schemas/whatsapp/message_types/unsupported.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/schemas/whatsapp/message_types/video.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/schemas/whatsapp/status_models.py +0 -0
- {wappa-0.1.4/wappa/schemas → wappa-0.2.4/wappa/webhooks}/core/__init__.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/webhooks/core/base_message.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/webhooks/core/base_status.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/webhooks/core/base_webhook.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/webhooks/core/types.py +0 -0
- {wappa-0.1.4/wappa/schemas → wappa-0.2.4/wappa/webhooks}/core/webhook_interfaces/__init__.py +0 -0
- {wappa-0.1.4 → wappa-0.2.4}/wappa/webhooks/whatsapp/message_types/__init__.py +0 -0
wappa-0.2.4/CHANGELOG.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to Wappa will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.2.0] - 2025-01-11
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- **PostgresDatabasePlugin**: Production-ready async PostgreSQL plugin with 30x-community inspired patterns
|
|
12
|
+
- Asyncpg-powered async engine for high-concurrency conversational apps
|
|
13
|
+
- Connection pooling with configurable pool_size, max_overflow, and timeouts
|
|
14
|
+
- Exponential backoff retry logic for transient database failures
|
|
15
|
+
- Auto-table creation at startup with SQLModel support
|
|
16
|
+
- Statement cache size configuration for Supabase pgBouncer compatibility
|
|
17
|
+
- Comprehensive error handling and health checks
|
|
18
|
+
|
|
19
|
+
- **RedisPubSubPlugin**: Multi-tenant Redis PubSub messaging system
|
|
20
|
+
- Self-subscribing pattern for bot-to-bot communication
|
|
21
|
+
- Multi-tenant channel management with automatic subscription
|
|
22
|
+
- Channel-based event broadcasting and listening
|
|
23
|
+
- Graceful startup/shutdown with subscription cleanup
|
|
24
|
+
- Example implementation with tenant isolation
|
|
25
|
+
|
|
26
|
+
- **AIState Pool and Cache System**: Multi-backend state management
|
|
27
|
+
- Pool 4 implementation with Redis, JSON, and Memory backends
|
|
28
|
+
- Conversation state tracking with TTL support
|
|
29
|
+
- Cache factory pattern for easy backend switching
|
|
30
|
+
|
|
31
|
+
- **CLI Examples Showcase**: Two new production-ready examples
|
|
32
|
+
- `db_redis_echo_example`: PostgreSQL + Redis two-tier storage with SOLID architecture
|
|
33
|
+
- `redis_pubsub_example`: Multi-tenant PubSub with self-subscribing pattern
|
|
34
|
+
- Both now visible in `wappa examples` command
|
|
35
|
+
|
|
36
|
+
### Changed
|
|
37
|
+
- **SOLID Architecture Refactoring**: db_redis_echo_example refactored from monolithic to clean architecture
|
|
38
|
+
- Reduced master_event.py from 700 lines to 258 lines
|
|
39
|
+
- Separated concerns into handlers/, models/, utils/ structure
|
|
40
|
+
- Created comprehensive scaffolding guide documentation
|
|
41
|
+
- Improved testability and maintainability
|
|
42
|
+
|
|
43
|
+
- **Configuration Management**: db_redis_echo_example now uses Settings class pattern
|
|
44
|
+
- Replaced os.getenv with DBRedisSettings extending base Settings
|
|
45
|
+
- Type-safe configuration with validation at startup
|
|
46
|
+
- Consistent with Wappa's configuration patterns
|
|
47
|
+
|
|
48
|
+
### Fixed
|
|
49
|
+
- **WhatsApp Media Message Schemas**: Added missing `url` field to all media types
|
|
50
|
+
- Fixed video, document, image, audio, and sticker message validation
|
|
51
|
+
- Support for WhatsApp's new direct download URLs in webhook payload
|
|
52
|
+
- Implemented missing abstract methods in WhatsAppVideoMessage
|
|
53
|
+
|
|
54
|
+
- **Message Persistence**: Enhanced structured data storage for special message types
|
|
55
|
+
- Contact messages: Store full contact data in json_content JSONB field
|
|
56
|
+
- Location messages: Store coordinates and location metadata
|
|
57
|
+
- Interactive messages: Store button/list selections
|
|
58
|
+
- Reaction messages: Store emoji and target message reference
|
|
59
|
+
|
|
60
|
+
### Documentation
|
|
61
|
+
- Created wappa-project-scaffolding-guide.md with SOLID best practices
|
|
62
|
+
- Created message-persistence-guide.md for database storage patterns
|
|
63
|
+
- Updated db_redis_echo_example README with architecture documentation
|
|
64
|
+
- Added comprehensive docstrings to PostgresDatabasePlugin
|
|
65
|
+
|
|
66
|
+
### Dependencies
|
|
67
|
+
- Added asyncpg>=0.31.0 for async PostgreSQL support
|
|
68
|
+
|
|
69
|
+
## [0.1.10] - Previous Release
|
|
70
|
+
|
|
71
|
+
Initial stable release with core WhatsApp webhook handling, messaging, and caching capabilities.
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
[0.2.0]: https://github.com/sashanclrp/wappa/compare/v0.1.10...v0.2.0
|
|
76
|
+
[0.1.10]: https://github.com/sashanclrp/wappa/releases/tag/v0.1.10
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: wappa
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.4
|
|
4
4
|
Summary: Open Source Framework to develop smart Workflows, Agents and full chat applications through WhatsApp
|
|
5
5
|
Project-URL: Homepage, https://wappa.mimeia.com
|
|
6
6
|
Project-URL: Documentation, https://wappa.mimeia.com/docs
|
|
@@ -223,48 +223,385 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
|
223
223
|
Requires-Python: >=3.12
|
|
224
224
|
Requires-Dist: aiofiles>=24.1.0
|
|
225
225
|
Requires-Dist: aiohttp>=3.11.0
|
|
226
|
+
Requires-Dist: asyncpg>=0.31.0
|
|
226
227
|
Requires-Dist: fastapi>=0.115.0
|
|
227
228
|
Requires-Dist: hypercorn>=0.17.0
|
|
229
|
+
Requires-Dist: numpy>=2.2.0
|
|
230
|
+
Requires-Dist: openai>=1.69.0
|
|
231
|
+
Requires-Dist: opencv-python-headless>=4.11.0
|
|
232
|
+
Requires-Dist: pillow>=11.1.0
|
|
228
233
|
Requires-Dist: pydantic-settings>=2.10.0
|
|
229
234
|
Requires-Dist: pydantic>=2.8.0
|
|
230
235
|
Requires-Dist: python-dotenv>=1.0.0
|
|
231
236
|
Requires-Dist: python-multipart>=0.0.6
|
|
237
|
+
Requires-Dist: redis>=5.2.0
|
|
232
238
|
Requires-Dist: rich>=13.0.0
|
|
239
|
+
Requires-Dist: sqlmodel>=0.0.24
|
|
233
240
|
Requires-Dist: typer>=0.9.0
|
|
234
241
|
Requires-Dist: uvicorn[standard]>=0.24.0
|
|
235
|
-
Provides-Extra: ai
|
|
236
|
-
Requires-Dist: numpy>=2.2.0; extra == 'ai'
|
|
237
|
-
Requires-Dist: openai>=1.69.0; extra == 'ai'
|
|
238
|
-
Provides-Extra: all
|
|
239
|
-
Requires-Dist: numpy>=2.2.0; extra == 'all'
|
|
240
|
-
Requires-Dist: openai>=1.69.0; extra == 'all'
|
|
241
|
-
Requires-Dist: opencv-python-headless>=4.11.0; extra == 'all'
|
|
242
|
-
Requires-Dist: pillow>=11.1.0; extra == 'all'
|
|
243
|
-
Requires-Dist: redis>=5.2.0; extra == 'all'
|
|
244
|
-
Requires-Dist: sqlmodel>=0.0.24; extra == 'all'
|
|
245
|
-
Provides-Extra: database
|
|
246
|
-
Requires-Dist: sqlmodel>=0.0.24; extra == 'database'
|
|
247
|
-
Provides-Extra: dev
|
|
248
|
-
Requires-Dist: black>=25.1.0; extra == 'dev'
|
|
249
|
-
Requires-Dist: mypy>=1.0.0; extra == 'dev'
|
|
250
|
-
Requires-Dist: pre-commit>=3.0.0; extra == 'dev'
|
|
251
|
-
Requires-Dist: pytest-asyncio>=1.1.0; extra == 'dev'
|
|
252
|
-
Requires-Dist: pytest>=8.4.0; extra == 'dev'
|
|
253
|
-
Requires-Dist: ruff>=0.9.0; extra == 'dev'
|
|
254
|
-
Provides-Extra: media
|
|
255
|
-
Requires-Dist: opencv-python-headless>=4.11.0; extra == 'media'
|
|
256
|
-
Requires-Dist: pillow>=11.1.0; extra == 'media'
|
|
257
|
-
Provides-Extra: redis
|
|
258
|
-
Requires-Dist: redis>=5.2.0; extra == 'redis'
|
|
259
242
|
Description-Content-Type: text/markdown
|
|
260
243
|
|
|
261
|
-
#
|
|
262
|
-
Open Source Framework to develop smart Workflows, Agents and full chat appllications through WhatsApp
|
|
244
|
+
# Wappa 🤖
|
|
263
245
|
|
|
264
|
-
|
|
265
|
-
1) from wapp import WhatsAppMessenger -> So then throughoutt flow in /events I can just initialize the WhatsAppMessenger and send all the messages
|
|
266
|
-
2) have a terminal like ruff or black named wappa so when the user writes uvx wappa init or uv run wappa init a terminal opens to generate a clean project
|
|
246
|
+
**Open Source Framework for WhatsApp Business Applications**
|
|
267
247
|
|
|
268
|
-
|
|
248
|
+
Build intelligent WhatsApp bots, workflows, and chat applications with clean architecture and modern Python.
|
|
269
249
|
|
|
270
|
-
|
|
250
|
+
[](https://www.python.org/downloads/)
|
|
251
|
+
[](https://opensource.org/licenses/Apache-2.0)
|
|
252
|
+
[](https://fastapi.tiangolo.com)
|
|
253
|
+
[](https://developers.facebook.com/docs/whatsapp)
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
## 🚀 What is Wappa?
|
|
258
|
+
|
|
259
|
+
Wappa is a modern Python framework that transforms WhatsApp Business API into a powerful platform for building:
|
|
260
|
+
|
|
261
|
+
- **🤖 Smart Chatbots** - AI-powered conversational experiences
|
|
262
|
+
- **📋 Workflows** - Multi-step business processes
|
|
263
|
+
- **🎯 Agents** - Intelligent customer service automation
|
|
264
|
+
- **💬 Chat Applications** - Full-featured messaging platforms
|
|
265
|
+
|
|
266
|
+
**Built for developers who want clean code, not webhook complexity.**
|
|
267
|
+
|
|
268
|
+
## ✨ Key Features
|
|
269
|
+
|
|
270
|
+
### 🎯 **Simple & Clean**
|
|
271
|
+
```python
|
|
272
|
+
from wappa import Wappa, WappaEventHandler
|
|
273
|
+
|
|
274
|
+
class MyBot(WappaEventHandler):
|
|
275
|
+
async def process_message(self, webhook):
|
|
276
|
+
await self.messenger.send_text("Hello!", webhook.user.user_id)
|
|
277
|
+
|
|
278
|
+
app = Wappa()
|
|
279
|
+
app.set_event_handler(MyBot())
|
|
280
|
+
app.run()
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
### 🏗️ **Production-Ready Architecture**
|
|
284
|
+
- **Clean Architecture** - Domain-driven design with dependency injection
|
|
285
|
+
- **Type-Safe** - Full Pydantic models for all WhatsApp data structures
|
|
286
|
+
- **Multi-Tenant** - Built for scaling across multiple business numbers
|
|
287
|
+
- **Plugin System** - Extensible with Redis, CORS, rate limiting, and custom plugins
|
|
288
|
+
|
|
289
|
+
### 📱 **Complete WhatsApp Support**
|
|
290
|
+
- **All Message Types** - Text, media, interactive buttons, lists, templates
|
|
291
|
+
- **Rich Interactions** - Buttons, lists, call-to-action messages
|
|
292
|
+
- **Media Handling** - Images, videos, audio, documents with automatic upload/download
|
|
293
|
+
- **Templates** - Pre-approved business message templates
|
|
294
|
+
|
|
295
|
+
### 🛠️ **Developer Experience**
|
|
296
|
+
```bash
|
|
297
|
+
# Initialize new project
|
|
298
|
+
wappa init my-bot
|
|
299
|
+
|
|
300
|
+
# Start development server with auto-reload
|
|
301
|
+
wappa dev app/main.py
|
|
302
|
+
|
|
303
|
+
# Browse interactive examples
|
|
304
|
+
wappa examples
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
### 💾 **Flexible State Management**
|
|
308
|
+
```python
|
|
309
|
+
# Memory, JSON file, or Redis caching
|
|
310
|
+
app = Wappa(cache="redis") # or "memory" or "json"
|
|
311
|
+
|
|
312
|
+
# Automatic state persistence
|
|
313
|
+
await self.state_cache.set("conversation", {"step": "greeting"})
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
## 📦 Installation
|
|
317
|
+
|
|
318
|
+
### Using uv (Recommended)
|
|
319
|
+
```bash
|
|
320
|
+
# Create new project
|
|
321
|
+
uv init my-wappa-project
|
|
322
|
+
cd my-wappa-project
|
|
323
|
+
|
|
324
|
+
# Add Wappa
|
|
325
|
+
uv add wappa
|
|
326
|
+
|
|
327
|
+
# Initialize project structure
|
|
328
|
+
wappa init .
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
### Using pip
|
|
332
|
+
```bash
|
|
333
|
+
pip install wappa
|
|
334
|
+
|
|
335
|
+
# Initialize new project
|
|
336
|
+
wappa init my-wappa-project
|
|
337
|
+
cd my-wappa-project
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
### Using Poetry
|
|
341
|
+
```bash
|
|
342
|
+
poetry new my-wappa-project
|
|
343
|
+
cd my-wappa-project
|
|
344
|
+
poetry add wappa
|
|
345
|
+
|
|
346
|
+
# Initialize project structure
|
|
347
|
+
wappa init .
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
## 🏃♂️ Quick Start
|
|
351
|
+
|
|
352
|
+
### 1. Get WhatsApp Business API Credentials
|
|
353
|
+
|
|
354
|
+
1. Visit [Meta for Developers](https://developers.facebook.com)
|
|
355
|
+
2. Create a WhatsApp Business App
|
|
356
|
+
3. Get your credentials:
|
|
357
|
+
- **Access Token**
|
|
358
|
+
- **Phone Number ID**
|
|
359
|
+
- **Business Account ID**
|
|
360
|
+
|
|
361
|
+
### 2. Create Your Bot
|
|
362
|
+
|
|
363
|
+
```bash
|
|
364
|
+
# Initialize project
|
|
365
|
+
wappa init my-bot
|
|
366
|
+
cd my-bot
|
|
367
|
+
|
|
368
|
+
# Configure environment
|
|
369
|
+
cp .env.example .env
|
|
370
|
+
# Edit .env with your WhatsApp credentials
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
### 3. Run Development Server
|
|
374
|
+
|
|
375
|
+
```bash
|
|
376
|
+
# Start with auto-reload
|
|
377
|
+
wappa dev app/main.py
|
|
378
|
+
|
|
379
|
+
# Or manually
|
|
380
|
+
uv run python -m app.main
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
### 4. Test Your Bot
|
|
384
|
+
|
|
385
|
+
Send a message to your WhatsApp Business number and watch it echo back!
|
|
386
|
+
|
|
387
|
+
## 🎛️ Architecture Overview
|
|
388
|
+
|
|
389
|
+
```mermaid
|
|
390
|
+
graph TD
|
|
391
|
+
A[👤 WhatsApp User] -->|Message| B[📡 Webhook Endpoint]
|
|
392
|
+
B --> C[🔄 Event Dispatcher]
|
|
393
|
+
C --> D[⚡ Your Event Handler]
|
|
394
|
+
D --> E[💬 Messenger Interface]
|
|
395
|
+
E --> F[📱 WhatsApp API]
|
|
396
|
+
|
|
397
|
+
D --> G[💾 State Management]
|
|
398
|
+
D --> H[🧠 Business Logic]
|
|
399
|
+
G --> I[🗄️ Redis/Memory/JSON Cache]
|
|
400
|
+
H --> J[🔗 External Services]
|
|
401
|
+
|
|
402
|
+
style D fill:#333481,color:#fff,stroke:#333481,stroke-width:3px
|
|
403
|
+
style E fill:#4A90E2,color:#fff,stroke:#4A90E2,stroke-width:3px
|
|
404
|
+
style G fill:#333481,color:#fff,stroke:#333481,stroke-width:3px
|
|
405
|
+
style A fill:#25D366,color:#fff,stroke:#25D366,stroke-width:3px
|
|
406
|
+
style F fill:#25D366,color:#fff,stroke:#25D366,stroke-width:3px
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
- **Event-Driven**: Webhook → Event Handler → Response
|
|
410
|
+
- **Type-Safe**: Full Pydantic models for all WhatsApp data structures
|
|
411
|
+
- **FastAPI Core**: Built on modern async Python with automatic OpenAPI docs
|
|
412
|
+
- **Production Ready**: Docker support, Redis caching, structured logging
|
|
413
|
+
|
|
414
|
+
## 📚 Documentation
|
|
415
|
+
|
|
416
|
+
**📖 [Complete Documentation](https://wappa.mimeia.com/docs)**
|
|
417
|
+
|
|
418
|
+
### Quick Links
|
|
419
|
+
|
|
420
|
+
- **🚀 [Quick Start](https://wappa.mimeia.com/docs/getting-started)** - Get running in 5 minutes
|
|
421
|
+
- **🏗️ [Architecture Guide](https://wappa.mimeia.com/docs/concepts/architecture)** - Understanding the framework
|
|
422
|
+
- **📡 [API Reference](https://wappa.mimeia.com/docs/api/messaging)** - Complete messaging API
|
|
423
|
+
- **💾 [State Management](https://wappa.mimeia.com/docs/concepts/state-management)** - Caching and persistence
|
|
424
|
+
- **🚀 [Deploy to Railway](https://wappa.mimeia.com/docs/deployment/railway)** - Production deployment
|
|
425
|
+
- **🛠️ [WhatsApp Setup](https://wappa.mimeia.com/docs/setup/whatsapp-setup)** - Configure WhatsApp Business API
|
|
426
|
+
|
|
427
|
+
### Example Projects
|
|
428
|
+
|
|
429
|
+
Explore 6 complete example applications:
|
|
430
|
+
|
|
431
|
+
```bash
|
|
432
|
+
# Browse examples interactively
|
|
433
|
+
wappa examples
|
|
434
|
+
|
|
435
|
+
# Copy specific example
|
|
436
|
+
wappa examples redis-cache-demo
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
- **Simple Echo** - Basic message echoing
|
|
440
|
+
- **JSON Cache Demo** - File-based state persistence
|
|
441
|
+
- **Redis Cache Demo** - High-performance caching
|
|
442
|
+
- **OpenAI Transcription** - Voice message processing
|
|
443
|
+
- **Full-Featured Bot** - Complete production example
|
|
444
|
+
- **Basic Project** - Minimal setup template
|
|
445
|
+
|
|
446
|
+
## 🛠️ Advanced Usage
|
|
447
|
+
|
|
448
|
+
### Builder Pattern for Complex Apps
|
|
449
|
+
|
|
450
|
+
```python
|
|
451
|
+
from wappa import WappaBuilder
|
|
452
|
+
|
|
453
|
+
app = await (WappaBuilder()
|
|
454
|
+
.with_whatsapp(
|
|
455
|
+
token="your_token",
|
|
456
|
+
phone_id="your_phone_id",
|
|
457
|
+
business_id="your_business_id"
|
|
458
|
+
)
|
|
459
|
+
.with_redis_cache("redis://localhost:6379")
|
|
460
|
+
.with_cors_enabled()
|
|
461
|
+
.with_rate_limiting(requests_per_minute=100)
|
|
462
|
+
.build())
|
|
463
|
+
|
|
464
|
+
app.set_event_handler(MyAdvancedHandler())
|
|
465
|
+
app.run()
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
### Plugin System
|
|
469
|
+
|
|
470
|
+
```python
|
|
471
|
+
from wappa.plugins import DatabasePlugin, CorsPlugin
|
|
472
|
+
|
|
473
|
+
app = Wappa(cache="redis")
|
|
474
|
+
app.add_plugin(DatabasePlugin("postgresql://..."))
|
|
475
|
+
app.add_plugin(CorsPlugin(allow_origins=["*"]))
|
|
476
|
+
app.set_event_handler(MyHandler())
|
|
477
|
+
app.run()
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
### CLI Commands
|
|
481
|
+
|
|
482
|
+
```bash
|
|
483
|
+
# Project management
|
|
484
|
+
wappa init [directory] # Initialize new project
|
|
485
|
+
wappa examples [target] # Browse/copy examples
|
|
486
|
+
|
|
487
|
+
# Development
|
|
488
|
+
wappa dev app/main.py # Development server with auto-reload
|
|
489
|
+
wappa prod app/main.py # Production server
|
|
490
|
+
|
|
491
|
+
# Help
|
|
492
|
+
wappa --help # Show all commands
|
|
493
|
+
```
|
|
494
|
+
|
|
495
|
+
## 🚀 Deployment
|
|
496
|
+
|
|
497
|
+
### Railway (Recommended)
|
|
498
|
+
|
|
499
|
+
```bash
|
|
500
|
+
# Install Railway CLI
|
|
501
|
+
npm install -g @railway/cli
|
|
502
|
+
|
|
503
|
+
# Login and deploy
|
|
504
|
+
railway login
|
|
505
|
+
railway init
|
|
506
|
+
railway add redis
|
|
507
|
+
railway up
|
|
508
|
+
|
|
509
|
+
# Set environment variables
|
|
510
|
+
railway variables set WP_ACCESS_TOKEN=your_token
|
|
511
|
+
railway variables set WP_PHONE_ID=your_phone_id
|
|
512
|
+
railway variables set WP_BID=your_business_id
|
|
513
|
+
```
|
|
514
|
+
|
|
515
|
+
See [complete Railway deployment guide](https://wappa.mimeia.com/docs/deployment/railway).
|
|
516
|
+
|
|
517
|
+
### Docker
|
|
518
|
+
|
|
519
|
+
```dockerfile
|
|
520
|
+
FROM python:3.12-slim
|
|
521
|
+
|
|
522
|
+
WORKDIR /app
|
|
523
|
+
COPY . .
|
|
524
|
+
|
|
525
|
+
RUN pip install uv
|
|
526
|
+
RUN uv sync --frozen
|
|
527
|
+
|
|
528
|
+
EXPOSE 8000
|
|
529
|
+
CMD ["uv", "run", "python", "-m", "app.main"]
|
|
530
|
+
```
|
|
531
|
+
|
|
532
|
+
## 🧪 Development
|
|
533
|
+
|
|
534
|
+
### Setup Development Environment
|
|
535
|
+
|
|
536
|
+
```bash
|
|
537
|
+
# Clone repository
|
|
538
|
+
git clone https://github.com/sashanclrp/wappa.git
|
|
539
|
+
cd wappa
|
|
540
|
+
|
|
541
|
+
# Install dependencies
|
|
542
|
+
uv sync --group dev
|
|
543
|
+
|
|
544
|
+
# Run tests
|
|
545
|
+
uv run pytest
|
|
546
|
+
|
|
547
|
+
# Code formatting
|
|
548
|
+
uv run ruff check .
|
|
549
|
+
uv run ruff format .
|
|
550
|
+
```
|
|
551
|
+
|
|
552
|
+
### Project Structure
|
|
553
|
+
|
|
554
|
+
```
|
|
555
|
+
wappa/
|
|
556
|
+
├── wappa/ # Core framework
|
|
557
|
+
│ ├── core/ # Application core & plugins
|
|
558
|
+
│ ├── messaging/ # WhatsApp messaging implementation
|
|
559
|
+
│ ├── persistence/ # Cache backends (Memory/JSON/Redis)
|
|
560
|
+
│ ├── cli/ # CLI tools & project templates
|
|
561
|
+
│ └── api/ # FastAPI routes & dependencies
|
|
562
|
+
├── examples/ # Example applications
|
|
563
|
+
├── docs/ # Documentation source
|
|
564
|
+
└── tests/ # Test suite
|
|
565
|
+
```
|
|
566
|
+
|
|
567
|
+
## 🤝 Community & Support
|
|
568
|
+
|
|
569
|
+
### 💬 **Join the Community**
|
|
570
|
+
- **💭 [Discord Community](https://discord.gg/wappa)** - Get help, share projects, and connect with other developers
|
|
571
|
+
- **🐛 [GitHub Issues](https://github.com/sashanclrp/wappa/issues)** - Bug reports and feature requests
|
|
572
|
+
- **📖 [GitHub Discussions](https://github.com/sashanclrp/wappa/discussions)** - Questions and community discussions
|
|
573
|
+
|
|
574
|
+
### 📞 **Get Support**
|
|
575
|
+
- **📚 [Documentation](https://wappa.mimeia.com/docs)** - Comprehensive guides and API reference
|
|
576
|
+
- **💡 [Examples](https://wappa.mimeia.com/docs/resources/examples)** - 6 complete working examples
|
|
577
|
+
- **🔧 [Configuration Guide](https://wappa.mimeia.com/docs/setup/whatsapp-setup)** - WhatsApp Business API setup
|
|
578
|
+
|
|
579
|
+
### 🤝 **Contributing**
|
|
580
|
+
We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
|
|
581
|
+
|
|
582
|
+
- **🐛 Found a bug?** Open an [issue](https://github.com/sashanclrp/wappa/issues)
|
|
583
|
+
- **💡 Have an idea?** Start a [discussion](https://github.com/sashanclrp/wappa/discussions)
|
|
584
|
+
- **🔧 Want to contribute?** Check out [good first issues](https://github.com/sashanclrp/wappa/labels/good%20first%20issue)
|
|
585
|
+
|
|
586
|
+
## 📋 Requirements
|
|
587
|
+
|
|
588
|
+
- **Python 3.12+** - Modern Python with latest type hints
|
|
589
|
+
- **WhatsApp Business API** - Meta for Developers account
|
|
590
|
+
- **Redis** (optional) - For production caching and state management
|
|
591
|
+
|
|
592
|
+
## 📄 License
|
|
593
|
+
|
|
594
|
+
This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.
|
|
595
|
+
|
|
596
|
+
## 🙏 Acknowledgments
|
|
597
|
+
|
|
598
|
+
- **Meta** - For the WhatsApp Business API
|
|
599
|
+
- **FastAPI** - For the excellent async Python framework
|
|
600
|
+
- **Redis** - For high-performance caching
|
|
601
|
+
- **Open Source Community** - For inspiration and contributions
|
|
602
|
+
|
|
603
|
+
---
|
|
604
|
+
|
|
605
|
+
**Built with ❤️ by [Mimeia](https://mimeia.com) • Open Source • Apache 2.0 License**
|
|
606
|
+
|
|
607
|
+
*Transform your business communication with WhatsApp automation.*
|