Skip to content

refactor(core): move the generated /v2 client into tablepro-cloud-api - #4484

Merged
datlechin merged 3 commits into
mainfrom
feat/core-cloud-api-crate
Nov 25, 2026
Merged

datlechin merged 3 commits into
mainfrom
feat/core-cloud-api-crate

Conversation

@datlechin

Copy link
Copy Markdown
Member

Summary

  • New crate tablepro-cloud-api (core/crates/cloud-api), depending on no workspace crate: the vendored /v2 document and its progenitor build.rs, the Bearer hooks, the problem and 429 mapping as ApiError, read_capped, and the HTTP client builder (no redirects, user agent, 15 s connect, 30 s request).
  • tablepro-account calls /v2 through it and maps ApiError into AccountError with the same variants, codes and texts as before. A 413 still reads as snapshot_too_large.
  • The share snapshot wire types (SnapshotBody, SnapshotColumnBody, PublicSnapshot) move with the client; the account builds the body with snapshot_body. tablepro_account no longer re-exports v2, SnapshotBody or SnapshotColumnBody, which nothing outside it used.
  • AccessToken gains origin, account_id and device_id, read under the same session hold as the token and session id, so a caller never pairs one sign-in's token with another's ids.
  • linux/build-aux/update-cloud-api.sh moves to core/scripts/update-cloud-api.sh.
  • core/ARCHITECTURE.md, core/AGENTS.md and core.yml list the crate.
  • The FFI surface is unchanged, so the Windows bindings need no regeneration.

Test plan

  • New: every_bearer_names_the_account_device_and_session_of_its_own_sign_in_across_a_switch reads bearers while a second account signs in; every one names its own sign-in's account, device and session.
  • New: a_413_with_no_problem_of_the_server_s_is_too_large.
  • The account's tests pass. The cloud_api.rs unit tests moved with the code and assert ApiError; the share tests call snapshot_body.
  • cargo test -p tablepro-cloud-api -p tablepro-account, cargo test -p tablepro-ffi --no-default-features --test account.
  • cargo clippy -D warnings on both crates and on tablepro-ffi without engines; cargo fmt --check, cargo shear, cargo deny check bans licenses sources.
  • update-third-party-licenses.sh and update-core-licenses.sh --check: no change.
  • verify.sh package TableProFFI: the core library and Swift bindings build, the package tests pass.

AccessToken also carries the origin, account id and device id, read under the same session hold as the token.
@datlechin
datlechin force-pushed the feat/core-cloud-api-crate branch from 3e9fc47 to f8001d2 Compare November 25, 2026 07:39
@datlechin
datlechin enabled auto-merge (squash) November 25, 2026 07:39
@datlechin
datlechin merged commit f5e5ea6 into main Nov 25, 2026
91 of 93 checks passed
@datlechin
datlechin deleted the feat/core-cloud-api-crate branch November 27, 2026 16:37
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