feat: add lookupEndUser to TS, Python, Java SDKs#666
feat: add lookupEndUser to TS, Python, Java SDKs#666
Conversation
✅ Heimdall Review Status
|
|
df728c2 to
470b6ed
Compare
Adds wrapper methods around the new getEndUserByEmail OpenAPI operation across all three language clients. Searches end users by email across email, Google, Apple, and GitHub authentication methods. Closes CDPSDK-2561 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Align SDK wrapper methods with the OpenAPI operationId (lookupEndUser). Renames method, types, analytics actions, internal API calls, and changelog entries in TypeScript, Python, and Java.
The API spec changed lookupEndUser from returning a singular EndUser to
{ endUsers: EndUser[] }. Update TypeScript, Python, and Java SDK wrappers
to handle the array response and add unit tests for all three.
d44b437 to
b328863
Compare
| * endUsers.forEach(endUser => console.log(endUser.userId)); | ||
| * ``` | ||
| */ | ||
| async lookupEndUser(options: LookupEndUserOptions): Promise<EndUserAccount[]> { |
There was a problem hiding this comment.
Curious why we went with "lookup" rather than "get", as in getEndUser?
There was a problem hiding this comment.
Or add email as a prop to the existing getEndUser
There was a problem hiding this comment.
i wondered the same for a bit, maybe sam has more context and can share when back, or jazz. i realized the endpoint is /lookup and it's already been shared with folks so i didnt dig further.
There was a problem hiding this comment.
cc @jazz-cb
Not super clean to have a getEndUser and a lookupEndUser. Either an optional param(s) on existing getEndUser, or rename lookupEndUser to getEndUserByIdentity would be cleaner options IMO
There was a problem hiding this comment.
Chatted more in DMs with Saliou – Now understand that this new method can return 0, 1 or more users.
lookupEndUser is problematic for two reasons:
- It clashes with
getEndUser - It signals that a single end user is returned – from the name it's not clear that multiple end users may be returned
I think a more appropriate name could be findEndUsers. If it's too late to change the API itself, we could "mask" the API here in the SDK by just aliasing the method name to findEndUsers instead of lookupEndUser
There was a problem hiding this comment.
Agreed - lookup was settled on as to not overload get end user, or prematurely hog a search namespace, but IMO findEndUsers is cleaner. I'd prefer to mask it here for now and deprecate lookup on the backend in favor of find.
Description
Adds wrapper methods around the
lookupEndUserOpenAPI operation across all three SDK language clients (TypeScript, Python, Java).The operation searches end users by email address across all email-based authentication methods (email, Google, Apple, GitHub).
Closes CDPSDK-2561.
Tests
pnpm test— 473 tests pass, lint + build cleanpytest cdp/test/test_end_user_client.py— 50 tests pass, ruff cleanmake build+make test— greenChecklist
changelog.d)