@echo off
chcp 65001 >nul 2>&1
echo ============================================
echo   AIX Connector - Direct Activation
echo ============================================
echo.

set /p ACCESS_TOKEN="Paste your Access Token (cxp_...): "
if "%ACCESS_TOKEN%"=="" (
  echo ERROR: No token entered. Exiting.
  pause
  exit /b 1
)

echo.
echo Sending activation token to connector on localhost:48241...
echo.

curl -s -X POST "http://localhost:48241/activation/session" ^
  -H "Content-Type: application/json" ^
  -d "{\"AccessToken\":\"%ACCESS_TOKEN%\",\"Origin\":\"https://storeaix.base44.app\"}"

echo.
echo.
echo ============================================
echo If you see "success": true above, the connector is activated!
echo The installer should now complete automatically.
echo ============================================
echo.
pause
