Context
Sources/MistKit/Generated/Client.swift:1766 exposes internal func modifyZones(_ input: Operations.modifyZones.Input) async throws -> Operations.modifyZones.Output from the generated layer, but there is no public CloudKitService wrapper.
The sibling zone operations are wrapped in Sources/MistKit/Service/Extensions/CloudKitService+ZoneOperations.swift:
public func listZones(database:) async throws(CloudKitError) -> [ZoneInfo]
public func lookupZones(zoneIDs:database:) async throws(CloudKitError) -> [ZoneInfo]
modifyZones has no equivalent, which means external consumers (including MistDemo's planned modify-zones command in #215) cannot reach the endpoint at all.
Scope
Add a public func modifyZones(...) method to CloudKitService+ZoneOperations.swift that:
- Takes ergonomic Swift inputs (e.g. an
[ZoneOperation] describing create / delete with ZoneIDs) instead of raw Operations.modifyZones.Input.
- Returns ergonomic Swift outputs (e.g.
[ZoneInfo] or a small ZoneModifyResult value type) instead of Operations.modifyZones.Output.
- Declares
throws(CloudKitError) and routes failures through mapToCloudKitError(_:context:).
- Resolves auth + transport via
self.client(for: database) — modifyZones is private/shared-database only, so reject .public with a clear error.
- Validates inputs (non-empty operations list, non-empty zone names) before hitting the network, mirroring the guards in
lookupZones.
- Normalizes the response via
responseProcessor if a matching helper exists; otherwise add one alongside the listZones/lookupZones processors.
Tests
- Unit tests in
Tests/MistKitTests/Service/ covering: create-only batch, delete-only batch, mixed batch, empty-operations rejection, empty-zone-name rejection, .public rejection, error mapping.
- Mock client coverage following the pattern used for
listZones / lookupZones.
Out of scope
Definition of Done
Related
Context
Sources/MistKit/Generated/Client.swift:1766exposesinternal func modifyZones(_ input: Operations.modifyZones.Input) async throws -> Operations.modifyZones.Outputfrom the generated layer, but there is no publicCloudKitServicewrapper.The sibling zone operations are wrapped in
Sources/MistKit/Service/Extensions/CloudKitService+ZoneOperations.swift:public func listZones(database:) async throws(CloudKitError) -> [ZoneInfo]public func lookupZones(zoneIDs:database:) async throws(CloudKitError) -> [ZoneInfo]modifyZoneshas no equivalent, which means external consumers (including MistDemo's plannedmodify-zonescommand in #215) cannot reach the endpoint at all.Scope
Add a
public func modifyZones(...)method toCloudKitService+ZoneOperations.swiftthat:[ZoneOperation]describing create / delete withZoneIDs) instead of rawOperations.modifyZones.Input.[ZoneInfo]or a smallZoneModifyResultvalue type) instead ofOperations.modifyZones.Output.throws(CloudKitError)and routes failures throughmapToCloudKitError(_:context:).self.client(for: database)—modifyZonesis private/shared-database only, so reject.publicwith a clear error.lookupZones.responseProcessorif a matching helper exists; otherwise add one alongside the listZones/lookupZones processors.Tests
Tests/MistKitTests/Service/covering: create-only batch, delete-only batch, mixed batch, empty-operations rejection, empty-zone-name rejection,.publicrejection, error mapping.listZones/lookupZones.Out of scope
modify-zonescommand itself — that stays in Phase 4: Advanced Operations - MistDemo #215 and depends on this issue.Definition of Done
public func modifyZones(...)lands inCloudKitService+ZoneOperations.swiftOperations.modifyZones.*CLAUDE.md"CloudKitService Operations" table updated to listmodifyZonesswift build+swift test+./Scripts/lint.shcleanRelated
modify-zonescommand depends on this)