Commit 8b48d05
refactor: derive workspaceApi types from @comfyorg/ingest-types (#14771)
<!-- ccr-slack-attribution -->
_Requested by **Christian Byrne** · [Slack
thread](https://comfy-organization.slack.com/archives/C0BHR8PMK1D/p1785912253845389?thread_ts=1785912253.845389&cid=C0BHR8PMK1D)_
## Summary
`workspaceApi.ts` hand-declared ~40 types that duplicate exports already
generated from cloud's ingest OpenAPI spec, letting them silently drift
from the real contract.
## Changes
- **What**: `workspaceApi.ts` now imports types from
`@comfyorg/ingest-types` instead of hand-declaring them. Types with real
FE-only extensions (`Member`, `BillingStatusResponse`) keep a thin local
intersection on top of the generated type; ~8 pure-literal-union types
with no distinct generated export stay local (verified their literals
still match). `CurrentTeamCreditStop` is renamed to the generated
`TeamCreditStopSummary` (4 call sites).
- Two confirmed type/behavior bugs from the drift:
- `ResubscribeResponse.status` only allowed `'active'`; the generated
type also allows `'pending'`. `useWorkspaceBilling.resubscribe()` now
polls the billing op to a terminal state when the response is
`'pending'` instead of reporting success immediately (mirrors the
existing `cancelSubscription` pattern).
- `PaginationInfo` was missing `has_more`/`next_cursor`. Fixed via the
generated type; wiring an actual "load more" UI for the member/invite
lists is a separate follow-up, not done here.
- Refreshed `@comfyorg/ingest-types` and `@comfyorg/registry-types`
against current cloud `main` first (both were stale): ingest gained
`BillingStatusResponse.pending_billing_op_type`; registry gained new
Topaz upscale model fields (unrelated to this refactor, just a freshness
byproduct).
- **Breaking**: none (all call-site type changes are non-breaking
widenings, verified via `pnpm typecheck`).
## Review Focus
- `subscription_tier` fields (`WorkspaceWithRole`, `Plan`,
`BillingStatusResponse`) intentionally keep the app's registry-derived
`SubscriptionTier` (no `'TEAM'`) instead of ingest's wider enum, to
match existing downstream usage — flagged in code comments.
- `useWorkspaceBilling.resubscribe()` behavior change: added tests for
both the pending-succeeds and pending-fails paths.
---
_Generated by [Claude
Code](https://claude.ai/code/session_013CkfGtjAnvxmBDU56gAzAk)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent db147c0 commit 8b48d05
10 files changed
Lines changed: 229 additions & 308 deletions
File tree
- packages
- ingest-types/src
- registry-types/src
- src
- composables/billing
- platform
- cloud/subscription/components
- workspace
- api
- components
- composables
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
17 | | - | |
| 16 | + | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
| 97 | + | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | 6 | | |
8 | 7 | | |
9 | | - | |
| 8 | + | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
0 commit comments