The API exposes 122 client actions across 130 paths. The n8n node and the MCP
tools are generated from storage/swagger.json, which is why both stay
current, while a hand-maintained SDK falls behind — the Laravel SDK named 25 of
122 actions before its methods were generated.
GenerateSdkMethods in the proxy repository emits them, with a python and a
python-async flavour:
python3 scripts/sync_actions.py ../eazewhatsapp-proxy
# wrote 122 sync and 122 async methods, and 122 testsThat overwrites two files whole, and nothing hand-written lives in either:
src/waapi/_generated.py—GeneratedActionsandGeneratedAsyncActionstests/test_generated_actions.py— one payload test per action
The script refuses to write if the two surfaces come out at different sizes or
if the generator emitted nothing, and it runs ruff over its own output, so a
file marked DO NOT EDIT never needs a human to fix its formatting.
Hand-written methods live in src/waapi/_actions.py, which composes the
generated classes in. Add one there only if it cannot come from the spec — the
instance endpoints are the current example, because they are ordinary REST
routes rather than client actions. Anything added by hand is one more place a
future API change has to reach.
If you do add one, mirror it in both ActionsMixin and
AsyncActionsMixin — test_sync_and_async_expose_the_same_methods fails
otherwise, on purpose.
- Public arguments are
snake_case; the JSON keys they map to staycamelCaseas the API defines them. - Optional arguments default to
Noneand are dropped from the payload byprune(). Do not send explicit nulls. - Anything that can be checked without a request (a missing instance id, a
media call with no source) raises
ValueErrorbefore the call goes out.
pip install -e ".[dev]"
pytestNo test may touch the network. Use httpx.MockTransport.