Skip to content

docs(swift-sdk): document the client for server-only calls - #627

Closed
aicayzer wants to merge 2 commits into
mainfrom
feat/direct-line
Closed

aicayzer wants to merge 2 commits into
mainfrom
feat/direct-line

Conversation

@aicayzer

@aicayzer aicayzer commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The Swift SDK gains a client for the operations only the instance can do, in withmarfa/marfa-swift#372. This documents it: the Swift SDK page gets the MarfaAPI product and a "Call the server directly" section, "Define a type" gets a Swift tab for each step, and How Marfa works no longer says the core sends every Swift request. Merge it after the Swift SDK release that ships withmarfa/marfa-swift#372.

Part of withmarfa/marfa-swift#366.

Changes

  • Swift SDK. The products table adds MarfaAPI. A new section shows Client(server), the typed type calls with links to their operations, how the other operations are named and read, what the client leaves out (any call that creates, gets, changes or deletes one item or edge, search and event calls, bulk changes, connector operations, and those for the owner's session alone) and that it still reads versions, statistics and occurrences, and how it behaves: noConnection when offline, a 30-second wait for the instance to send more that Client(server, timeout:) changes, one renewal of an expired access token, signedOut after the sign-in ends, and no redirects. It says when to use declareTypes(_:) and when register(itemType:). Handle errors adds noConnection and names Client.
  • Define a type. Swift tabs for register, normalize, replace and delete, using MarfaAPI.
  • How Marfa works. One sentence: the Swift SDK sends server-only operations straight to the API.

Testing

  • pnpm test: 39 files, 700 tests pass, including the content lint, which resolves every new operation link.
  • Every Swift example on both pages was run as written against a server booted from marfa's pinned commit, through a scratch test in the marfa-swift branch (since deleted): check and register of app.readinglist.entry, listAuditLog().ok.body.json, then decoding the guide's receipt.json into TypeDefinitionInput and TypeDefinitionUpdate, register (version 0), normalize (registered_type present), replace, delete, and a second delete refused not_found.
  • Not run: pnpm build and pnpm types:check; CI runs them.

Notes for reviewers

Checklist

  • The title is a scoped Conventional Commit.
  • New behavior has a test that was seen failing first, or no test was needed and the reason is above.
  • Docs, comments and the contract still say what is true after this change.

@aicayzer

Copy link
Copy Markdown
Contributor Author

Replaced by #633, which carries this change merged with the other Swift SDK 0.0.32 pull requests into one page.

@aicayzer aicayzer closed this Oct 25, 2026
@aicayzer
aicayzer deleted the feat/direct-line branch October 25, 2026 01:12
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