Skip to content

Use official Fizzy TypeScript SDK#5

Open
joshyorko wants to merge 1 commit into
basecamp:mainfrom
joshyorko:codex/use-fizzy-sdk
Open

Use official Fizzy TypeScript SDK#5
joshyorko wants to merge 1 commit into
basecamp:mainfrom
joshyorko:codex/use-fizzy-sdk

Conversation

@joshyorko

Copy link
Copy Markdown

Summary

This replaces fizzy-popper's hand-written Fizzy REST client internals with the official @37signals/fizzy TypeScript SDK while preserving the existing FizzyClient facade 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 typecheck
  • npx vitest run test/fizzy.test.ts
  • npm test
  • git diff --check

@joshyorko
joshyorko marked this pull request as ready for review May 28, 2026 12:07
Copilot AI review requested due to automatic review settings May 28, 2026 12:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/fizzy as 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 thread src/fizzy.ts
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 thread src/fizzy.ts
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 thread test/fizzy.test.ts
Comment on lines +377 to +379
function mocked<T extends (...args: never[]) => unknown>(fn: T): Mock {
return fn as Mock
}
Comment thread src/fizzy.ts
Comment on lines +135 to +138
private accountClient(): OfficialFizzyClient {
if (!this.account) {
throw new Error("Fizzy account is required for account-scoped API calls")
}
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.

2 participants