Skip to content

Feature: Complete CloudKit API Coverage - Missing Operations & Types #199

@leogdion

Description

@leogdion

Description

This parent issue tracks the completion of several CloudKit Web Services operations and type definitions that are currently missing from MistKit's public API. While the OpenAPI-generated client code includes these operations, they lack public-facing wrappers and supporting Swift types.

Overview

MistKit's OpenAPI specification includes these operations in the generated code, but they need:

  • Public API wrappers with proper Swift types
  • Error handling and response processing
  • Integration with existing MistKit patterns (logging, middleware, etc.)
  • Documentation and examples
  • Unit tests

Child Issues

Operations (API Wrappers Needed)

Issue Operation Description Priority Estimate
#30 assets/upload Upload asset files to CloudKit Medium-High 4-6 hours
#46 changes/database Fetch database-level changes Medium 3-4 hours
#44 zones/lookup Fetch zones by identifier Low-Medium 2-3 hours

Subtotal Operations: 9-13 hours

Type Definitions (Swift Types Needed)

Issue Type Description Priority Estimate
#25 System Fields CloudKit system fields (created, modified, createdBy, modifiedBy) Medium 3-4 hours
#26 Name Components User name components (given, family, nickname, etc.) Low-Medium 2-3 hours

Subtotal Types: 5-7 hours

Total Estimate

13-18 hours (approximately 2-3 working days)

Benefits

  1. API Completeness: Exposes all CloudKit Web Services operations documented in the OpenAPI spec
  2. User Experience: Developers can access full CloudKit functionality without workarounds
  3. Type Safety: Proper Swift types for system fields and user data improve code quality
  4. Consistency: All operations follow established MistKit patterns

Acceptance Criteria

  • All 3 operations have public API wrappers in CloudKitService extensions
  • System fields integrated into RecordInfo or separate SystemFields type
  • Name component types defined with proper Codable conformance
  • All new APIs follow async/await patterns
  • Error handling consistent with existing MistKit error types
  • Unit tests for all new APIs (minimum 80% coverage)
  • Documentation comments for all public APIs
  • Examples added to CLAUDE.md or separate documentation

Implementation Notes

Assets Upload (#30)

  • Needs special handling for multipart file upload
  • Consider Data, URL, and AsyncSequence<UInt8> input types
  • Should support progress tracking for large files

Database Changes (#46)

  • Similar to zone changes but at database level
  • Returns change tokens for incremental sync
  • Important for server-to-server sync scenarios

Zones Lookup (#44)

  • Batch lookup of zones by identifier
  • Complementary to existing listZones() operation

System Fields (#25)

  • recordChangeTag, created, modified, deleted (for tombstones)
  • Consider adding to RecordInfo vs. separate type

Name Components (#26)

  • Used by user discovery APIs
  • givenName, familyName, nickname, middleName, namePrefix, nameSuffix
  • Should conform to Codable, Sendable

Related Issues

Priority Justification

Medium-High Priority - While these are not blocking core functionality, completing them:

  1. Closes the gap between generated code and public API
  2. Enables advanced CloudKit features (assets, database sync)
  3. Provides full API coverage expected in a 1.0 release
  4. Removes confusion about what's "implemented" vs. "exposed"

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions