Skip to content

Commit e470e3e

Browse files
committed
Remove deprecated samlAccounts
1 parent bb7e44f commit e470e3e

File tree

16 files changed

+37
-320
lines changed

16 files changed

+37
-320
lines changed

.changeset/smooth-ends-agree.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@clerk/clerk-js': patch
3+
'@clerk/backend': patch
4+
'@clerk/types': patch
5+
---
6+
7+
Remove deprecated `samlAccounts` property from `User` object in favor of `enterpriseAccounts`

packages/backend/src/api/resources/JSON.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ export const ObjectType = {
5050
PhoneNumber: 'phone_number',
5151
ProxyCheck: 'proxy_check',
5252
RedirectUrl: 'redirect_url',
53-
SamlAccount: 'saml_account',
5453
SamlConnection: 'saml_connection',
5554
Session: 'session',
5655
SignInAttempt: 'sign_in_attempt',
@@ -236,20 +235,6 @@ export interface JwtTemplateJSON extends ClerkResourceJSON {
236235
updated_at: number;
237236
}
238237

239-
export interface SamlAccountJSON extends ClerkResourceJSON {
240-
object: typeof ObjectType.SamlAccount;
241-
provider: string;
242-
provider_user_id: string | null;
243-
active: boolean;
244-
email_address: string;
245-
first_name: string;
246-
last_name: string;
247-
verification: VerificationJSON | null;
248-
saml_connection: SamlAccountConnectionJSON | null;
249-
last_authenticated_at: number | null;
250-
enterprise_connection_id: string | null;
251-
}
252-
253238
export interface IdentificationLinkJSON extends ClerkResourceJSON {
254239
type: string;
255240
}
@@ -590,7 +575,6 @@ export interface UserJSON extends ClerkResourceJSON {
590575
web3_wallets: Web3WalletJSON[];
591576
organization_memberships: OrganizationMembershipJSON[] | null;
592577
external_accounts: ExternalAccountJSON[];
593-
saml_accounts: SamlAccountJSON[];
594578
password_last_updated_at: number | null;
595579
public_metadata: UserPublicMetadata;
596580
private_metadata: UserPrivateMetadata;

packages/backend/src/api/resources/SamlAccount.ts

Lines changed: 0 additions & 71 deletions
This file was deleted.

packages/backend/src/api/resources/User.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { EmailAddress } from './EmailAddress';
22
import { ExternalAccount } from './ExternalAccount';
3-
import type { ExternalAccountJSON, SamlAccountJSON, UserJSON } from './JSON';
3+
import type { ExternalAccountJSON, UserJSON } from './JSON';
44
import { PhoneNumber } from './PhoneNumber';
5-
import { SamlAccount } from './SamlAccount';
65
import { Web3Wallet } from './Web3Wallet';
76

87
/**
@@ -120,10 +119,6 @@ export class User {
120119
* An array of all the `ExternalAccount` objects associated with the user via OAuth. **Note**: This includes both verified & unverified external accounts.
121120
*/
122121
readonly externalAccounts: ExternalAccount[] = [],
123-
/**
124-
* An array of all the `SamlAccount` objects associated with the user via SAML.
125-
*/
126-
readonly samlAccounts: SamlAccount[] = [],
127122
/**
128123
* Date when the user was last active.
129124
*/
@@ -179,7 +174,6 @@ export class User {
179174
(data.phone_numbers || []).map(x => PhoneNumber.fromJSON(x)),
180175
(data.web3_wallets || []).map(x => Web3Wallet.fromJSON(x)),
181176
(data.external_accounts || []).map((x: ExternalAccountJSON) => ExternalAccount.fromJSON(x)),
182-
(data.saml_accounts || []).map((x: SamlAccountJSON) => SamlAccount.fromJSON(x)),
183177
data.last_active_at,
184178
data.create_organization_enabled,
185179
data.create_organizations_limit,

packages/backend/src/api/resources/index.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,23 @@ export type {
2222

2323
export type { SignUpStatus } from '@clerk/types';
2424

25+
export * from './CommercePlan';
26+
export * from './CommerceSubscription';
27+
export * from './CommerceSubscriptionItem';
2528
export * from './ExternalAccount';
29+
export * from './Feature';
2630
export * from './IdentificationLink';
2731
export * from './IdPOAuthAccessToken';
2832
export * from './Instance';
2933
export * from './InstanceRestrictions';
3034
export * from './InstanceSettings';
3135
export * from './Invitation';
3236
export * from './JSON';
37+
export * from './JwtTemplate';
38+
export * from './M2MToken';
3339
export * from './Machine';
3440
export * from './MachineScope';
3541
export * from './MachineSecretKey';
36-
export * from './M2MToken';
37-
export * from './JwtTemplate';
3842
export * from './OauthAccessToken';
3943
export * from './OAuthApplication';
4044
export * from './Organization';
@@ -45,7 +49,6 @@ export * from './OrganizationSettings';
4549
export * from './PhoneNumber';
4650
export * from './ProxyCheck';
4751
export * from './RedirectUrl';
48-
export * from './SamlAccount';
4952
export * from './SamlConnection';
5053
export * from './Session';
5154
export * from './SignInTokens';
@@ -57,17 +60,13 @@ export * from './User';
5760
export * from './Verification';
5861
export * from './WaitlistEntry';
5962
export * from './Web3Wallet';
60-
export * from './CommercePlan';
61-
export * from './CommerceSubscription';
62-
export * from './CommerceSubscriptionItem';
63-
export * from './Feature';
6463

6564
export type {
6665
EmailWebhookEvent,
67-
OrganizationWebhookEvent,
6866
OrganizationDomainWebhookEvent,
6967
OrganizationInvitationWebhookEvent,
7068
OrganizationMembershipWebhookEvent,
69+
OrganizationWebhookEvent,
7170
PermissionWebhookEvent,
7271
RoleWebhookEvent,
7372
SessionWebhookEvent,

packages/clerk-js/src/core/resources/SamlAccount.ts

Lines changed: 0 additions & 132 deletions
This file was deleted.

packages/clerk-js/src/core/resources/User.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import type {
1919
PasskeyResource,
2020
PhoneNumberResource,
2121
RemoveUserPasswordParams,
22-
SamlAccountResource,
2322
SetProfileImageParams,
2423
TOTPJSON,
2524
TOTPResource,
@@ -49,7 +48,6 @@ import {
4948
OrganizationSuggestion,
5049
Passkey,
5150
PhoneNumber,
52-
SamlAccount,
5351
SessionWithActivities,
5452
TOTP,
5553
UserOrganizationInvitation,
@@ -69,8 +67,6 @@ export class User extends BaseResource implements UserResource {
6967
enterpriseAccounts: EnterpriseAccountResource[] = [];
7068
passkeys: PasskeyResource[] = [];
7169

72-
samlAccounts: SamlAccountResource[] = [];
73-
7470
organizationMemberships: OrganizationMembershipResource[] = [];
7571
passwordEnabled = false;
7672
firstName: string | null = null;
@@ -365,8 +361,6 @@ export class User extends BaseResource implements UserResource {
365361

366362
this.organizationMemberships = (data.organization_memberships || []).map(om => new OrganizationMembership(om));
367363

368-
this.samlAccounts = (data.saml_accounts || []).map(sa => new SamlAccount(sa, this.path() + '/saml_accounts'));
369-
370364
this.enterpriseAccounts = (data.enterprise_accounts || []).map(
371365
ea => new EnterpriseAccount(ea, this.path() + '/enterprise_accounts'),
372366
);
@@ -413,7 +407,6 @@ export class User extends BaseResource implements UserResource {
413407
external_accounts: this.externalAccounts.map(ea => ea.__internal_toSnapshot()),
414408
passkeys: this.passkeys.map(passkey => passkey.__internal_toSnapshot()),
415409
organization_memberships: this.organizationMemberships.map(om => om.__internal_toSnapshot()),
416-
saml_accounts: this.samlAccounts.map(sa => sa.__internal_toSnapshot()),
417410
enterprise_accounts: this.enterpriseAccounts.map(ea => ea.__internal_toSnapshot()),
418411
totp_enabled: this.totpEnabled,
419412
backup_code_enabled: this.backupCodeEnabled,

packages/clerk-js/src/core/resources/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ export * from './ExternalAccount';
88
export * from './IdentificationLink';
99
export * from './Image';
1010
export * from './PhoneNumber';
11-
export * from './SamlAccount';
1211
export * from './Session';
1312
export * from './SessionWithActivities';
1413
export * from './SignIn';
@@ -18,4 +17,3 @@ export * from './User';
1817
export * from './Verification';
1918
export * from './Waitlist';
2019
export * from './Web3Wallet';
21-

0 commit comments

Comments
 (0)