Use official Fizzy TypeScript SDK#5
Open
joshyorko wants to merge 1 commit into
Open
Conversation
joshyorko
marked this pull request as ready for review
May 28, 2026 12:07
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Refactors the internal FizzyClient implementation to use the official @37signals/fizzy SDK instead of direct REST fetch calls, updating tests accordingly.
Changes:
- Replace custom REST request + pagination logic with an SDK-backed client wrapper.
- Update Vitest tests to mock the SDK client instead of
globalThis.fetch. - Add
@37signals/fizzyas a runtime dependency.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| test/fizzy.test.ts | Reworks tests to mock @37signals/fizzy and validate SDK call wiring/mapping. |
| src/fizzy.ts | Refactors FizzyClient to delegate operations to the official SDK and removes REST helpers. |
| package.json | Adds @37signals/fizzy dependency required by the new SDK-backed implementation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+148
to
+157
| private async sdkRequest<T>(operation: () => Promise<T>): Promise<T> { | ||
| try { | ||
| return await operation() | ||
| } catch (error) { | ||
| if (error instanceof Error) { | ||
| throw new Error(`Fizzy API: ${error.message}`) | ||
| } | ||
| throw error | ||
| } | ||
| } |
Comment on lines
+173
to
187
| private async accountRequest<T>(operation: (client: OfficialFizzyClient) => Promise<T>): Promise<T> { | ||
| return this.sdkRequest(() => operation(this.accountClient())) | ||
| } | ||
|
|
||
| // Parse Link header for next page | ||
| const link = response.headers.get("Link") || response.headers.get("link") | ||
| url = parseLinkNext(link) | ||
| } | ||
| private async list(operation: (client: OfficialFizzyClient) => Promise<Iterable<unknown>>): Promise<unknown[]> { | ||
| return this.sdkList(() => operation(this.accountClient())) | ||
| } | ||
|
|
||
| private async mutate(operation: (client: OfficialFizzyClient) => Promise<unknown>): Promise<void> { | ||
| return this.sdkMutation(() => operation(this.accountClient())) | ||
| } | ||
|
|
||
| return results | ||
| private async root<T>(operation: (client: OfficialFizzyClient) => Promise<T>): Promise<T> { | ||
| return this.sdkRequest(() => operation(this.rootClient)) | ||
| } |
Comment on lines
+377
to
+379
| function mocked<T extends (...args: never[]) => unknown>(fn: T): Mock { | ||
| return fn as Mock | ||
| } |
Comment on lines
+135
to
+138
| private accountClient(): OfficialFizzyClient { | ||
| if (!this.account) { | ||
| throw new Error("Fizzy account is required for account-scoped API calls") | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This replaces fizzy-popper's hand-written Fizzy REST client internals with the official
@37signals/fizzyTypeScript SDK while preserving the existingFizzyClientfacade used by the rest of the app.The change keeps the app's current method names and return shapes in place, including account-scoped board/card/comment operations and accountless identity lookup. Webhook signature verification remains local.
Validation
npm run typechecknpx vitest run test/fizzy.test.tsnpm testgit diff --check