Commit 84edaa5
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 84edaa5
6 files changed
Lines changed: 829 additions & 1050 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
0 commit comments