Skip to content

Latest commit

 

History

History
112 lines (84 loc) · 10.8 KB

File metadata and controls

112 lines (84 loc) · 10.8 KB

Changelog

All notable changes to the Late Python SDK will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[Unreleased]

Fixed

  • MCP accounts_get_follower_stats returned only the account name, dropping the follower count and daily series. The shared _format_response helper pattern-matches on the response shape, and FollowerStatsResponse has an accounts attribute, so it fell into the generic account-list branch that prints only - {platform}: {username} and silently discarded currentFollowers, growth, and the daily stats series. Hit in practice by a developer pulling LinkedIn org follower stats (data was present server-side: latest count plus a week of daily snapshots), who saw only the account name come back through the tool. _format_response now checks for a stats attribute (unique to FollowerStatsResponse among all response models) BEFORE the generic accounts branch and returns the full model_dump_json(by_alias=True, exclude_none=True), so the count, growth, and series reach the LLM losslessly. Fixed in both the emitted generated_tools.py and the generate_mcp_tools.py template so a future regen keeps it. Two regression tests added in tests/test_integration.py. (The related model gap, FollowerStatsResponse missing stats/granularity, was already corrected on develop by an earlier OpenAPI regen, so no model change was needed here.)

[1.4.49]

Fixed

  • 1.4.48 was a regression: PATCH methods broke again. The auto-regen workflow runs on develop, but the _patch / _apatch fix from 1.4.47 only landed on main. When develop's next regen built 1.4.48 (against an updated OpenAPI spec that added requestBody blocks for updateSequence / updateBroadcast), it picked up develop's old base.py without _patch, so any 1.4.48 customer who upgraded got AttributeError on every PATCH call again. 1.4.49 merges develop into main (keeping main's _patch / _apatch) so the published wheel carries both fixes: the missing PATCH method and the new body kwargs on update_sequence(...) / update_broadcast(...). Skip 1.4.48 — upgrade straight from 1.4.47 to 1.4.49.

[1.4.47]

Fixed

  • Every PATCH endpoint was broken end-to-end. BaseClient exposed _get, _post, _put, _delete but never defined _patch (or its async counterpart _apatch), while the resource generator happily emitted self._client._patch(...) calls. Any call into a PATCH endpoint raised AttributeError: 'Zernio' object has no attribute '_patch' before a request was sent. Hit in practice on contacts.update_contact (caught when a customer tried to add a tag from the MCP), but the same bug took down update_comment_automation, update_custom_field, update_lead_form, update_whats_app_template, update_whats_app_flow, update_discord_settings, update_google_business_place_action, edit_inbox_message, configure_tik_tok_ads_brand_identity, complete_telegram_connect, update_sequence, and update_broadcast (sync + async = 26 methods total). BaseClient now defines _patch / _apatch mirroring _put / _aput, with a params= kwarg so the one query-only PATCH (complete_telegram_connect) keeps working. Regression test in tests/test_patch_methods.py exercises body-bearing and query-only PATCH through the resource layer against a mocked HTTP client, so future codegen drifts can't silently reintroduce this. (Originally targeted 1.4.6 on main; that tag had already been taken by an auto-regen on develop, so this fix ships as 1.4.47 after merging develop into main.)

[1.4.5]

Fixed

  • Optional scalar params no longer ship zero values to the API. The MCP autogenerator was emitting 0 / 0.0 / "" / False as defaults for optional scalars without OpenAPI-declared defaults, which the SDK's _build_payload couldn't filter (it only drops None). The literal 0.0 then tripped Zod's z.number().positive().optional() validators server-side, surfacing as [400] Number must be greater than 0 even when the field was genuinely optional. Hit in practice on ads_create_standalone_ad for Google Search campaigns where roas_average_floor defaulted to 0.0 and was forwarded into the API. Optional scalars now default to None (typed as T | None) so unset fields are dropped before reaching the server. OpenAPI-declared defaults (e.g. campaign_type="display", gender="all") are still respected.
  • LateAPIError now surfaces field names and stable error codes. The API returns {error, type, code, param} on validation failures but the SDK was reading error_data.get("details") (a key the API doesn't send), so param was always lost. The SDK now stores the full envelope in details, and __str__ formats as [400] {message} (field: {param}; code: {code}) when those are present. Direct fix for Hein's "the error doesn't identify the offending field" feedback.

[1.4.2]

Fixed

  • Merged the multi-account routing fix (1.4.0, originally landed on main) and the array/object schema fix (1.4.1, also main) into the develop branch so the next OpenAPI auto-regen doesn't reintroduce the bugs. Develop now has both fixes applied on top of its accumulated auto-regen content (new endpoints up through v1.3.120). No new behavioural changes beyond 1.4.1.
  • Generator now combines develop's param/tool-name dedupe (prevents duplicate-kwarg SyntaxErrors and F811 lint failures) with main's $ref/allOf schema resolution and list[T]/dict[str, Any] typing. With develop's newer OpenAPI spec, this means newer fields on ads_create_standalone_ad (cities, regions, creatives, images, video, brand_identity, promoted_object) are now properly typed alongside the original four (keywords, countries, additional_headlines, additional_descriptions).

[1.4.1]

Fixed

  • Autogenerated MCP tools no longer collapse array and object schemas to str. Fields like keywords, countries, additional_headlines, additional_descriptions on ads_create_standalone_ad (and the equivalents across every autogenerated tool) were declared as str and forwarded straight into the SDK, which then rejected the request with Expected array, received string. They now use the correct Python types (list[str] | None, list[dict[str, Any]] | None, dict[str, Any] | None) so FastMCP advertises the right shape to LLMs and the SDK receives native containers.
  • The generator now dereferences $ref, allOf, and same-type oneOf/anyOf wrappers when reading a schema's type. Without this, properties like posts_create_post.tiktokSettings, posts_create_post.facebookSettings, posts_create_post.recycling, and array-of-$ref fields like createWhatsAppTemplate.components, createQueueSlot.slots, sendConversions.events, updateGoogleBusinessFoodMenus.menus, and sendPrivateReplyToComment.buttons would still have leaked through as str.

[1.4.0]

Fixed

  • MCP multi-account routing (silent-wrong-account bug). posts_create, posts_publish_now, posts_cross_post, and accounts_get previously fell back to the first matching account (matching[0]) when the user had more than one account on the requested platform. Agency / multi-client setups could see posts land on the wrong account with no warning. These tools now return an explicit error listing the candidate account IDs when the selection is ambiguous, and require the caller to disambiguate.

Added

  • account_id and profile_id parameters on posts_create and posts_publish_now for explicit target selection.
  • account_ids (parallel to platforms) and profile_id parameters on posts_cross_post. Repeating a platform with different IDs is supported (e.g. cross-posting to two Twitter accounts in one call).
  • posts_create_post exposed as an autogenerated tool alongside the simplified posts_create. It mirrors the full REST createPost surface (nested platforms array with customContent, customMedia, scheduledFor, platformSpecificData) for power users who need per-target customisation.
  • Top-level multi-account workflow guidance in the MCP server instructions so LLMs learn the disambiguation flow once globally.
  • Unit tests for the shared _resolve_account helper covering account-id, profile-id, ambiguous, and not-found paths.

[Older Unreleased entries]

Added

  • MCP HTTP server now exposes the modern Streamable HTTP transport at POST /mcp (in addition to the existing SSE transport at GET /sse). Streamable HTTP is recommended for new clients (Claude Code, mcp-remote, etc.) because it is not affected by the idle-connection drops that affect long-lived SSE connections behind proxies.
  • Streamable HTTP runs in stateless mode — each request is fully independent and authenticated separately via the Authorization: Bearer header.

Changed

  • Bumped minimum mcp SDK version to >=1.8.0 (required for StreamableHTTPSessionManager).
  • Server transport field in the root info endpoint now reports "sse+streamable-http".

[1.2.0] - 2025-01-16

Added

  • MCP (Model Context Protocol) server support for Claude Desktop integration
  • HTTP server mode for MCP (late-mcp-http)
  • AI content generation module with OpenAI and Anthropic support
  • Pipelines for common workflows (CSV scheduler, cross-poster)
  • Large file upload support via Vercel Blob
  • Progress callbacks for file uploads
  • Comprehensive test suite with pytest

Changed

  • Improved error handling with specialized exception classes
  • Better async support throughout the SDK

[1.1.0] - 2025-01-10

Added

  • Upload module with SmartUploader for automatic upload strategy selection
  • Direct upload for files under 4MB
  • Multipart upload support for large files
  • upload_bytes() and upload_large_bytes() methods

[1.0.0] - 2025-01-01

Added

  • Initial public release
  • Full coverage of Late API endpoints
  • Support for all 13 social media platforms: Instagram, TikTok, YouTube, LinkedIn, X/Twitter, Facebook, Pinterest, Threads, Bluesky, Reddit, Snapchat, Telegram, and Google Business Profile
  • Async support with alist(), acreate(), etc.
  • Type hints and Pydantic models
  • Error handling with LateAPIError, LateRateLimitError, LateValidationError

API Coverage

  • Posts: create, list, get, update, delete, retry, bulk upload
  • Accounts: list, get, follower stats
  • Profiles: create, list, get, update, delete
  • Analytics: get metrics, usage stats
  • Account Groups: create, list, update, delete
  • Queue: slots management, preview
  • Webhooks: settings management, logs, testing
  • API Keys: create, list, delete
  • Media: upload, generate upload token
  • Tools: downloads, hashtag checking, transcripts, AI caption generation
  • Users: list, get
  • Usage: stats
  • Logs: list, get
  • Connect: OAuth flows for all platforms
  • Reddit: feed, search
  • Invites: platform invites management