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
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
}