Repository navigation
feat(freshbooks): add the FreshBooks API module (v1) - #240
Merged
Merged
Conversation
Promote packages/needs-updating/freshbooks to packages/v1-ready/freshbooks as
@friggframework/api-module-freshbooks on @friggframework/core ^2.0.0-next.126,
ported from the module running in production in
lefthookhq/freshbooks-integrations.
- token requests (authorization_code and refresh_token) are sent once and never
retried on 401/429/5xx/network errors; FreshBooks grants are single-use
- entity keyed by business account_id with the business name in details
- redirect_uri is ${REDIRECT_URI}/freshbooks
- clients, invoices, payments, users/me and callback methods
- nock transport tests, including core Module refresh/rotation flows
Supersedes #156.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
🚀 PR was released in |
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.
What
Adds
@friggframework/api-module-freshbooksunderpackages/v1-ready/freshbooks(Frigg v2,@friggframework/core ^2.0.0-next.126).packages/needs-updating/freshbooksisgit mv'd and its v0 files (manager, models, mocks, old tests) are removed.Supersedes #156.
Why
This is a port of the FreshBooks module that runs in production in
lefthookhq/freshbooks-integrations(backend/src/api-modules/freshbooks/). Once it's published, the app can depend on it instead of carrying its own copy.Behaviour
account_id, with the business name indetails.name. A user with several businesses must passaccount_id; the module throws and lists the choices.access_token,refresh_tokenandfreshbooksUserId.redirect_uri:${REDIRECT_URI}/freshbooksusers/mewebUrls,invoiceStatusNameDifferences from the production copy
_refreshAuthOnceoverride). In the production copy, a 401 on a directgetTokenFromCodeorrefreshAccessTokentriggered core's refresh and posted a second grant.defaultConfig.json: addslogoUrl.Everything else is unchanged apart from prettier formatting.
Tests
79 tests, all mocked with nock, no network.
Moduleflows: rotation persistence, concurrent 401s sharing one refresh, adopting a newer credential afterinvalid_grant.redirect_uri, entity keying and business name.Other checks:
prettier --checkis clean (apart from the auto-generated CHANGELOG), andnpm ci --dry-runpasses with the updated lockfile.Left in the app
App-specific logic stays in the app: HubSpot sync, webhook routing (
freshbooksWebhooks.js), cutover scripts and the cards. None of it is in this module.🤖 Generated with Claude Code
📦 Published PR as canary version:
Canary Versions✨ Test out this PR locally via:
npm install @friggframework/api-module-freshbooks@1.1.0-canary.240.b16c133.0 # or yarn add @friggframework/api-module-freshbooks@1.1.0-canary.240.b16c133.0Version
Published prerelease version:
@friggframework/api-module-freshbooks@1.1.0-next.0Changelog
🚀 Enhancement
@friggframework/api-module-freshbooks🐛 Bug Fix
@friggframework/api-module-microsoft-teams,@friggframework/api-module-slack,@friggframework/api-module-42matters,@friggframework/api-module-asana,@friggframework/api-module-attio,@friggframework/api-module-clio,@friggframework/api-module-connectwise,@friggframework/api-module-contentful,@friggframework/api-module-contentstack,@friggframework/api-module-crossbeam,@friggframework/api-module-deel,@friggframework/api-module-fathom,@friggframework/api-module-fireflies,@friggframework/api-module-frigg-scale-test,@friggframework/api-module-frontify,@friggframework/api-module-gong,@friggframework/api-module-google-calendar,@friggframework/api-module-google-drive,@friggframework/api-module-helpscout,@friggframework/api-module-hubspot,@friggframework/api-module-ironclad,@friggframework/api-module-linear,@friggframework/api-module-otter,@friggframework/api-module-pipedrive,@friggframework/api-module-quo,@friggframework/api-module-reevo,@friggframework/api-module-salesforce,@friggframework/api-module-stripe,@friggframework/api-module-unbabel-projects,@friggframework/api-module-unbabel,@friggframework/api-module-zoho-crm,@friggframework/api-module-zoomAuthors: 1