import { Common } from "../index"; export interface IContactInfo { id: string; name: string; imageUrl?: string; isBusiness: boolean | false; contactAddresses: IContactAddress[]; businessName?: string; businessId?: string; } export interface IBusiness { id: string; spaceId: string; counters?: ICounters; name: string; imageUrl: string; ownerUserId?: string; membersId: string[]; members: IContactInfo[]; phones: IContactAddress[]; emails: IContactAddress[]; ims_instagram: IContactAddress[]; ims_facebook: IContactAddress[]; ims_webchat: IContactAddress[]; ims_whatsapp: IContactAddress[]; ims_mercadolibre: IContactAddress[]; ims_rcs: IContactAddress[]; address1: IContactPostalAddress; address2: IContactPostalAddress; tags: IContactTag[]; properties: Property[]; hasDuplicates: boolean | false; duplicateIds: string[]; origin: ContactOrigin; createdAt?: Date | null; createdBy?: string | null; updatedAt?: Date | null; updatedBy?: string | null; deletedAt?: Date | null; deletedBy?: string | null; } export interface ICounters { conversations: number; documents: number; events: number; notes: number; } export interface IContact { id: string; spaceId: string; counters?: ICounters; name: string; firstName: string; lastName: string; imageUrl: string; birthDate?: Date | null; ownerUserId?: string; businessId?: string; businessName?: string; phones: IContactAddress[]; emails: IContactAddress[]; ims_instagram: IContactAddress[]; ims_facebook: IContactAddress[]; ims_webchat: IContactAddress[]; ims_whatsapp: IContactAddress[]; ims_mercadolibre: IContactAddress[]; ims_rcs: IContactAddress[]; address1: IContactPostalAddress; address2: IContactPostalAddress; tags: IContactTag[]; properties: Property[]; hasDuplicates: boolean | false; duplicateIds: string[]; isSpam: boolean; fechaUltMsg?: Date; origin: ContactOrigin; createdAt?: Date | null; createdBy?: string | null; updatedAt?: Date | null; updatedBy?: string | null; deletedAt?: Date | null; deletedBy?: string | null; } export interface Property { nameKey: string; type: ContactField_type; value: any; } export declare enum ContactOrigin { MANUAL = 0, IMPORT = 1, CALL = 2, TICKET = 3, FORM = 4 } export interface IContactPostalAddress { street: string; city: string; state: string; zipcode: string; country: string; } export interface IContactField { id: string; name: string; nameKey: string; description: string | ''; placeholder: string | ''; type: ContactField_type; typeNumberDecimalsCount: number | 0; typeOptions: string[]; typeOptionsMultiple: boolean; listItemSchema?: IContactFieldListItemSchema[]; order: number; requiredField: boolean; forContact: boolean; forBusiness: boolean; isDefault: boolean; isSearchKey: boolean; isImportKey: boolean; isMultiSelect: boolean; readOnly: boolean; hide: boolean; useMask: boolean; min?: number; max?: number; createdAt?: string | null; createdBy?: string | null; deleted: boolean; deletedAt?: string | null; } export interface IContactFieldListItemSchema { key: string; label: string; type: ContactField_Item_Type; required: boolean; options?: string[]; } export declare enum ContactField_Item_Type { TEXT = 0, OPTIONS = 4, DATE = 6, NUMBER_INTEGER = 21, NUMBER_CURRENCY = 23 } export declare enum ContactField_type { TEXT = 0, LONGTEXT = 1, CURRENCY = 3, OPTIONS = 4, TIME = 5, DATE = 6, TIMERANGE = 7, DATERANGE = 8, ADDRESS = 11, NUMBER_INTEGER = 21, NUMBER_DECIMAL = 22, NUMBER_CURRENCY = 23, NUMBER_ACCOUNTING = 24, LIST_SINGLE = 31, LIST_OBJECT = 32 } export interface IContactAddress { id: string; channelType: Common.Channels.ChannelType; /** * No es un id del canal de Trii. * Facebook: fbPageId * Instagram: igAccountId * WhatsApp: cloudApiBusinessId */ channelId?: string; whatsappUserId?: string; whatsappParentUserId?: string; address: string; profileName: string; profileUrl: string; profileUrlDate?: Date; telInfo?: IContactTelInfo; note: string; isVerified: boolean; isFavorite: boolean; dateLastMsgIn?: Date; dateLastMsgOut?: Date; subscriptionsAllowed: string[]; subscriptionsRejected: string[]; createdAt: Date; verifiedAt?: Date; verifiedBy?: string; } export interface IContactTelInfo { isMobile: boolean; country: string; countryName: string; state: string; stateName: string; } export interface IContactTag { id: string; name: string; } export interface ISubscription { id: string; spaceId: string; name: string; description: string; createdAt: Date; updatedAt?: Date; deletedAt?: Date; } export interface IIntegrationButton { id: number; name: string; enabled: boolean; icon_class: string; icon_color: string; api_method: IntegrationButton_method; api_url: string; api_AuthType: string; api_Auth_username: string; api_Auth_password: string; api_Auth_token: string; api_Auth_token_url: string; api_Auth_token_body: string; api_Auth_APIkey_Key: string; api_Auth_APIkey_Value: string; api_Auth_APIkey_Addto: string; api_contenttype: string; api_body: string; api_formatosalida: IntegrationButton_format; api_Template: string; } export declare enum IntegrationButton_method { GET = 1, POST = 2 } export declare enum IntegrationButton_format { JSON = 1, HTML = 2, HTML_newtab = 3 } export declare class GooglePeopleIntegration { googleAccount: GoogleAccountInfo; autoUpdate: boolean; updateBy: string; updateAt: Date; } export declare class GoogleAccountInfo { name: string; email: string; imageUrl: string; } export interface IList { id: string; name: string; description: string; count: number; createdAt: Date; } export interface IContactChangeLog { timeStamp: Date; action: ContactLogAction; details: string; userId: string; json?: string; jsonBefore?: string; importTag?: string; } export type ContactLogAction = 'created' | 'updated' | 'merged' | 'deleted' | 'restored';