Skip to content

Refactors API client for v1.0 - #85

Merged
SergkeiM merged 3 commits into
masterfrom
feature/revamp
Aug 16, 2026
Merged

SergkeiM merged 3 commits into
masterfrom
feature/revamp

Conversation

@SergkeiM

Copy link
Copy Markdown
Owner

Prepares the API client for its v1.0 release by implementing significant breaking changes and improvements:

  • Standardizes write method signatures: Most write methods (e.g., create, update, edit) now accept a single array $values argument instead of individual parameters. This improves flexibility, allowing access to previously unreachable Cloudflare API fields (e.g., in Zone Lockdowns, D1, and Zones), and simplifies future API additions.
  • Reorganizes API accessors and namespaces: Endpoints have been moved to better align with Cloudflare's own documentation, resulting in changes to accessor paths and endpoint class namespaces.
  • Removes deprecated functionality: Accessors for Cloudflare-deprecated features, such as account roles and the Workers environment API, have been removed.
  • Updates documentation:
    • Adds a comprehensive UPGRADE.md guide detailing all breaking changes from v0.5 to v1.0, including accessor moves, signature changes, and removed features.
    • Expands README.md with a clear "Versioning and compatibility" section, outlining public API, internal components, and versioning promises.
  • Adjusts dependencies: Moves Laravel illuminate/contracts and illuminate/support to suggest dependencies and discontinues support for Lumen.
  • Corrects typos: Fixes a typo in workers()->deployments() methods, changing $scriptMame to $scriptName.
  • Adds internal annotation to the Retry class to clarify its non-public API status.

This release introduces a major overhaul of the API client, focusing on consistency, flexibility, and explicit stability guarantees.

Key changes include:
- Endpoint accessors have been restructured to align with Cloudflare's API documentation.
- Write methods now consistently accept a single `array $values` argument, enhancing flexibility and future-proofing against upstream API changes.
- Cloudflare-deprecated endpoints (`accounts()->roles()`, `workers()->environment()`) have been removed.
- A new "Versioning and compatibility" section in the `README.md` explicitly defines the public API and outlines semantic versioning promises.
- A comprehensive `UPGRADE.md` guide has been added to assist with the transition from previous versions.
- Required parameters for methods now use `MissingArgumentException` for improved validation.
The UPGRADE.md file was added to assist with the transition from v0.5 to v1.0. As v1.0 has been released and the guide's purpose served, it is no longer needed in the repository.
Ensures the `TransformationFlows::update` method correctly throws `MissingArgumentException` when the mandatory `flows` argument is not provided, aligning with the v1.0 API client's parameter validation strategy.
@SergkeiM
SergkeiM merged commit e341120 into master Aug 16, 2026
11 checks passed
@SergkeiM
SergkeiM deleted the feature/revamp branch August 16, 2026 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant