Commit f22b8b0
feat(user): rename loginId to loginIdOrUserId in user management methods (#691)
* feat(user): rename loginId to loginIdOrUserId in user management methods
Renames the `loginId` parameter to `loginIdOrUserId` across 22 user
management methods to clarify that both login IDs and user IDs are
accepted identifiers, aligning with the go-sdk naming convention.
The JSON field sent to the Descope API remains `loginId` unchanged.
Adds `PatchUserOptionsUsingIdentifier` interface for `patchBatch` with
backward-compatible deprecated `loginId` field.
Resolves: descope/etc#14620
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(user): address patchBatch edge cases and update overload formatting
- Add runtime guard in patchBatch throwing if neither loginIdOrUserId
nor loginId is provided
- Replace PatchUserOptionsUsingIdentifier interface with a union type
that enforces at least one identifier at compile time
- Add tests for deprecated loginId backward-compat path and missing
identifier error
- Revert update() overload 1 to single-line form (no-op formatting)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* test(user): use loginId for user3 in main patchBatch test for BC coverage
The main test now mixes loginIdOrUserId (user1, user2) and loginId (user3),
covering backward compatibility inline without a separate test case.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(test): use synchronous toThrow for patchBatch missing-identifier test
The error is thrown synchronously inside Array.map before any promise
is created, so rejects.toThrow() never receives a rejected promise.
Switch to the synchronous expect(() => ...).toThrow() form.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* chore: prettier fix
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 444d52f commit f22b8b0
2 files changed
+139
-60
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
620 | 620 | | |
621 | 621 | | |
622 | 622 | | |
623 | | - | |
| 623 | + | |
624 | 624 | | |
625 | 625 | | |
626 | 626 | | |
627 | 627 | | |
628 | 628 | | |
629 | | - | |
| 629 | + | |
630 | 630 | | |
631 | 631 | | |
632 | 632 | | |
| |||
698 | 698 | | |
699 | 699 | | |
700 | 700 | | |
701 | | - | |
| 701 | + | |
702 | 702 | | |
703 | 703 | | |
704 | 704 | | |
| |||
718 | 718 | | |
719 | 719 | | |
720 | 720 | | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
721 | 743 | | |
722 | 744 | | |
723 | 745 | | |
| |||
0 commit comments