/** * Shared constants used across the bot, integrations, and services. */ const STORE_MODES = Object.freeze({ DEFAULT: 'default', // store info + active network devices + store server POS: 'pos', // store server + registers + mobile registers + printers + payment terminals IOS: 'ios', // all iOS devices }); /** * MDM (Workspace ONE) device-name conventions. * Devices are classified by substring on UserName or DeviceFriendlyName. */ const MDM_DEVICE_TYPES = Object.freeze({ SERVER: 'SRV', MOBILE_REGISTER: 'MR', CUSTOMER_DISPLAY: 'CD', IPHONE: 'IPH', }); /** * Return the canonical device-name string used to classify an MDM device. */ function mdmDeviceName(device) { if (!device) return ''; return (device.UserName || device.DeviceFriendlyName || '').toString(); } /** * Filter MDM devices whose name contains the given marker (SRV/MR/CD/IPH). */ function filterMdmByType(devices, marker) { if (!Array.isArray(devices) || !marker) return []; return devices.filter(d => mdmDeviceName(d).includes(marker)); } module.exports = { STORE_MODES, MDM_DEVICE_TYPES, mdmDeviceName, filterMdmByType, };