Invite decision
Creates a function that tries to deserialize a string into a trusted invitation or else into an untrusted invitation so it can be redirected to the appropriate function (redeem invite if true or open_invite if false). Alternatively, the string can fail to match either of these cases in which case, an error is returned.