You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

15 lines
800 B

$ErrorActionPreference = 'Continue'
$base = 'http://localhost:8080'
$r = Invoke-RestMethod -Uri "$base/api/auth/debug/token?userId=739564171091247104"
$token = if ($r.data -is [string]) { $r.data } else { $r.data.token }
$h = @{ Authorization = "Bearer $token" }
$groups = Invoke-RestMethod -Uri "$base/api/dict/group/enabled-list" -Headers $h
$out = [ordered]@{}
foreach ($g in $groups.data) {
$code = [string]$g.code
if (-not $code) { continue }
$items = Invoke-RestMethod -Uri ("$base/api/dict/item/enabled-list?groupCode={0}" -f [uri]::EscapeDataString($code)) -Headers $h
$out[$code] = $items.data
}
$out | ConvertTo-Json -Depth 8 | Out-File '.scratch\opportunity-e2e\env-raw\dict-items.json' -Encoding utf8
Write-Host ('groups=' + $groups.data.Count + ' keys=' + ($out.Keys -join ','))