Commit Graph

11 Commits

Author SHA1 Message Date
bohd4nx 9660e4858f chore: streamline CI linting steps and update changelog with recent changes 2026-03-20 20:58:06 +02:00
bohd4nx 4e03d2e2f6 refactor: harden client, clean tests, and fix timeouts
- Security & validation: tighten hash regex, add HTTP timeouts to all
  requests, pass client.timeout through get_fragment_hash and AsyncClient
- Constants: move all constants to types/constants.py; remove re-exports
  from types/__init__.py; add DEFAULT_TIMEOUT, REQUIRED_COOKIE_KEYS
- FragmentClient: add timeout param (default 30 s); async-context-manager
  support; remove WALLET_CLASSES from public API
- Exceptions: remove dead INVALID_USERNAME constant (Fragment validates
  server-side); keep full hierarchy intact
- Tests: add 006_test_methods_mock.py (6 mock tests for all 3 methods);
  DRY-refactor 004_test_balance.py (_patch_wallet context manager);
  clean up 005_test_methods.py (remove fragile network test, rename tests)
- Examples: switch all 4 examples to async-with; align error messages;
  replace %-format with f-strings
- README: rewrite usage section with single comprehensive async-with
  example covering all 3 methods and full exception hierarchy
- CI: add mypy step to lint job; add pytest-mock and mypy to dev deps;
  set FORCE_JAVASCRIPT_ACTIONS_TO_NODE24 on all jobs; fix COOKIES_JSON
  to job-level env var
2026-03-20 20:58:06 +02:00
bohd4nx f5d2e8490a feat: restructure GitHub workflows; add CI workflow, update publish process, and remove obsolete test and lint workflows 2026-03-16 18:22:58 +02:00
bohd4nx f4a96bb01a fix: restrict workflow triggers to the master branch for linting and publishing 2026-03-15 22:45:00 +02:00
bohd4nx d8f0240807 feat: add wallet management features and enhance error handling; update tests and examples 2026-03-15 22:41:52 +02:00
bohd4nx 8135a9da7e Refactor FragmentAPI to pyfragment
- Renamed the package from `fragmentapi` to `pyfragment` across all modules and tests.
- Removed the old wallet utility functions and replaced them with new implementations.
- Updated the `pyproject.toml` to reflect the new package name and repository links.
- Adjusted all import statements in tests to use the new package name.
- Implemented new methods for gifting Telegram Premium, Stars, and topping up TON balance.
- Added exception handling for various error scenarios in the API interactions.
- Created new utility functions for handling HTTP requests and decoding payloads.
- Established a clear structure for types and constants used throughout the library.
2026-03-15 22:07:01 +02:00
bohd4nx 9a090e3dbc feat: implement CI/CD workflows for testing, linting, and publishing to PyPI 2026-03-15 21:45:24 +02:00
bohd4nx 4e017cb7a1 refactor: update methods to include show_sender parameter and clean up tests 2026-03-14 01:34:51 +02:00
bohd4nx 8cf57b58b7 refactor: enhance test workflow and integration tests with cookies handling and configuration checks 2026-03-08 03:58:07 +02:00
bohd4nx d2faa27c5c ci: update actions to checkout@v6, setup-python@v6 2026-03-05 04:12:09 +02:00
bohd4nx 91d33a0972 ci: add dependabot and pytest workflow 2026-03-05 04:10:57 +02:00