* Load MDM configuration from system location
()
| 117 | * Load MDM configuration from system location |
| 118 | */ |
| 119 | private async loadMdmConfig(): Promise<MdmConfig | null> { |
| 120 | const configPath = this.getMdmConfigPath() |
| 121 | |
| 122 | try { |
| 123 | // Check if file exists |
| 124 | if (!fs.existsSync(configPath)) { |
| 125 | return null |
| 126 | } |
| 127 | |
| 128 | // Read and parse the configuration file |
| 129 | const configContent = fs.readFileSync(configPath, "utf-8") |
| 130 | const parsedConfig = JSON.parse(configContent) |
| 131 | |
| 132 | // Validate against schema |
| 133 | return mdmConfigSchema.parse(parsedConfig) |
| 134 | } catch (error) { |
| 135 | this.log(`[MDM] Error reading MDM config from ${configPath}:`, error) |
| 136 | return null |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | /** |
| 141 | * Get the platform-specific MDM configuration file path |
no test coverage detected