Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/cvetdv.ru/bitrix/js/im/v2/model/src/recent/format/ |
Upload File : |
import { Utils } from 'im.v2.lib.utils'; import { Type } from 'main.core'; import { convertToString, isNumberOrString } from '../../utils/format'; import { prepareDraft, prepareInvitation } from './format-functions'; import type { FieldsConfig } from '../../utils/validate'; export const recentFieldsConfig: FieldsConfig = [ { fieldName: ['id', 'dialogId'], targetFieldName: 'dialogId', checkFunction: isNumberOrString, formatFunction: convertToString, }, { fieldName: 'messageId', targetFieldName: 'messageId', checkFunction: isNumberOrString, }, { fieldName: 'draft', targetFieldName: 'draft', checkFunction: Type.isPlainObject, formatFunction: prepareDraft, }, { fieldName: 'invited', targetFieldName: 'invitation', checkFunction: [Type.isPlainObject, Type.isBoolean], formatFunction: prepareInvitation, }, { fieldName: 'unread', targetFieldName: 'unread', checkFunction: Type.isBoolean, }, { fieldName: 'pinned', targetFieldName: 'pinned', checkFunction: Type.isBoolean, }, { fieldName: 'liked', targetFieldName: 'liked', checkFunction: Type.isBoolean, }, { fieldName: ['defaultUserRecord', 'isFakeElement'], targetFieldName: 'isFakeElement', checkFunction: Type.isBoolean, }, { fieldName: 'isBirthdayPlaceholder', targetFieldName: 'isBirthdayPlaceholder', checkFunction: Type.isBoolean, }, { fieldName: ['dateLastActivity', 'lastActivityDate'], targetFieldName: 'lastActivityDate', checkFunction: [Type.isString, Type.isDate], formatFunction: Utils.date.cast, }, ];