"use strict";var __rest=this&&this.__rest||function(o,n){var e={};for(var t in o)if(Object.prototype.hasOwnProperty.call(o,t)&&n.indexOf(t)<0)e[t]=o[t];if(o!=null&&typeof Object.getOwnPropertySymbols==="function")for(var r=0,t=Object.getOwnPropertySymbols(o);r<t.length;r++){if(n.indexOf(t[r])<0&&Object.prototype.propertyIsEnumerable.call(o,t[r]))e[t[r]]=o[t[r]]}return e};Object.defineProperty(exports,"__esModule",{value:true});exports.ResponseUtil=exports.wrapCallback=void 0;var error_1=require("./error");var wrapCallback=function(o,n){if(n===void 0){n=void 0}return function(e){if((e===null||e===void 0?void 0:e.complete)||(e===null||e===void 0?void 0:e.success)||(e===null||e===void 0?void 0:e.fail)){var t=e.complete,r=e.success,i=e.fail,u=__rest(e,["complete","success","fail"]);o.call(n,u).then(function(l){r===null||r===void 0?void 0:r(l);return l},function(l){i===null||i===void 0?void 0:i(l);return l}).then(function(l){t===null||t===void 0?void 0:t(l)});return}return o.call(n,e)}};exports.wrapCallback=wrapCallback;var ResponseUtil=function(){function o(){}o.handleResponse=function(n){if(n.status!==200){var e=n.data||{code:-1,message:"\u672A\u77E5\u5F02\u5E38"},t=e.code,r=e.message;throw error_1.FaasError.SERVER_ERR(t,r,n.requestID,n.status)}return n.data.data};return o}();exports.ResponseUtil=ResponseUtil;