Commit bf2208d
feat: add models module, API helpers, and Post refactoring
- Add models.py with Byline, PostMetadata, ScheduledRelease dataclasses
- Add schedule_release(), get_post_metadata(), make_post_free() to Api
- Extract _authenticate() and _resolve_publication() from __init__
- Add _get/_post/_put/_delete HTTP helpers, refactor all methods to use them
- Add _handle_response allow_empty param with proper error chaining
- Add _PRODUCTION_SUBDOMAINS safety guard
- publish_draft now auto-runs prepublish validation
- Use pathlib.Path instead of os.path/open for file operations
- Post: dispatch table _ADD_HANDLERS replaces if/elif chain
- Post: add paywall() and add_subscribe_button() methods
- Post: extract _parse_markdown_blocks, _upload_or_passthrough, _render_image
- Post: code_block uses match/case, _process_line handles inline headings
- Refactored from_markdown() with HR support and better line merging
- MCP: remove separate prepublish_draft tool (now automatic)
- Add type annotations throughout all modules
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent e659a9e commit bf2208d
6 files changed
Lines changed: 1096 additions & 1317 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
0 commit comments