test-find-user.ps1 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # Query Parse _User class to find a real user ID for testing
  2. $headers = @{ "X-Parse-Application-Id" = "ncloudmaster" }
  3. # List a few users (limit 5)
  4. Write-Host "=== Query _User (limit 5) ===" -ForegroundColor Cyan
  5. try {
  6. $encoded = [System.Uri]::EscapeDataString('{"_created_at":{"$gt":{"__type":"Date","iso":"2025-01-01T00:00:00.000Z"}}}')
  7. $url = "https://server.fmode.cn/parse/classes/_User?limit=5&order=-createdAt&keys=objectId,username,email,createdAt&where=$encoded"
  8. $r = Invoke-RestMethod -Uri $url -Method GET -Headers $headers -TimeoutSec 15
  9. Write-Host "Users found:" -ForegroundColor Green
  10. $r.results | ForEach-Object {
  11. Write-Host " objectId=$($_.objectId) username=$($_.username) created=$($_.createdAt)"
  12. }
  13. } catch {
  14. Write-Host "Error: $($_.Exception.Message)" -ForegroundColor Red
  15. # Try without where clause
  16. Write-Host "Trying without filter..." -ForegroundColor Yellow
  17. try {
  18. $r2 = Invoke-RestMethod -Uri "https://server.fmode.cn/parse/classes/_User?limit=3&order=-createdAt&keys=objectId,username,createdAt" -Method GET -Headers $headers -TimeoutSec 15
  19. $r2.results | ForEach-Object {
  20. Write-Host " objectId=$($_.objectId) username=$($_.username) created=$($_.createdAt)"
  21. }
  22. } catch {
  23. Write-Host "Also failed: $($_.Exception.Message)" -ForegroundColor Red
  24. }
  25. }
  26. Write-Host ""
  27. # Also check APIGAuth for any existing records linked to Vo3ROWEvDy
  28. Write-Host "=== Query APIGAuth linked to APIG Vo3ROWEvDy ===" -ForegroundColor Cyan
  29. try {
  30. $where2 = [System.Uri]::EscapeDataString('{"apig":{"__type":"Pointer","className":"APIG","objectId":"Vo3ROWEvDy"}}')
  31. $url2 = "https://server.fmode.cn/parse/classes/APIGAuth?limit=5&where=$where2"
  32. $r3 = Invoke-RestMethod -Uri $url2 -Method GET -Headers $headers -TimeoutSec 15
  33. Write-Host "APIGAuth records:" -ForegroundColor Green
  34. $r3 | ConvertTo-Json -Depth 5
  35. } catch {
  36. Write-Host "Error: $($_.Exception.Message)" -ForegroundColor Red
  37. }