()
| 21 | let systeminformationModule: typeof import('systeminformation') | null = null |
| 22 | |
| 23 | async function getMachineId(): Promise<string> { |
| 24 | if (!machineIdModule) { |
| 25 | machineIdModule = await import('node-machine-id') |
| 26 | } |
| 27 | const id = await machineIdModule.machineId() |
| 28 | // Validate that we got a real machine ID, not an empty or placeholder value. |
| 29 | // Throwing here triggers the legacy fallback in calculateFingerprint(). |
| 30 | if (!id || id === 'unknown' || id.length < 8) { |
| 31 | throw new Error('Invalid machine ID returned') |
| 32 | } |
| 33 | return id |
| 34 | } |
| 35 | |
| 36 | async function getSystemInfo(): Promise<{ |
| 37 | system: { manufacturer: string; model: string; serial: string; uuid: string } |
no outgoing calls
no test coverage detected