test-video-isolation.ps1 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. # Test storeId isolation without changing cloud function
  2. # 1. Test register action (bind a dummy taskId to storeId="openclaw")
  3. Write-Host "=== Test register (storeId isolation) ===" -ForegroundColor Cyan
  4. $body1 = @{
  5. id = "sWvRr8RvPT"
  6. _ApplicationId = "ncloudmaster"
  7. action = "register"
  8. taskId = "openclaw-test-001"
  9. storeId = "openclaw"
  10. caseId = "test-case"
  11. caseName = "OpenClaw Test"
  12. } | ConvertTo-Json -Compress
  13. try {
  14. $r1 = Invoke-RestMethod -Uri "https://server.fmode.cn/api/functions" -Method POST -ContentType "application/json" -Body $body1 -TimeoutSec 15
  15. Write-Host "Response:" -ForegroundColor Green
  16. $r1 | ConvertTo-Json -Depth 3
  17. } catch {
  18. Write-Host "Error: $($_.Exception.Message)" -ForegroundColor Red
  19. }
  20. Write-Host ""
  21. # 2. Test list with storeId filter
  22. Write-Host "=== Test list with storeId=openclaw ===" -ForegroundColor Cyan
  23. $body2 = @{
  24. id = "sWvRr8RvPT"
  25. _ApplicationId = "ncloudmaster"
  26. action = "list"
  27. storeId = "openclaw"
  28. page = 1
  29. pageSize = 5
  30. } | ConvertTo-Json -Compress
  31. try {
  32. $r2 = Invoke-RestMethod -Uri "https://server.fmode.cn/api/functions" -Method POST -ContentType "application/json" -Body $body2 -TimeoutSec 15
  33. Write-Host "Response:" -ForegroundColor Green
  34. $r2 | ConvertTo-Json -Depth 3
  35. } catch {
  36. Write-Host "Error: $($_.Exception.Message)" -ForegroundColor Red
  37. }
  38. Write-Host ""
  39. # 3. Test list WITHOUT storeId (should see all videos)
  40. Write-Host "=== Test list without storeId (all videos) ===" -ForegroundColor Cyan
  41. $body3 = @{
  42. id = "sWvRr8RvPT"
  43. _ApplicationId = "ncloudmaster"
  44. action = "list"
  45. page = 1
  46. pageSize = 3
  47. } | ConvertTo-Json -Compress
  48. try {
  49. $r3 = Invoke-RestMethod -Uri "https://server.fmode.cn/api/functions" -Method POST -ContentType "application/json" -Body $body3 -TimeoutSec 15
  50. Write-Host "Total (all): $($r3.total)" -ForegroundColor Green
  51. } catch {
  52. Write-Host "Error: $($_.Exception.Message)" -ForegroundColor Red
  53. }