A complete solution of the Bianchi identities in superspace with supergravity constraints