feat: add Intra v3 API support - #54
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new Fast42v3 client to support the Intra v3 microservice-based API alongside the existing v2 Fast42 client, including shared retry helpers, updated entrypoint exports, tests, and documentation.
Changes:
- Introduces
Fast42v3with OIDC (password + refresh token) auth, per-service URL routing, and v3-style pagination helpers. - Refactors v2 implementation into
src/v2.tsand extracts shared retry/query helpers intosrc/shared.ts, withsrc/index.tsbecoming a re-export entrypoint. - Adds v3 test coverage and updates docs/Jest config for the new module layout.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/v3.test.ts | Adds v3-focused tests covering auth, routing, pagination, and token refresh behavior. |
| tests/v2.test.ts | Updates v2 tests to import from the new src/v2 module. |
| src/v3.ts | Implements the Fast42v3 client (OIDC token handling + microservice request helpers). |
| src/v2.ts | Moves the existing v2 client implementation into its own module and uses shared helpers. |
| src/shared.ts | Adds shared retry/query helpers for both clients. |
| src/index.ts | Updates package entrypoint exports for v2 default + v3 named export. |
| README.md | Documents usage/configuration for Fast42v3. |
| jest.config.js | Maps .js-suffixed relative imports to TS sources for ts-jest runs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
github-actions Bot
pushed a commit
that referenced
this pull request
Jul 13, 2026
# [3.1.0](v3.0.0...v3.1.0) (2026-07-13) ### Features * add Intra v3 API support ([#54](#54)) ([7acdc93](7acdc93))
|
🎉 This PR is included in version 3.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Add Intra v3 API support (
Fast42v3)Adds a separate client for the Intra v3 API alongside the existing v2
Fast42.Why a separate client
v3 isn't a versioned path on
api.intra.42.fr— it's a set of independent microservices (pace-system, freeze, chronos, alumni-management), each on its own host. It also authenticates completely differently: OIDC (Keycloakstaff-42realm) with the password/refresh grant instead of v2'sclient_credentials, and has no rate limits. Since the two share almost nothing, v3 lives in its ownFast42v3class.What's included
Fast42v3— per-service routing (get('pace-system', 'v1', '/milestones')), OIDC token manager (password grant → auto refresh,refreshToken(totp)for 2FA re-auth), v3 pagination (page/size, readspagesfrom the body), and the same 429/5xx retry policy.index.tsintoshared.ts/v2.ts/v3.ts;index.tsis now the entry point.index.test.ts→v2.test.ts(31 passing total).Backwards compatibility
Fully compatible.
import Fast42 from '@codam/fast42'and all existing exports/methods are unchanged; everything new is additive.Validated
Live-tested against the real v3 API: auth, token acceptance, and pagination all confirmed.