feat: Add Radar to Node SDK#1596
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (34)
✅ Files skipped from review due to trivial changes (18)
📝 WalkthroughWalkthroughThis PR introduces a complete Radar fraud detection API feature to the WorkOS SDK alongside webhook event updates. The Radar feature includes type contracts, serializers, a typed API client, comprehensive tests, test fixtures, and integration into the main WorkOS surface. Three new webhook event types for pipes connected account lifecycle are also added to webhook event mappings. ChangesRadar API feature addition
Webhook pipes connected account events
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Greptile SummaryThis PR integrates the Radar fraud-detection module into the WorkOS Node SDK, exposing four new methods on
Confidence Score: 4/5Safe to merge once the addListEntry response type mismatch is resolved; all other changes are well-structured and follow established SDK patterns. The addListEntry method unconditionally deserializes every API response using RadarListEntryAlreadyPresentResponse, whose message field is declared as a required string. When a brand-new entry is successfully inserted the API returns a different body, so message will be undefined at runtime while TypeScript believes it is always present. Any caller that reads result.message on a normal insertion will silently receive undefined. This unresolved issue in radar.ts is the primary concern. src/radar/radar.ts — the addListEntry return type and its deserialization path need attention before merging. Important Files Changed
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 627d1c96-cafe-4f8a-8104-191f04a43bea
📒 Files selected for processing (32)
.oagen-manifest.jsonsrc/index.tssrc/radar/fixtures/radar-list-entry-already-present-response.jsonsrc/radar/fixtures/radar-standalone-assess-request.jsonsrc/radar/fixtures/radar-standalone-delete-radar-list-entry-request.jsonsrc/radar/fixtures/radar-standalone-response.jsonsrc/radar/fixtures/radar-standalone-update-radar-attempt-request.jsonsrc/radar/fixtures/radar-standalone-update-radar-list-request.jsonsrc/radar/interfaces/index.tssrc/radar/interfaces/radar-action.interface.tssrc/radar/interfaces/radar-list-entry-already-present-response.interface.tssrc/radar/interfaces/radar-standalone-assess-request-action.interface.tssrc/radar/interfaces/radar-standalone-assess-request-auth-method.interface.tssrc/radar/interfaces/radar-standalone-assess-request.interface.tssrc/radar/interfaces/radar-standalone-delete-radar-list-entry-request.interface.tssrc/radar/interfaces/radar-standalone-response-blocklist-type.interface.tssrc/radar/interfaces/radar-standalone-response-control.interface.tssrc/radar/interfaces/radar-standalone-response-verdict.interface.tssrc/radar/interfaces/radar-standalone-response.interface.tssrc/radar/interfaces/radar-standalone-update-radar-attempt-request.interface.tssrc/radar/interfaces/radar-standalone-update-radar-list-request.interface.tssrc/radar/interfaces/radar-type.interface.tssrc/radar/radar.spec.tssrc/radar/radar.tssrc/radar/serializers/index.tssrc/radar/serializers/radar-list-entry-already-present-response.serializer.tssrc/radar/serializers/radar-standalone-assess-request.serializer.tssrc/radar/serializers/radar-standalone-delete-radar-list-entry-request.serializer.tssrc/radar/serializers/radar-standalone-response.serializer.tssrc/radar/serializers/radar-standalone-update-radar-attempt-request.serializer.tssrc/radar/serializers/radar-standalone-update-radar-list-request.serializer.tssrc/workos.ts
| // This file is auto-generated by oagen. Do not edit. | ||
|
|
||
| export const RadarAction = { | ||
| Block: 'block', |
There was a problem hiding this comment.
We can also issue a Challenge: 'challenge' action here
There was a problem hiding this comment.
oh I see - this is just for lists, where we only support block and allow. Could we update the const naming to be something like "RadarListAction"?
| @@ -0,0 +1,11 @@ | |||
| // This file is auto-generated by oagen. Do not edit. | |||
|
|
|||
| export const RadarStandaloneAssessRequestAction = { | |||
There was a problem hiding this comment.
Could we narrow this to just be "sign-up" and "sign-in"? I'm also looking at the public docs, and we support like a lot of different variations, but I think that's just iterations. Wonder if we can only show these two options publicly to try and get users to send the right one.
| BruteForceAttack: 'brute_force_attack', | ||
| CredentialStuffing: 'credential_stuffing', | ||
| DomainSignUpRateLimit: 'domain_sign_up_rate_limit', | ||
| IpSignUpRateLimit: 'ip_sign_up_rate_limit', |
There was a problem hiding this comment.
hmmm this ip_sign_up_rate_limit should have been deprecated - I think that's something we'll need to do in the API.
Summary
workos.radar.src/index.ts,src/workos.ts, and.oagen-manifest.jsonso generated artifacts and barrel exports stay in sync.radar.spec.tscovering the new client methods.Test plan
npm test -- radar.spec.tspassesworkos.radaris reachable from a consumer and types resolve correctlySummary by CodeRabbit