wappa 0.1.7__py3-none-any.whl → 0.1.8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of wappa might be problematic. Click here for more details.
- wappa/core/config/settings.py +34 -2
- wappa/persistence/__init__.py +2 -2
- {wappa-0.1.7.dist-info → wappa-0.1.8.dist-info}/METADATA +1 -1
- {wappa-0.1.7.dist-info → wappa-0.1.8.dist-info}/RECORD +7 -7
- {wappa-0.1.7.dist-info → wappa-0.1.8.dist-info}/WHEEL +0 -0
- {wappa-0.1.7.dist-info → wappa-0.1.8.dist-info}/entry_points.txt +0 -0
- {wappa-0.1.7.dist-info → wappa-0.1.8.dist-info}/licenses/LICENSE +0 -0
wappa/core/config/settings.py
CHANGED
|
@@ -5,6 +5,7 @@ Simple, reliable environment variable configuration focused on core WhatsApp fun
|
|
|
5
5
|
"""
|
|
6
6
|
|
|
7
7
|
import os
|
|
8
|
+
import sys
|
|
8
9
|
import tomllib
|
|
9
10
|
from pathlib import Path
|
|
10
11
|
|
|
@@ -41,6 +42,34 @@ def _get_version_from_pyproject() -> str:
|
|
|
41
42
|
return "0.1.0"
|
|
42
43
|
|
|
43
44
|
|
|
45
|
+
def _is_cli_context() -> bool:
|
|
46
|
+
"""
|
|
47
|
+
Detect if we're running in CLI context (help, init, examples) vs server context (dev, prod).
|
|
48
|
+
|
|
49
|
+
Returns:
|
|
50
|
+
True if running CLI commands that don't need WhatsApp credentials
|
|
51
|
+
"""
|
|
52
|
+
# Check command line arguments
|
|
53
|
+
if len(sys.argv) > 1:
|
|
54
|
+
# Direct CLI commands that don't need credentials
|
|
55
|
+
cli_only_commands = {"--help", "-h", "init", "examples"}
|
|
56
|
+
|
|
57
|
+
# Check for help flag or CLI-only commands
|
|
58
|
+
for arg in sys.argv[1:]:
|
|
59
|
+
if arg in cli_only_commands:
|
|
60
|
+
return True
|
|
61
|
+
|
|
62
|
+
# Check if we're running wappa command directly (not through uvicorn)
|
|
63
|
+
if any("wappa" in arg for arg in sys.argv):
|
|
64
|
+
# If no server commands (dev/prod) are present, assume CLI context
|
|
65
|
+
server_commands = {"dev", "prod"}
|
|
66
|
+
has_server_command = any(cmd in sys.argv for cmd in server_commands)
|
|
67
|
+
if not has_server_command:
|
|
68
|
+
return True
|
|
69
|
+
|
|
70
|
+
return False
|
|
71
|
+
|
|
72
|
+
|
|
44
73
|
class Settings:
|
|
45
74
|
"""Application settings with environment-based configuration."""
|
|
46
75
|
|
|
@@ -98,9 +127,12 @@ class Settings:
|
|
|
98
127
|
# Development/Production detection
|
|
99
128
|
self.environment: str = os.getenv("ENVIRONMENT", "DEV")
|
|
100
129
|
|
|
101
|
-
# Apply validation
|
|
130
|
+
# Apply validation (skip WhatsApp validation for CLI-only commands)
|
|
102
131
|
self._validate_settings()
|
|
103
|
-
|
|
132
|
+
|
|
133
|
+
# Only validate WhatsApp credentials for server operations
|
|
134
|
+
if not _is_cli_context():
|
|
135
|
+
self._validate_whatsapp_credentials()
|
|
104
136
|
|
|
105
137
|
def _validate_settings(self):
|
|
106
138
|
"""Validate settings values."""
|
wappa/persistence/__init__.py
CHANGED
|
@@ -24,7 +24,7 @@ from .cache_factory import create_cache_factory, get_cache_factory
|
|
|
24
24
|
|
|
25
25
|
# Cache Interfaces
|
|
26
26
|
from ..domain.interfaces.cache_factory import ICacheFactory
|
|
27
|
-
from ..domain.interfaces.cache_interface import
|
|
27
|
+
from ..domain.interfaces.cache_interface import ICache
|
|
28
28
|
from ..domain.interfaces.state_repository import IStateRepository
|
|
29
29
|
from ..domain.interfaces.user_repository import IUserRepository
|
|
30
30
|
from ..domain.interfaces.tables_repository import ITablesRepository
|
|
@@ -42,7 +42,7 @@ __all__ = [
|
|
|
42
42
|
|
|
43
43
|
# Core Interfaces
|
|
44
44
|
"ICacheFactory",
|
|
45
|
-
"
|
|
45
|
+
"ICache",
|
|
46
46
|
"IRepositoryFactory",
|
|
47
47
|
|
|
48
48
|
# Repository Interfaces
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: wappa
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.8
|
|
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
|
|
@@ -50,7 +50,7 @@ wappa/core/__init__.py,sha256=6Lv3p4P9yy7Lb3hol5pILM8AX-IHlVa-u8xiyBi_eQk,1824
|
|
|
50
50
|
wappa/core/types.py,sha256=ez9aAXpD2D6GT7uNhw17XlZbQU_PYTcvGpWleAKEe24,2743
|
|
51
51
|
wappa/core/wappa_app.py,sha256=0gmDdQr5-NZyEvFnHUHyZB_51RSl3nM57BMacey8GbY,18956
|
|
52
52
|
wappa/core/config/__init__.py,sha256=rLVdjj9dAvDaa2lCf-UgGPCZ7YODCWIkB9PcSCl4NgE,104
|
|
53
|
-
wappa/core/config/settings.py,sha256=
|
|
53
|
+
wappa/core/config/settings.py,sha256=f_E5MYttSP8-MaycQC4ULZCbrprmGT5K3tXzeuRqWMA,7420
|
|
54
54
|
wappa/core/events/__init__.py,sha256=ju2xxhyouJ0efgQcG40_zb_CHzSLj6v0isLJUK5MQHM,1058
|
|
55
55
|
wappa/core/events/default_handlers.py,sha256=4I_PWOT0JBmq5a8OsSE6CkpNaXAt6uuFp2gpcyPZrpU,23669
|
|
56
56
|
wappa/core/events/event_dispatcher.py,sha256=fJBlZ5rCKkKZtfabWy9mueiFyV1kWotZBSQ9BpLTC8s,8354
|
|
@@ -122,7 +122,7 @@ wappa/messaging/whatsapp/models/media_models.py,sha256=4hGURi4gDnSY7lOCIWZiy_Td7
|
|
|
122
122
|
wappa/messaging/whatsapp/models/specialized_models.py,sha256=jus5IH5yKje2kph78UTnzj-PU44U20gc9qyHJO_t4xo,10215
|
|
123
123
|
wappa/messaging/whatsapp/models/template_models.py,sha256=rapAwbvJeJ4pqeDtSRyhoMZuVgiy-WFTmVVZCrcrpLA,8580
|
|
124
124
|
wappa/models/__init__.py,sha256=AwSeNSF-tZkO6ufQfhwa4SKN7PQ9mblWM9TybytkL2E,2505
|
|
125
|
-
wappa/persistence/__init__.py,sha256=
|
|
125
|
+
wappa/persistence/__init__.py,sha256=6TZvz6QR-k_Hu40NX7xH8sTv20UUQqe8tObooodjOxg,1956
|
|
126
126
|
wappa/persistence/cache_factory.py,sha256=428eCUWbo37fsSOPGCuMvjwqTn3FedCIeHBYf6oYKuA,2832
|
|
127
127
|
wappa/persistence/json/__init__.py,sha256=YWGnYXGXzljpM6Vhgb9qC0En_ffg3g63jxflIIddxMI,371
|
|
128
128
|
wappa/persistence/json/cache_adapters.py,sha256=mOOaERqeTsPmh4E-6W-Q36XmAEufUfT6b2SypbZt2FE,10253
|
|
@@ -225,8 +225,8 @@ wappa/webhooks/whatsapp/message_types/system.py,sha256=lrAwSTNokxjDkgCg7Hg33eb8s
|
|
|
225
225
|
wappa/webhooks/whatsapp/message_types/text.py,sha256=u3gXGMNpJFDdaJWA0vhBGFTyAEzI2fyqvtaVvZwzAhA,14688
|
|
226
226
|
wappa/webhooks/whatsapp/message_types/unsupported.py,sha256=5GxVcNNu2X5H1gZvze3iNNrZUrUs2DxmiL3bruS38RI,9532
|
|
227
227
|
wappa/webhooks/whatsapp/message_types/video.py,sha256=NR081ZyNwxajmCbOw-LvPadU97Qksghxr_TWhWsZEz0,11271
|
|
228
|
-
wappa-0.1.
|
|
229
|
-
wappa-0.1.
|
|
230
|
-
wappa-0.1.
|
|
231
|
-
wappa-0.1.
|
|
232
|
-
wappa-0.1.
|
|
228
|
+
wappa-0.1.8.dist-info/METADATA,sha256=3xPTEC1tKzolldSW4zXOcAAxVoElVcPLbpLPhaJWBaE,15758
|
|
229
|
+
wappa-0.1.8.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
230
|
+
wappa-0.1.8.dist-info/entry_points.txt,sha256=KzfFZSK3VpWP4M-gpgh9AdKbhh4kOwiOI3q32e3NLHs,45
|
|
231
|
+
wappa-0.1.8.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
232
|
+
wappa-0.1.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|