Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

Commit

Permalink
feat: Allow user update to modify user custom attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-ntousias committed Feb 22, 2021
1 parent 7b4b7af commit 07c51a1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*.log
.DS_Store
.idea
node_modules
dist
.env
Expand Down
2 changes: 2 additions & 0 deletions src/apis/UserApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ interface UserParams {
password?: string;
primaryEmailAddressID?: string;
primaryPhoneNumberID?: string;
publicMetadata?: object;
privateMetadata?: object;
}

export class UserApi extends AbstractApi {
Expand Down
6 changes: 3 additions & 3 deletions src/resources/User.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { GoogleAccount } from './GoogleAccount';
import { PhoneNumber } from './PhoneNumber';

export class User implements UserResource {
id: string
id: string;
username: string | null;
firstName: string | null;
lastName: string | null;
Expand All @@ -26,7 +26,7 @@ export class User implements UserResource {
emailAddresses: EmailAddressResource[];
phoneNumbers: PhoneNumberResource[];
externalAccounts: GoogleAccountResource[];
metadata: object;
publicMetadata: object;
privateMetadata: object;
createdAt: number;
updatedAt: number;
Expand All @@ -46,7 +46,7 @@ export class User implements UserResource {
this.emailAddresses = data.email_addresses.map((x) => new EmailAddress(x));
this.phoneNumbers = data.phone_numbers.map((x) => new PhoneNumber(x));
this.externalAccounts = data.external_accounts.map((x: GoogleAccountJSON) => new GoogleAccount(x));
this.metadata = data.metadata;
this.publicMetadata = data.public_metadata;
this.privateMetadata = data.private_metadata;
this.createdAt = data.created_at;
this.updatedAt = data.updated_at;
Expand Down
4 changes: 2 additions & 2 deletions src/types/resources.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export interface UserJSON extends ClerkResourceJSON {
email_addresses: EmailAddressJSON[];
phone_numbers: PhoneNumberJSON[];
external_accounts: GoogleAccountJSON[];
metadata: object;
public_metadata: object;
private_metadata: object;
created_at: number;
updated_at: number;
Expand All @@ -221,7 +221,7 @@ export interface UserResource extends ClerkResource {
emailAddresses: EmailAddressResource[];
phoneNumbers: PhoneNumberResource[];
externalAccounts: GoogleAccountResource[];
metadata: object;
publicMetadata: object;
privateMetadata: object;
createdAt: number;
updatedAt: number;
Expand Down

0 comments on commit 07c51a1

Please sign in to comment.