-
Notifications
You must be signed in to change notification settings - Fork 259
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(clerk-js,backend,shared):Apply deprecation warnings `@clerk/typ…
…es` (#1823) * fix(shared): Fix deprecatedObjectProperty key usage and support optional key arg * chore(clerk-js): Warn about orgs jwt claim deprecation * chore(backend): Warn about orgs jwt claim deprecation * chore(backend): Warn about apiKey deprecation * chore(backend): Fix typo in frontendApi deprecation warning * chore(clerk-react,clerk-js): Warn about PublishableKeyOrFrontendApi.frontendApi deprecations * chore(clerk-js): Warn about PublicUserData.profileImageUrl deprecations * chore(clerk-js): Warn about redirect_url deprecations * chore(clerk-js): Warn about password deprecations in User.update * chore(clerk-js): Warn about generateSignature deprecations * chore(clerk-js): Warn about afterSwitchOrganizationUrl deprecation * chore(clerk-js): Warn about UserData.profileImageUrl deprecations * chore(clerk-js): Use PublicUserData and UserData instead of multiple *UserData classes
- Loading branch information
Showing
23 changed files
with
150 additions
and
29 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
'@clerk/clerk-js': patch | ||
'@clerk/backend': patch | ||
'@clerk/shared': patch | ||
'@clerk/clerk-react': patch | ||
--- | ||
|
||
Apply deprecation warnings for @clerk/types: | ||
|
||
- `orgs` jwt claims | ||
- `apiKey` | ||
- `frontendApi` | ||
- `redirect_url` | ||
- `password` | ||
- `generateSignature` | ||
- `afterSwitchOrganizationUrl` | ||
- `profileImageUrl` |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { deprecatedProperty } from '@clerk/shared'; | ||
import type { UserData as IUserData } from '@clerk/types'; | ||
import type { UserDataJSON } from '@clerk/types'; | ||
|
||
export class UserData implements IUserData { | ||
firstName?: string; | ||
lastName?: string; | ||
/** | ||
* @deprecated Use `imageUrl` instead. | ||
*/ | ||
profileImageUrl?: string; | ||
imageUrl?: string; | ||
hasImage?: boolean; | ||
|
||
constructor(data: UserDataJSON) { | ||
this.fromJSON(data); | ||
} | ||
|
||
protected fromJSON(data: UserDataJSON | null): this { | ||
if (data) { | ||
this.firstName = data.first_name; | ||
this.lastName = data.last_name; | ||
this.profileImageUrl = data.profile_image_url; | ||
this.imageUrl = data.image_url; | ||
this.hasImage = data.has_image; | ||
} | ||
|
||
return this; | ||
} | ||
} | ||
|
||
deprecatedProperty(UserData, 'profileImageUrl', 'Use `imageUrl` instead.'); |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.