{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "chrome",
      "request": "launch",
      "name": "omsapp",
      // 启动URL必须包含baseHref
      "url": "http://localhost:4200/app",
      // webRoot指向本地项目根目录
      "webRoot": "${workspaceFolder}/omsapp",
      "sourceMapPathOverrides": {
        // 这是最关键的行：
        // 将浏览器URL的 `/app/` 路径，映射到你本地文件系统的根目录。
        "/app/*": "${workspaceFolder}/omsapp/*"
      }
    },
    {
      "type": "node",
      "request": "launch",
      "name": "oms-background",
      "skipFiles": ["<node_internals>/**"],
      "program": "${workspaceFolder}/oms/src/app.ts",
      "runtimeArgs": [
        "--require",
        "ts-node/register" // This tells Node.js to use ts-node to register a TypeScript transpiler
      ],
      "args": [], // Optional arguments for your script
      "env": {
        // You can add environment variables needed by your script here,
        "MONGO_URI": "mongodb://oms:oms123.@localhost:27717/omsdb?authSource=admin",
        "CLICKHOUSE_HOST": "http://localhost:8123",
        "CLICKHOUSE_DATABASE": "omsdb",
        "CLICKHOUSE_USER": "ckuser",
        "CLICKHOUSE_PASSWORD": "ckpassword"
      },
      "cwd": "${workspaceFolder}/oms", // Set the current working directory to the 'oms' folder
      "console": "integratedTerminal", // Or "internalConsole"
      "internalConsoleOptions": "openOnSessionStart"
    },
    {
      "type": "node",
      "request": "launch",
      "name": "ingestHistoricalData (TS-Node)",
      "skipFiles": ["<node_internals>/**"],
      "program": "${workspaceFolder}/oms/src/scripts/ingestHistoricalData.ts",
      "runtimeArgs": [
        "--require",
        "ts-node/register" // This tells Node.js to use ts-node to register a TypeScript transpiler
      ],
      "args": [], // Optional arguments for your script
      "env": {
        // You can add environment variables needed by your script here,
        "MONGO_URI": "mongodb://oms:oms123.@localhost:27717/omsdb",
        "CLICKHOUSE_HOST": "http://localhost:8123",
        "CLICKHOUSE_DATABASE": "omsdb",
        "CLICKHOUSE_USER": "ckuser",
        "CLICKHOUSE_PASSWORD": "ckpassword",
        "START_DATE": "20250818", // Example date range
        "END_DATE": "20250820"
      },
      "cwd": "${workspaceFolder}/oms", // Set the current working directory to the 'oms' folder
      "console": "integratedTerminal", // Or "internalConsole"
      "internalConsoleOptions": "openOnSessionStart"
    },
    {
      "type": "node",
      "request": "launch",
      "name": "test (TS-Node)",
      "skipFiles": ["<node_internals>/**"],
      "program": "${workspaceFolder}/oms/src/test/test-remote-art.ts",
      "runtimeArgs": [
        "--require",
        "ts-node/register" // This tells Node.js to use ts-node to register a TypeScript transpiler
      ],
      "args": [], // Optional arguments for your script
      "cwd": "${workspaceFolder}/oms", // Set the current working directory to the 'oms' folder
      "console": "integratedTerminal", // Or "internalConsole"
      "internalConsoleOptions": "openOnSessionStart"
    },
    {
      "type": "node",
      "request": "launch",
      "name": "active-user-daily-notify (TS-Node)",
      "skipFiles": ["<node_internals>/**"],
      "program": "${workspaceFolder}/oms/src/scripts/active-user-daily-notify.ts",
      "runtimeArgs": [
        "--require",
        "ts-node/register" // This tells Node.js to use ts-node to register a TypeScript transpiler
      ],
      "args": [], // Optional arguments for your script
      "cwd": "${workspaceFolder}/oms", // Set the current working directory to the 'oms' folder
      "console": "integratedTerminal", // Or "internalConsole"
      "internalConsoleOptions": "openOnSessionStart"
    }
  ]
}
