var c=function(o,e){var t={};for(var n in o)if(Object.prototype.hasOwnProperty.call(o,n)&&e.indexOf(n)<0)t[n]=o[n];if(o!=null&&typeof Object.getOwnPropertySymbols==="function")for(var l=0,n=Object.getOwnPropertySymbols(o);l<n.length;l++){if(e.indexOf(n[l])<0&&Object.prototype.propertyIsEnumerable.call(o,n[l]))t[n[l]]=o[n[l]]}return t};import{FaasError as d}from"./error";export var wrapCallback=function(o,e){if(e===void 0){e=void 0}return function(t){if((t===null||t===void 0?void 0:t.complete)||(t===null||t===void 0?void 0:t.success)||(t===null||t===void 0?void 0:t.fail)){var n=t.complete,l=t.success,u=t.fail,r=c(t,["complete","success","fail"]);o.call(e,r).then(function(i){l===null||l===void 0?void 0:l(i);return i},function(i){u===null||u===void 0?void 0:u(i);return i}).then(function(i){n===null||n===void 0?void 0:n(i)});return}return o.call(e,t)}};var f=function(){function o(){}o.handleResponse=function(e){if(e.status!==200){var t=e.data||{code:-1,message:"\u672A\u77E5\u5F02\u5E38"},n=t.code,l=t.message;throw d.SERVER_ERR(n,l,e.requestID,e.status)}return e.data.data};return o}();export{f as ResponseUtil};