diff --git a/.gitignore b/.gitignore index 80ce8e3..c58d162 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ *.log .DS_Store +.idea node_modules dist .env diff --git a/src/apis/UserApi.ts b/src/apis/UserApi.ts index b3c1992..6483b89 100644 --- a/src/apis/UserApi.ts +++ b/src/apis/UserApi.ts @@ -8,6 +8,8 @@ interface UserParams { password?: string; primaryEmailAddressID?: string; primaryPhoneNumberID?: string; + publicMetadata?: object; + privateMetadata?: object; } export class UserApi extends AbstractApi { diff --git a/src/resources/User.ts b/src/resources/User.ts index ea21d61..c72a385 100644 --- a/src/resources/User.ts +++ b/src/resources/User.ts @@ -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; @@ -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; @@ -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; diff --git a/src/types/resources.d.ts b/src/types/resources.d.ts index f108ff8..f2cda12 100644 --- a/src/types/resources.d.ts +++ b/src/types/resources.d.ts @@ -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; @@ -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;