diff --git a/package.json b/package.json index 376029e4..d33eefad 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@prezly/sdk", - "version": "26.2.1", + "version": "26.3.0-0", "description": "Prezly API SDK", "type": "module", "main": "dist/index.cjs", diff --git a/src/endpoints/Contacts/types.ts b/src/endpoints/Contacts/types.ts index 5e734e13..9b725bfe 100644 --- a/src/endpoints/Contacts/types.ts +++ b/src/endpoints/Contacts/types.ts @@ -30,6 +30,8 @@ interface BaseContactPayload { avatar_image?: string | null; languages?: string[]; emails?: string[]; + email_addresses?: (Pick & + Partial)[]; phone_numbers?: Contact.PhoneNumber[]; urls?: string[]; social_accounts?: { type: Contact.SocialNetwork; username: string }[]; diff --git a/src/types/Contact.ts b/src/types/Contact.ts index deff5f8e..3c8cc5ed 100644 --- a/src/types/Contact.ts +++ b/src/types/Contact.ts @@ -46,7 +46,13 @@ export interface Contact { languages: Language[]; primary_email: string | null; + + /** + * @deprecated Please use `email_addresses` instead. + */ emails: string[]; + + email_addresses: Contact.EmailAddress[]; phone_numbers: Contact.PhoneNumber[]; social: { type: Contact.SocialNetwork; username: string }[]; function_name: string; @@ -202,6 +208,12 @@ export namespace Contact { type: PhoneNumber.Type; } + export interface EmailAddress { + email_address: string; + is_active: boolean; + is_primary: boolean; + } + export namespace PhoneNumber { export enum Type { TELEPHONE = 'tel',