bin: parse jmap-inspect methodResponses wrapper
JMAP responses wrap method responses in a Response object
(RFC 8620 3.4); the bare-array assumption broke the mailbox dump.

Assisted-by: GLM-5.3 via pi
change vksrxnykmnmyxyqylmnxtlyouutysotn
commit 529e700402a917ac84a277c7f49b0e7ce4e3ee20
author Alpha Chen <alpha@kejadlen.dev>
date
parent xrtoqotp
diff --git a/bin/jmap-inspect b/bin/jmap-inspect
index 81dad19..48d5fb2 100755
--- a/bin/jmap-inspect
+++ b/bin/jmap-inspect
@@ -79,8 +79,8 @@ main() {
                     ]]
                 }')" \
                 "$api_url" |
-                jq 'if type == "array"
-                    then .[0][1].list | map({name, role, myRights})
+                jq 'if type == "object" and has("methodResponses")
+                    then .methodResponses[0][1].list | map({name, role, myRights})
                     else . end'
         done
 }