# Extract all URL patterns from saasadminui API files
$apiDir = "d:\ylrz\saasadminui\src\api"
$results = @()

Get-ChildItem -Path $apiDir -Recurse -Filter "*.js" | ForEach-Object {
    $file = $_.FullName
    $relPath = $_.FullName.Replace($apiDir + "\", "")
    $content = Get-Content $file -Raw -Encoding UTF8
    
    # Find all url: patterns
    $matches = [regex]::Matches($content, "url:\s*['""]([^'""]+)['""]")
    foreach ($m in $matches) {
        $url = $m.Groups[1].Value
        $results += "$relPath => $url"
    }
}

# Sort and output
$results | Sort-Object | ForEach-Object { Write-Output $_ }
