import type { CompatibilityAttestation } from "./api";
import type { ConnectionMode } from "./configuration";

export const EXACT_PROFILE_SELECTION: CompatibilityAttestation = Object.freeze({
  firmware_version: "3.0.2",
  topology: "direct-lan",
  verification: "live-device-info",
});

const topologyByConnectionMode = {
  bridge: "direct-lan",
  "quick-connect": "device-ap",
  "direct-connect": "controller-hotspot",
} as const satisfies Record<ConnectionMode, CompatibilityAttestation["topology"]>;

export function profileSelectionForConnectionMode(
  connectionMode: ConnectionMode,
): CompatibilityAttestation {
  return {
    firmware_version: "3.0.2",
    topology: topologyByConnectionMode[connectionMode],
    verification: "live-device-info",
  };
}
