import { isObject } from 'lodash' import { ElementData } from '../interfaces' export const ELEMENT_NAME = 'element_name' export const GPS_COORDINATES = 'coordinates' export const GEO_IDENTIFIER = 'geo_identifier' export const ELEMENT_PARENT = '_element_parent' export const META_ATTRIBUTES = [ 'organization', 'timestamp', 'updatedAt', 'updatedBy', 'author', 'hash', '_type', ] export const IMAGE_SIZE_RELS = [ 'image-preview-720x360', 'image-preview-360x360', 'image-preview-w1536', 'image-preview-w1024', 'image-preview-w768', 'image-preview-w480', 'image-preview-m100', ] export const TICKET_TYPE = 'Ticket' export const REGISTRATION_REQUEST_TYPE = 'SelfRegistrationRequest' export const REGISTRATION_CONFIGURATION_TYPE = 'SelfRegistrationConfiguration' // these should only go through Ticket API export const TICKET_SPECIAL_ATTRIBUTES = [ 'subject', 'description', 'is_incomplete', 'location', 'status', 'assignees', 'approvers', 'participants', 'elements', 'dueDate', 'priority', 'createdBy', 'createdAt', 'checklist', '_parent', ] export const isElementObject = (element: unknown): element is ElementData => !!element && isObject(element) && (element as ElementData).hash !== undefined