@cloudbase/js-sdk 2.5.22-beta.0 → 2.5.24-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/dist/index.esm.js +2 -3
- package/app/dist/index.js +4 -5
- package/app/package.json +1 -1
- package/dist/index.cjs.js +7 -7
- package/dist/index.esm.js +1 -1
- package/index.d.ts +9 -9
- package/miniprogram_dist/analytics.js +1 -1
- package/miniprogram_dist/app.js +1 -1
- package/miniprogram_dist/auth.js +1 -1
- package/miniprogram_dist/database.js +2 -17
- package/miniprogram_dist/functions.js +1 -1
- package/miniprogram_dist/index.js +2 -17
- package/miniprogram_dist/oauth.js +1 -1
- package/miniprogram_dist/realtime.js +1 -1
- package/miniprogram_dist/storage.js +1 -1
- package/oauth/dist/index.js +8 -4
- package/package.json +12 -18
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("cloudbase_functions",[],e):"object"==typeof exports?exports.cloudbase_functions=e():t.cloudbase_functions=e()}("undefined"!=typeof window?window:this,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=9)}([function(t,e,n){"use strict";n.r(e),n.d(e,"isArray",(function(){return f})),n.d(e,"isString",(function(){return l})),n.d(e,"isUndefined",(function(){return p})),n.d(e,"isPalinObject",(function(){return d})),n.d(e,"isNull",(function(){return h})),n.d(e,"isInstanceOf",(function(){return y})),n.d(e,"isFormData",(function(){return v})),n.d(e,"genSeqId",(function(){return g})),n.d(e,"formatUrl",(function(){return m})),n.d(e,"createSign",(function(){return w})),n.d(e,"toQueryString",(function(){return O})),n.d(e,"getQuery",(function(){return _})),n.d(e,"getHash",(function(){return S})),n.d(e,"removeParam",(function(){return R})),n.d(e,"createPromiseCallback",(function(){return I})),n.d(e,"execCallback",(function(){return j})),n.d(e,"printWarn",(function(){return A})),n.d(e,"printError",(function(){return E})),n.d(e,"printInfo",(function(){return x})),n.d(e,"throwError",(function(){return N})),n.d(e,"printGroupLog",(function(){return P})),n.d(e,"sleep",(function(){return k})),n.d(e,"transformPhone",(function(){return T}));var r=n(7),o=n.n(r),i=n(8),c=n.n(i),s=n(5),a=n.n(s),u=n(1);function f(t){return"[object Array]"===Object.prototype.toString.call(t)}function l(t){return"string"==typeof t}function p(t){return void 0===t}function d(t){return"[object Object]"===Object.prototype.toString.call(t)}function h(t){return"[object Null]"===Object.prototype.toString.call(t)}function y(t,e){return t instanceof e}function v(t){return"[object FormData]"===Object.prototype.toString.call(t)}function g(){return Math.random().toString(16).slice(2)}function m(t,e,n){void 0===n&&(n={});var r=/\?/.test(e),o="";return Object.keys(n).forEach((function(t){""===o?!r&&(e+="?"):o+="&",o+=t+"="+encodeURIComponent(n[t])})),/^http(s)?:\/\//.test(e+=o)?e:""+t+e}function b(t){var e=c.a.stringify(t);return e=(e=(e=e.replace(/=+$/,"")).replace(/\+/g,"-")).replace(/\//g,"_")}function w(t,e){var n=b(a.a.parse(JSON.stringify({alg:"HS256",typ:"JWT"})))+"."+b(a.a.parse(JSON.stringify(t)));return n+"."+b(o()(n,e))}function O(t){void 0===t&&(t={});var e=[];return Object.keys(t).forEach((function(n){e.push(n+"="+encodeURIComponent(t[n]))})),e.join("&")}function _(t,e){if("undefined"==typeof window)return!1;var n=e||window.location.search,r=new RegExp("(^|&)"+t+"=([^&]*)(&|$)"),o=n.substr(n.indexOf("?")+1).match(r);return null!=o?o[2]:""}var S=function(t){if("undefined"==typeof window)return"";var e=window.location.hash.match(new RegExp("[#?&/]"+t+"=([^&#]*)"));return e?e[1]:""};function R(t,e){var n=e.split("?")[0],r=[],o=-1!==e.indexOf("?")?e.split("?")[1]:"";if(""!==o){for(var i=(r=o.split("&")).length-1;i>=0;i-=1)r[i].split("=")[0]===t&&r.splice(i,1);n=n+"?"+r.join("&")}return n}function I(){var t;if(!Promise){(t=function(){}).promise={};var e=function(){throw new Error('Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.')};return Object.defineProperty(t.promise,"then",{get:e}),Object.defineProperty(t.promise,"catch",{get:e}),t}var n=new Promise((function(e,n){t=function(t,r){return t?n(t):e(r)}}));return t.promise=n,t}function j(t,e,n){if(void 0===n&&(n=null),t&&"function"==typeof t)return t(e,n);if(e)throw e;return n}function A(t,e){console.warn("["+Object(u.getSdkName)()+"]["+t+"]:"+e)}function E(t,e){console.error({code:t,msg:"["+Object(u.getSdkName)()+"]["+t+"]:"+e})}function x(t,e){console.log("["+Object(u.getSdkName)()+"]["+t+"]:"+e)}function N(t,e){throw new Error(JSON.stringify({code:t,msg:"["+Object(u.getSdkName)()+"]["+t+"]:"+e}))}function P(t){var e=t.title,n=t.subtitle,r=void 0===n?"":n,o=t.content,i=void 0===o?[]:o,c=t.printTrace,s=void 0!==c&&c,a=t.collapsed;void 0!==a&&a?console.groupCollapsed(e,r):console.group(e,r);for(var u=0,f=i;u<f.length;u++){var l=f[u],p=l.type,d=l.body;switch(p){case"info":console.log(d);break;case"warn":console.warn(d);break;case"error":console.error(d)}}s&&console.trace("stack trace:"),console.groupEnd()}var k=function(t){return void 0===t&&(t=0),new Promise((function(e){return setTimeout(e,t)}))};function T(t){return"+86"+t}},function(t,e,n){"use strict";n.r(e),n.d(e,"setSdkName",(function(){return r.f})),n.d(e,"getSdkName",(function(){return r.d})),n.d(e,"setProtocol",(function(){return r.e})),n.d(e,"getProtocol",(function(){return r.c})),n.d(e,"IS_DEBUG_MODE",(function(){return r.b})),n.d(e,"COMMUNITY_SITE_URL",(function(){return r.a})),n.d(e,"ERRORS",(function(){return o})),n.d(e,"OATUH_LOGINTYPE",(function(){return i}));var r=n(3),o={INVALID_PARAMS:"INVALID_PARAMS",INVALID_SYNTAX:"INVALID_SYNTAX",INVALID_OPERATION:"INVALID_OPERATION",OPERATION_FAIL:"OPERATION_FAIL",NETWORK_ERROR:"NETWORK_ERROR",UNKOWN_ERROR:"UNKOWN_ERROR"},i="constants"},function(t,e,n){var r;t.exports=(r=r||function(t,e){var n=Object.create||function(){function t(){}return function(e){var n;return t.prototype=e,n=new t,t.prototype=null,n}}(),r={},o=r.lib={},i=o.Base={extend:function(t){var e=n(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},c=o.WordArray=i.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||a).stringify(this)},concat:function(t){var e=this.words,n=t.words,r=this.sigBytes,o=t.sigBytes;if(this.clamp(),r%4)for(var i=0;i<o;i++){var c=n[i>>>2]>>>24-i%4*8&255;e[r+i>>>2]|=c<<24-(r+i)%4*8}else for(i=0;i<o;i+=4)e[r+i>>>2]=n[i>>>2];return this.sigBytes+=o,this},clamp:function(){var e=this.words,n=this.sigBytes;e[n>>>2]&=4294967295<<32-n%4*8,e.length=t.ceil(n/4)},clone:function(){var t=i.clone.call(this);return t.words=this.words.slice(0),t},random:function(e){for(var n,r=[],o=function(e){e=e;var n=987654321,r=4294967295;return function(){var o=((n=36969*(65535&n)+(n>>16)&r)<<16)+(e=18e3*(65535&e)+(e>>16)&r)&r;return o/=4294967296,(o+=.5)*(t.random()>.5?1:-1)}},i=0;i<e;i+=4){var s=o(4294967296*(n||t.random()));n=987654071*s(),r.push(4294967296*s()|0)}return new c.init(r,e)}}),s=r.enc={},a=s.Hex={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],o=0;o<n;o++){var i=e[o>>>2]>>>24-o%4*8&255;r.push((i>>>4).toString(16)),r.push((15&i).toString(16))}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r<e;r+=2)n[r>>>3]|=parseInt(t.substr(r,2),16)<<24-r%8*4;return new c.init(n,e/2)}},u=s.Latin1={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],o=0;o<n;o++){var i=e[o>>>2]>>>24-o%4*8&255;r.push(String.fromCharCode(i))}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r<e;r++)n[r>>>2]|=(255&t.charCodeAt(r))<<24-r%4*8;return new c.init(n,e)}},f=s.Utf8={stringify:function(t){try{return decodeURIComponent(escape(u.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return u.parse(unescape(encodeURIComponent(t)))}},l=o.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=f.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var n=this._data,r=n.words,o=n.sigBytes,i=this.blockSize,s=o/(4*i),a=(s=e?t.ceil(s):t.max((0|s)-this._minBufferSize,0))*i,u=t.min(4*a,o);if(a){for(var f=0;f<a;f+=i)this._doProcessBlock(r,f);var l=r.splice(0,a);n.sigBytes-=u}return new c.init(l,u)},clone:function(){var t=i.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0}),p=(o.Hasher=l.extend({cfg:i.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){l.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(e,n){return new t.init(n).finalize(e)}},_createHmacHelper:function(t){return function(e,n){return new p.HMAC.init(t,n).finalize(e)}}}),r.algo={});return r}(Math),r)},function(t,e,n){"use strict";n.d(e,"f",(function(){return o})),n.d(e,"d",(function(){return i})),n.d(e,"e",(function(){return s})),n.d(e,"c",(function(){return a})),n.d(e,"b",(function(){return u})),n.d(e,"a",(function(){return f}));var r="@cloudbase/js-sdk";function o(t){r=t}function i(){return r}var c="https:";function s(t){c=t}function a(){return c}var u=!1,f="https://support.qq.com/products/148793"},function(t,e,n){"use strict";var r;n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return i})),function(t){t.local="local",t.none="none",t.session="session"}(r||(r={}));var o=function(){},i=function(){}},function(t,e,n){var r;t.exports=(r=n(2),r.enc.Utf8)},function(t,e,n){"use strict";(function(t){var e,r=n(4),o=n(0),i=n(1),c=(e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,n)},function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}),s=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function c(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(c,s)}a((r=r.apply(t,e||[])).next())}))},a=function(t,e){var n,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;c;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return c.label++,{value:i[1],done:!1};case 5:c.label++,r=i[1],i=[0];continue;case 7:i=c.ops.pop(),c.trys.pop();continue;default:if(!(o=c.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){c=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){c.label=i[1];break}if(6===i[0]&&c.label<o[1]){c.label=o[1],o=i;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(i);break}o[2]&&c.ops.pop(),c.trys.pop();continue}i=e.call(t,c)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},u=function(t){function e(e){var n=t.call(this)||this;return n.root=e,e.tcbCacheObject||(e.tcbCacheObject={}),n}return c(e,t),e.prototype.setItem=function(t,e){this.root.tcbCacheObject[t]=e},e.prototype.getItem=function(t){return this.root.tcbCacheObject[t]},e.prototype.removeItem=function(t){delete this.root.tcbCacheObject[t]},e.prototype.clear=function(){delete this.root.tcbCacheObject},e}(r.b);!function(){function e(t){this.keys={};var e=t.persistence,n=t.platformInfo,r=void 0===n?{}:n,c=t.keys,s=void 0===c?{}:c;this.platformInfo=r,this.storage||(this.persistenceTag=this.platformInfo.adapter.primaryStorage||e,this.storage=function(t,e){switch(t){case"local":return e.localStorage?e.localStorage:(Object(o.printWarn)(i.ERRORS.INVALID_PARAMS,"localStorage is not supported on current platform"),new u(e.root));case"none":return new u(e.root);default:return e.localStorage?e.localStorage:(Object(o.printWarn)(i.ERRORS.INVALID_PARAMS,"localStorage is not supported on current platform"),new u(e.root))}}(this.persistenceTag,this.platformInfo.adapter),this.keys=s)}Object.defineProperty(e.prototype,"mode",{get:function(){return this.storage.mode||"sync"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"persistence",{get:function(){return this.persistenceTag},enumerable:!1,configurable:!0}),e.prototype.setStore=function(t,e,n){if("async"!==this.mode){if(this.storage)try{var r={version:n||"localCachev1",content:e};this.storage.setItem(t,JSON.stringify(r))}catch(t){throw new Error(JSON.stringify({code:i.ERRORS.OPERATION_FAIL,msg:"["+Object(i.getSdkName)()+"]["+i.ERRORS.OPERATION_FAIL+"]setStore failed",info:t}))}}else Object(o.printWarn)(i.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use setStoreAsync insteed")},e.prototype.setStoreAsync=function(t,e,n){return s(this,void 0,void 0,(function(){var r;return a(this,(function(o){switch(o.label){case 0:if(!this.storage)return[2];o.label=1;case 1:return o.trys.push([1,3,,4]),r={version:n||"localCachev1",content:e},[4,this.storage.setItem(t,JSON.stringify(r))];case 2:return o.sent(),[3,4];case 3:return o.sent(),[2];case 4:return[2]}}))}))},e.prototype.getStore=function(e,n){var r;if("async"!==this.mode){try{if(void 0!==t&&(null===(r=t.env)||void 0===r?void 0:r.tcb_token))return t.env.tcb_token;if(!this.storage)return""}catch(t){return""}n=n||"localCachev1";var c=this.storage.getItem(e);return c&&c.indexOf(n)>=0?JSON.parse(c).content:""}Object(o.printWarn)(i.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use getStoreAsync insteed")},e.prototype.getStoreAsync=function(e,n){var r;return s(this,void 0,void 0,(function(){var o;return a(this,(function(i){switch(i.label){case 0:try{if(void 0!==t&&(null===(r=t.env)||void 0===r?void 0:r.tcb_token))return[2,t.env.tcb_token];if(!this.storage)return[2,""]}catch(t){return[2,""]}return n=n||"localCachev1",[4,this.storage.getItem(e)];case 1:return(o=i.sent())&&o.indexOf(n)>=0?[2,JSON.parse(o).content]:[2,""]}}))}))},e.prototype.removeStore=function(t){"async"!==this.mode?this.storage.removeItem(t):Object(o.printWarn)(i.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use removeStoreAsync insteed")},e.prototype.removeStoreAsync=function(t){return s(this,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return[4,this.storage.removeItem(t)];case 1:return e.sent(),[2]}}))}))}}()}).call(this,n(12))},function(t,e,n){var r;t.exports=(r=n(2),n(10),n(11),r.HmacSHA256)},function(t,e,n){var r,o,i;t.exports=(i=n(2),o=(r=i).lib.WordArray,r.enc.Base64={stringify:function(t){var e=t.words,n=t.sigBytes,r=this._map;t.clamp();for(var o=[],i=0;i<n;i+=3)for(var c=(e[i>>>2]>>>24-i%4*8&255)<<16|(e[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|e[i+2>>>2]>>>24-(i+2)%4*8&255,s=0;s<4&&i+.75*s<n;s++)o.push(r.charAt(c>>>6*(3-s)&63));var a=r.charAt(64);if(a)for(;o.length%4;)o.push(a);return o.join("")},parse:function(t){var e=t.length,n=this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var i=0;i<n.length;i++)r[n.charCodeAt(i)]=i}var c=n.charAt(64);if(c){var s=t.indexOf(c);-1!==s&&(e=s)}return function(t,e,n){for(var r=[],i=0,c=0;c<e;c++)if(c%4){var s=n[t.charCodeAt(c-1)]<<c%4*2,a=n[t.charCodeAt(c)]>>>6-c%4*2;r[i>>>2]|=(s|a)<<24-i%4*8,i++}return o.create(r,i)}(t,e,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},i.enc.Base64)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.registerFunctions=void 0;var r=n(13);e.registerFunctions=r.registerFunctions},function(t,e,n){var r;t.exports=(r=n(2),function(t){var e=r,n=e.lib,o=n.WordArray,i=n.Hasher,c=e.algo,s=[],a=[];!function(){function e(e){for(var n=t.sqrt(e),r=2;r<=n;r++)if(!(e%r))return!1;return!0}function n(t){return 4294967296*(t-(0|t))|0}for(var r=2,o=0;o<64;)e(r)&&(o<8&&(s[o]=n(t.pow(r,.5))),a[o]=n(t.pow(r,1/3)),o++),r++}();var u=[],f=c.SHA256=i.extend({_doReset:function(){this._hash=new o.init(s.slice(0))},_doProcessBlock:function(t,e){for(var n=this._hash.words,r=n[0],o=n[1],i=n[2],c=n[3],s=n[4],f=n[5],l=n[6],p=n[7],d=0;d<64;d++){if(d<16)u[d]=0|t[e+d];else{var h=u[d-15],y=(h<<25|h>>>7)^(h<<14|h>>>18)^h>>>3,v=u[d-2],g=(v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10;u[d]=y+u[d-7]+g+u[d-16]}var m=r&o^r&i^o&i,b=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),w=p+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&f^~s&l)+a[d]+u[d];p=l,l=f,f=s,s=c+w|0,c=i,i=o,o=r,r=w+(b+m)|0}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+i|0,n[3]=n[3]+c|0,n[4]=n[4]+s|0,n[5]=n[5]+f|0,n[6]=n[6]+l|0,n[7]=n[7]+p|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,o=8*e.sigBytes;return n[o>>>5]|=128<<24-o%32,n[14+(o+64>>>9<<4)]=t.floor(r/4294967296),n[15+(o+64>>>9<<4)]=r,e.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var t=i.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=i._createHelper(f),e.HmacSHA256=i._createHmacHelper(f)}(Math),r.SHA256)},function(t,e,n){var r,o,i,c;t.exports=(r=n(2),i=(o=r).lib.Base,c=o.enc.Utf8,void(o.algo.HMAC=i.extend({init:function(t,e){t=this._hasher=new t.init,"string"==typeof e&&(e=c.parse(e));var n=t.blockSize,r=4*n;e.sigBytes>r&&(e=t.finalize(e)),e.clamp();for(var o=this._oKey=e.clone(),i=this._iKey=e.clone(),s=o.words,a=i.words,u=0;u<n;u++)s[u]^=1549556828,a[u]^=909522486;o.sigBytes=i.sigBytes=r,this.reset()},reset:function(){var t=this._hasher;t.reset(),t.update(this._iKey)},update:function(t){return this._hasher.update(t),this},finalize:function(t){var e=this._hasher,n=e.finalize(t);return e.reset(),e.finalize(this._oKey.clone().concat(n))}})))},function(t,e){var n,r,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function c(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(t){n=i}try{r="function"==typeof clearTimeout?clearTimeout:c}catch(t){r=c}}();var a,u=[],f=!1,l=-1;function p(){f&&a&&(f=!1,a.length?u=a.concat(u):l=-1,u.length&&d())}function d(){if(!f){var t=s(p);f=!0;for(var e=u.length;e;){for(a=u,u=[];++l<e;)a&&a[l].run();l=-1,e=u.length}a=null,f=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===c||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function h(t,e){this.fun=t,this.array=e}function y(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];u.push(new h(t,e)),1!==u.length||f||s(d)},h.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=y,o.addListener=y,o.once=y,o.off=y,o.removeListener=y,o.removeAllListeners=y,o.emit=y,o.prependListener=y,o.prependOnceListener=y,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e,n){"use strict";n.r(e),n.d(e,"registerFunctions",(function(){return B}));var r={};n.r(r),n.d(r,"catchErrorsDecorator",(function(){return S}));var o,i,c=n(1),s=n(4),a=n(0),u=n(3),f=(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(){return(l=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},p=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function c(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(c,s)}a((r=r.apply(t,e||[])).next())}))},d=function(t,e){var n,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;c;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return c.label++,{value:i[1],done:!1};case 5:c.label++,r=i[1],i=[0];continue;case 7:i=c.ops.pop(),c.trys.pop();continue;default:if(!(o=c.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){c=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){c.label=i[1];break}if(6===i[0]&&c.label<o[1]){c.label=o[1],o=i;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(i);break}o[2]&&c.ops.pop(),c.trys.pop();continue}i=e.call(t,c)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};!function(t){function e(e){var n=t.call(this)||this,r=e.timeout,o=e.timeoutMsg,i=e.restrictedMethods;return n.timeout=r||0,n.timeoutMsg=o||"请求超时",n.restrictedMethods=i||["get","post","upload","download"],n}f(e,t),e.prototype.get=function(t){return this.request(l(l({},t),{method:"get"}),this.restrictedMethods.includes("get"))},e.prototype.post=function(t){return this.request(l(l({},t),{method:"post"}),this.restrictedMethods.includes("post"))},e.prototype.put=function(t){return this.request(l(l({},t),{method:"put"}))},e.prototype.upload=function(t){var e=t.data,n=t.file,r=t.name,o=t.method,i=t.headers,c=void 0===i?{}:i,s={post:"post",put:"put"}[null==o?void 0:o.toLowerCase()]||"put",a=new FormData;return"post"===s?(Object.keys(e).forEach((function(t){a.append(t,e[t])})),a.append("key",r),a.append("file",n),this.request(l(l({},t),{data:a,method:s}),this.restrictedMethods.includes("upload"))):this.request(l(l({},t),{method:"put",headers:c,body:n}),this.restrictedMethods.includes("upload"))},e.prototype.download=function(t){return p(this,void 0,void 0,(function(){var e,n,r,o;return d(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.get(l(l({},t),{headers:{},responseType:"blob"}))];case 1:return e=i.sent().data,n=window.URL.createObjectURL(new Blob([e])),r=decodeURIComponent(new URL(t.url).pathname.split("/").pop()||""),(o=document.createElement("a")).href=n,o.setAttribute("download",r),o.style.display="none",document.body.appendChild(o),o.click(),window.URL.revokeObjectURL(n),document.body.removeChild(o),[3,3];case 2:return i.sent(),[3,3];case 3:return[2,new Promise((function(e){e({statusCode:200,tempFilePath:t.url})}))]}}))}))},e.prototype.request=function(t,e){var n=this;void 0===e&&(e=!1);var r=String(t.method).toLowerCase()||"get";return new Promise((function(o){var i,c,s=t.url,f=t.headers,l=void 0===f?{}:f,p=t.data,d=t.responseType,h=t.withCredentials,y=t.body,v=t.onUploadProgress,g=Object(a.formatUrl)(Object(u.c)(),s,"get"===r?p:{}),m=new XMLHttpRequest;m.open(r,g),d&&(m.responseType=d),Object.keys(l).forEach((function(t){m.setRequestHeader(t,l[t])})),v&&m.upload.addEventListener("progress",v),m.onreadystatechange=function(){var t={};if(4===m.readyState){var e=m.getAllResponseHeaders().trim().split(/[\r\n]+/),n={};e.forEach((function(t){var e=t.split(": "),r=e.shift().toLowerCase(),o=e.join(": ");n[r]=o})),t.header=n,t.statusCode=m.status;try{t.data="blob"===d?m.response:JSON.parse(m.responseText)}catch(e){t.data="blob"===d?m.response:m.responseText}clearTimeout(i),o(t)}},e&&n.timeout&&(i=setTimeout((function(){console.warn(n.timeoutMsg),m.abort()}),n.timeout)),c=Object(a.isFormData)(p)?p:"application/x-www-form-urlencoded"===l["content-type"]?Object(a.toQueryString)(p):y||(p?JSON.stringify(p):void 0),h&&(m.withCredentials=!0),m.send(c)}))}}(s.a);!function(t){t.WEB="web",t.WX_MP="wx_mp"}(i||(i={}));n(6);var h=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),y=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],c=0,s=i.length;c<s;c++,o++)r[o]=i[c];return r};var v=function(t,e){this.data=e||null,this.name=t},g=function(t){function e(e,n){var r=t.call(this,"error",{error:e,data:n})||this;return r.error=e,r}return h(e,t),e}(v);new(function(){function t(){this.listeners={}}return t.prototype.on=function(t,e){return function(t,e,n){n[t]=n[t]||[],n[t].push(e)}(t,e,this.listeners),this},t.prototype.off=function(t,e){return function(t,e,n){if(null==n?void 0:n[t]){var r=n[t].indexOf(e);-1!==r&&n[t].splice(r,1)}}(t,e,this.listeners),this},t.prototype.fire=function(t,e){if(Object(a.isInstanceOf)(t,g))return console.error(t.error),this;var n=Object(a.isString)(t)?new v(t,e||{}):t,r=n.name;if(this.listens(r)){n.target=this;for(var o=0,i=this.listeners[r]?y(this.listeners[r]):[];o<i.length;o++){i[o].call(this,n)}}return this},t.prototype.listens=function(t){return this.listeners[t]&&this.listeners[t].length>0},t}());var m=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function c(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(c,s)}a((r=r.apply(t,e||[])).next())}))},b=function(t,e){var n,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;c;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return c.label++,{value:i[1],done:!1};case 5:c.label++,r=i[1],i=[0];continue;case 7:i=c.ops.pop(),c.trys.pop();continue;default:if(!(o=c.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){c=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){c.label=i[1];break}if(6===i[0]&&c.label<o[1]){c.label=o[1],o=i;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(i);break}o[2]&&c.ops.pop(),c.trys.pop();continue}i=e.call(t,c)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},w=!1;"undefined"!=typeof navigator&&navigator.userAgent&&(w=-1!==navigator.userAgent.indexOf("Firefox"));var O=w?/(\.js\/)?__decorate(\$\d+)?<@.*\d$/:/(\/\w+\.js\.)?__decorate(\$\d+)?\s*\(.*\)$/,_=/https?:\/\/.+:\d*\/.*\.js:\d+:\d+/;function S(t){var e=t.mode,n=void 0===e?"async":e,r=t.customInfo,o=void 0===r?{}:r,i=t.title,s=t.messages,u=void 0===s?[]:s;return function(t,e,r){if(c.IS_DEBUG_MODE){var s=o.className||t.constructor.name,f=o.methodName||e,l=r.value,p=function(t){var e="",n=t.stack.split("\n"),r=n.findIndex((function(t){return O.test(t)}));if(-1!==r){var o=_.exec(n[r+1]||"");e=o?o[0]:""}return e}(new Error);r.value="sync"===n?function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=R({err:new Error,className:s,methodName:f,sourceLink:p});try{return l.apply(this,t)}catch(t){var r=t,o=t.message,c=t.error,d=t.error_description,h={title:i||s+"."+f+" failed",content:[{type:"error",body:t}]};if(o&&/^\{.*\}$/.test(o)){var y=JSON.parse(o);h.subtitle=o,y.code&&(n?(n.code=y.code,n.msg=y.msg):(t.code=y.code,t.message=y.msg),r=n||t,h.content=u.map((function(t){return{type:"info",body:t}})))}throw c&&d&&(h.subtitle=d,n?(n.code=c,n.msg=d):(t.code=c,t.message=d),r=n||t,h.content=u.map((function(t){return{type:"info",body:t}}))),Object(a.printGroupLog)(h),r}}:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return m(this,void 0,void 0,(function(){var e,n,r,o,c,d,h,y;return b(this,(function(v){switch(v.label){case 0:e=R({err:new Error,className:s,methodName:f,sourceLink:p}),v.label=1;case 1:return v.trys.push([1,3,,4]),[4,l.apply(this,t)];case 2:return[2,v.sent()];case 3:throw n=v.sent(),r=n,o=n.message,c=n.error,d=n.error_description,h={title:i||s+"."+f+" failed",content:[{type:"error",body:n}]},o&&/^\{.*\}$/.test(o)&&(y=JSON.parse(o),h.subtitle=y,y.code&&(e?(e.code=y.code,e.message=y.msg):(n.code=y.code,n.message=y.msg),r=e||n,h.content=u.map((function(t){return{type:"info",body:t}})))),c&&d&&(h.subtitle=d,e?(e.code=c,e.msg=d):(n.code=c,n.message=d),r=e||n,h.content=u.map((function(t){return{type:"info",body:t}}))),Object(a.printGroupLog)(h),r;case 4:return[2]}}))}))}}}}function R(t){var e=t.err,n=t.className,r=t.methodName,o=t.sourceLink;if(!o)return null;var i,c=e.stack.split("\n"),s=w?/^catchErrorsDecorator\/<\/descriptor.value@.*\d$/:new RegExp(n+"\\.descriptor.value\\s*\\[as\\s"+r+"\\]\\s*\\(.*\\)$"),a=w?/^catchErrorsDecorator\/<\/descriptor.value/:new RegExp(n+"\\.descriptor.value\\s*\\[as\\s"+r+"\\]"),u=c.findIndex((function(t){return s.test(t)}));if(-1!==u){var f=c.filter((function(t,e){return e>u}));f.unshift(c[u].replace(a,n+"."+r).replace(_,o)),(i=new Error).stack=(w?"@debugger":"Error")+"\n"+f.join("\n")}return i}function I(t){this.message=t}I.prototype=new Error,I.prototype.name="InvalidCharacterError";"undefined"!=typeof window&&window.atob&&window.atob.bind(window);function j(t){this.message=t}j.prototype=new Error,j.prototype.name="InvalidTokenError";var A=function(t,e,n,r){var o,i=arguments.length,c=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(c=(i<3?o(c):i>3?o(e,n,c):o(e,n))||c);return i>3&&c&&Object.defineProperty(e,n,c),c},E=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},x=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function c(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(c,s)}a((r=r.apply(t,e||[])).next())}))},N=function(t,e){var n,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;c;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return c.label++,{value:i[1],done:!1};case 5:c.label++,r=i[1],i=[0];continue;case 7:i=c.ops.pop(),c.trys.pop();continue;default:if(!(o=c.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){c=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){c.label=i[1];break}if(6===i[0]&&c.label<o[1]){c.label=o[1],o=i;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(i);break}o[2]&&c.ops.pop(),c.trys.pop();continue}i=e.call(t,c)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},P=c.getSdkName,k=c.ERRORS,T=c.COMMUNITY_SITE_URL,L=a.execCallback,C=r.catchErrorsDecorator,M={name:"functions",entity:{callFunction:(new(function(){function t(){}return t.prototype.callFunction=function(t,e){return x(this,void 0,void 0,(function(){var n,r,o,i,c,s,a,u,f,l,p,d;return N(this,(function(h){switch(h.label){case 0:if(n=t.name,r=t.data,o=t.query,i=t.parse,c=t.search,!n)throw new Error(JSON.stringify({code:k.INVALID_PARAMS,msg:"[functions.callFunction] invalid function name"}));try{s=r?JSON.stringify(r):""}catch(t){throw new Error(JSON.stringify({code:k.INVALID_PARAMS,msg:"[functions.callFunction] invalid data"}))}a="functions.invokeFunction",u={inQuery:o,parse:i,search:c,function_name:n,request_data:s},f=this.request,h.label=1;case 1:return h.trys.push([1,3,,4]),[4,f.send(a,u)];case 2:if((l=h.sent()).code)return[2,L(e,null,l)];if(p=l.data.response_data,i)return[2,L(e,null,{result:p,requestId:l.requestId})];try{return p=JSON.parse(l.data.response_data),[2,L(e,null,{result:p,requestId:l.requestId})]}catch(t){L(e,new Error("["+P()+"]["+k.INVALID_PARAMS+"][functions.callFunction] response data must be json"))}return[3,4];case 3:return d=h.sent(),L(e,d),[3,4];case 4:return[2]}}))}))},A([C({customInfo:{className:"Cloudbase",methodName:"callFunction"},title:"函数调用失败",messages:["请确认以下各项:"," 1 - 调用 callFunction() 的语法或参数是否正确"," 2 - 当前环境下是否存在此函数"," 3 - 函数安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:"+T]}),E("design:type",Function),E("design:paramtypes",[Object,Function]),E("design:returntype",Promise)],t.prototype,"callFunction",null),t}())).callFunction}};try{cloudbase.registerComponent(M)}catch(I){}function B(t){try{t.registerComponent(M)}catch(t){console.warn(t)}}}])}));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("cloudbase_functions",[],e):"object"==typeof exports?exports.cloudbase_functions=e():t.cloudbase_functions=e()}("undefined"!=typeof window?window:this,(()=>(()=>{var t={298:function(t,e,n){var r;t.exports=(r=r||function(t,e){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&void 0!==n.g&&n.g.crypto&&(r=n.g.crypto),!r)try{r=n(633)}catch(t){}var o=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(t){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(t){}}throw new Error("Native crypto module could not be used to get secure random number.")},i=Object.create||function(){function t(){}return function(e){var n;return t.prototype=e,n=new t,t.prototype=null,n}}(),s={},a=s.lib={},c=a.Base={extend:function(t){var e=i(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},u=a.WordArray=c.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||l).stringify(this)},concat:function(t){var e=this.words,n=t.words,r=this.sigBytes,o=t.sigBytes;if(this.clamp(),r%4)for(var i=0;i<o;i++){var s=n[i>>>2]>>>24-i%4*8&255;e[r+i>>>2]|=s<<24-(r+i)%4*8}else for(var a=0;a<o;a+=4)e[r+a>>>2]=n[a>>>2];return this.sigBytes+=o,this},clamp:function(){var e=this.words,n=this.sigBytes;e[n>>>2]&=4294967295<<32-n%4*8,e.length=t.ceil(n/4)},clone:function(){var t=c.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],n=0;n<t;n+=4)e.push(o());return new u.init(e,t)}}),f=s.enc={},l=f.Hex={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],o=0;o<n;o++){var i=e[o>>>2]>>>24-o%4*8&255;r.push((i>>>4).toString(16)),r.push((15&i).toString(16))}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r<e;r+=2)n[r>>>3]|=parseInt(t.substr(r,2),16)<<24-r%8*4;return new u.init(n,e/2)}},p=f.Latin1={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],o=0;o<n;o++){var i=e[o>>>2]>>>24-o%4*8&255;r.push(String.fromCharCode(i))}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r<e;r++)n[r>>>2]|=(255&t.charCodeAt(r))<<24-r%4*8;return new u.init(n,e)}},h=f.Utf8={stringify:function(t){try{return decodeURIComponent(escape(p.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return p.parse(unescape(encodeURIComponent(t)))}},d=a.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=h.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var n,r=this._data,o=r.words,i=r.sigBytes,s=this.blockSize,a=i/(4*s),c=(a=e?t.ceil(a):t.max((0|a)-this._minBufferSize,0))*s,f=t.min(4*c,i);if(c){for(var l=0;l<c;l+=s)this._doProcessBlock(o,l);n=o.splice(0,c),r.sigBytes-=f}return new u.init(n,f)},clone:function(){var t=c.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0}),y=(a.Hasher=d.extend({cfg:c.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){d.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(e,n){return new t.init(n).finalize(e)}},_createHmacHelper:function(t){return function(e,n){return new y.HMAC.init(t,n).finalize(e)}}}),s.algo={});return s}(Math),r)},879:function(t,e,n){var r,o,i;t.exports=(r=n(298),i=(o=r).lib.WordArray,o.enc.Base64={stringify:function(t){var e=t.words,n=t.sigBytes,r=this._map;t.clamp();for(var o=[],i=0;i<n;i+=3)for(var s=(e[i>>>2]>>>24-i%4*8&255)<<16|(e[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|e[i+2>>>2]>>>24-(i+2)%4*8&255,a=0;a<4&&i+.75*a<n;a++)o.push(r.charAt(s>>>6*(3-a)&63));var c=r.charAt(64);if(c)for(;o.length%4;)o.push(c);return o.join("")},parse:function(t){var e=t.length,n=this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var o=0;o<n.length;o++)r[n.charCodeAt(o)]=o}var s=n.charAt(64);if(s){var a=t.indexOf(s);-1!==a&&(e=a)}return function(t,e,n){for(var r=[],o=0,s=0;s<e;s++)if(s%4){var a=n[t.charCodeAt(s-1)]<<s%4*2|n[t.charCodeAt(s)]>>>6-s%4*2;r[o>>>2]|=a<<24-o%4*8,o++}return i.create(r,o)}(t,e,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},r.enc.Base64)},939:function(t,e,n){t.exports=n(298).enc.Utf8},171:function(t,e,n){var r;t.exports=(r=n(298),n(624),n(775),r.HmacSHA256)},775:function(t,e,n){var r,o,i;t.exports=(o=(r=n(298)).lib.Base,i=r.enc.Utf8,void(r.algo.HMAC=o.extend({init:function(t,e){t=this._hasher=new t.init,"string"==typeof e&&(e=i.parse(e));var n=t.blockSize,r=4*n;e.sigBytes>r&&(e=t.finalize(e)),e.clamp();for(var o=this._oKey=e.clone(),s=this._iKey=e.clone(),a=o.words,c=s.words,u=0;u<n;u++)a[u]^=1549556828,c[u]^=909522486;o.sigBytes=s.sigBytes=r,this.reset()},reset:function(){var t=this._hasher;t.reset(),t.update(this._iKey)},update:function(t){return this._hasher.update(t),this},finalize:function(t){var e=this._hasher,n=e.finalize(t);return e.reset(),e.finalize(this._oKey.clone().concat(n))}})))},624:function(t,e,n){var r;t.exports=(r=n(298),function(t){var e=r,n=e.lib,o=n.WordArray,i=n.Hasher,s=e.algo,a=[],c=[];!function(){function e(e){for(var n=t.sqrt(e),r=2;r<=n;r++)if(!(e%r))return!1;return!0}function n(t){return 4294967296*(t-(0|t))|0}for(var r=2,o=0;o<64;)e(r)&&(o<8&&(a[o]=n(t.pow(r,.5))),c[o]=n(t.pow(r,1/3)),o++),r++}();var u=[],f=s.SHA256=i.extend({_doReset:function(){this._hash=new o.init(a.slice(0))},_doProcessBlock:function(t,e){for(var n=this._hash.words,r=n[0],o=n[1],i=n[2],s=n[3],a=n[4],f=n[5],l=n[6],p=n[7],h=0;h<64;h++){if(h<16)u[h]=0|t[e+h];else{var d=u[h-15],y=(d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3,v=u[h-2],g=(v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10;u[h]=y+u[h-7]+g+u[h-16]}var w=r&o^r&i^o&i,b=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),m=p+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&f^~a&l)+c[h]+u[h];p=l,l=f,f=a,a=s+m|0,s=i,i=o,o=r,r=m+(b+w)|0}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+i|0,n[3]=n[3]+s|0,n[4]=n[4]+a|0,n[5]=n[5]+f|0,n[6]=n[6]+l|0,n[7]=n[7]+p|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,o=8*e.sigBytes;return n[o>>>5]|=128<<24-o%32,n[14+(o+64>>>9<<4)]=t.floor(r/4294967296),n[15+(o+64>>>9<<4)]=r,e.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var t=i.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=i._createHelper(f),e.HmacSHA256=i._createHmacHelper(f)}(Math),r.SHA256)},652:(t,e,n)=>{"use strict";n.r(e),n.d(e,{registerFunctions:()=>P});var r="@cloudbase/js-sdk";function o(){return r}var i,s={INVALID_PARAMS:"INVALID_PARAMS",INVALID_SYNTAX:"INVALID_SYNTAX",INVALID_OPERATION:"INVALID_OPERATION",OPERATION_FAIL:"OPERATION_FAIL",NETWORK_ERROR:"NETWORK_ERROR",UNKOWN_ERROR:"UNKOWN_ERROR"};!function(t){t.local="local",t.none="none",t.session="session"}(i||(i={}));function a(t,e){console.warn("[".concat(o(),"][").concat(t,"]:").concat(e))}n(171),n(879),n(939);var c,u,f=(c=function(t,e){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},c(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}c(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(){return l=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},l.apply(this,arguments)};!function(t){function e(e){var n=t.call(this)||this,r=e.timeout,o=e.timeoutMsg,i=e.restrictedMethods;return n.timeout=r||0,n.timeoutMsg=o||"请求超时",n.restrictedMethods=i||["get","post","upload","download"],n}f(e,t),e.prototype.get=function(t){return this.request(l(l({},t),{method:"get"}),this.restrictedMethods.includes("get"))},e.prototype.post=function(t){return this.request(l(l({},t),{method:"post"}),this.restrictedMethods.includes("post"))},e.prototype.put=function(t){return this.request(l(l({},t),{method:"put"}))},e.prototype.upload=function(t){var e=t.data,n=t.file,r=t.name,o=t.method,i=t.headers,s=void 0===i?{}:i,a={post:"post",put:"put"}[null==o?void 0:o.toLowerCase()]||"put",c=new FormData;return"post"===a?(Object.keys(e).forEach((function(t){c.append(t,e[t])})),c.append("key",r),c.append("file",n),this.request(l(l({},t),{data:c,method:a}),this.restrictedMethods.includes("upload"))):this.request(l(l({},t),{method:"put",headers:s,body:n}),this.restrictedMethods.includes("upload"))},e.prototype.download=function(t){return e=this,n=void 0,o=function(){var e,n,r,o;return function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.get(l(l({},t),{headers:{},responseType:"blob"}))];case 1:return e=i.sent().data,n=window.URL.createObjectURL(new Blob([e])),r=decodeURIComponent(new URL(t.url).pathname.split("/").pop()||""),(o=document.createElement("a")).href=n,o.setAttribute("download",r),o.style.display="none",document.body.appendChild(o),o.click(),window.URL.revokeObjectURL(n),document.body.removeChild(o),[3,3];case 2:return i.sent(),[3,3];case 3:return[2,new Promise((function(e){e({statusCode:200,tempFilePath:t.url})}))]}}))},new((r=void 0)||(r=Promise))((function(t,i){function s(t){try{c(o.next(t))}catch(t){i(t)}}function a(t){try{c(o.throw(t))}catch(t){i(t)}}function c(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(s,a)}c((o=o.apply(e,n||[])).next())}));var e,n,r,o},e.prototype.request=function(t,e){var n=this;void 0===e&&(e=!1);var r=String(t.method).toLowerCase()||"get";return new Promise((function(o){var i,s,a,c=t.url,u=t.headers,f=void 0===u?{}:u,l=t.data,p=t.responseType,h=t.withCredentials,d=t.body,y=t.onUploadProgress,v=function(t,e,n){void 0===n&&(n={});var r=/\?/.test(e),o="";return Object.keys(n).forEach((function(t){""===o?!r&&(e+="?"):o+="&",o+="".concat(t,"=").concat(encodeURIComponent(n[t]))})),/^http(s)?:\/\//.test(e+=o)?e:"".concat(t).concat(e)}("https:",c,"get"===r?l:{}),g=new XMLHttpRequest;g.open(r,v),p&&(g.responseType=p),Object.keys(f).forEach((function(t){g.setRequestHeader(t,f[t])})),y&&g.upload.addEventListener("progress",y),g.onreadystatechange=function(){var t={};if(4===g.readyState){var e=g.getAllResponseHeaders().trim().split(/[\r\n]+/),n={};e.forEach((function(t){var e=t.split(": "),r=e.shift().toLowerCase(),o=e.join(": ");n[r]=o})),t.header=n,t.statusCode=g.status;try{t.data="blob"===p?g.response:JSON.parse(g.responseText)}catch(e){t.data="blob"===p?g.response:g.responseText}clearTimeout(i),o(t)}},e&&n.timeout&&(i=setTimeout((function(){console.warn(n.timeoutMsg),g.abort()}),n.timeout)),a=l,s="[object FormData]"===Object.prototype.toString.call(a)?l:"application/x-www-form-urlencoded"===f["content-type"]?function(t){void 0===t&&(t={});var e=[];return Object.keys(t).forEach((function(n){e.push("".concat(n,"=").concat(encodeURIComponent(t[n])))})),e.join("&")}(l):d||(l?JSON.stringify(l):void 0),h&&(g.withCredentials=!0),g.send(s)}))}}((function(){})),function(t){t.WEB="web",t.WX_MP="wx_mp"}(u||(u={}));var p=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),h=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))},d=function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},y=function(t){function e(e){var n=t.call(this)||this;return n.root=e,e.tcbCacheObject||(e.tcbCacheObject={}),n}return p(e,t),e.prototype.setItem=function(t,e){this.root.tcbCacheObject[t]=e},e.prototype.getItem=function(t){return this.root.tcbCacheObject[t]},e.prototype.removeItem=function(t){delete this.root.tcbCacheObject[t]},e.prototype.clear=function(){delete this.root.tcbCacheObject},e}((function(){}));!function(){function t(t){this.keys={};var e=t.persistence,n=t.platformInfo,r=void 0===n?{}:n,o=t.keys,i=void 0===o?{}:o;this.platformInfo=r,this.storage||(this.persistenceTag=this.platformInfo.adapter.primaryStorage||e,this.storage=function(t,e){switch(t){case"local":default:return e.localStorage?e.localStorage:(a(s.INVALID_PARAMS,"localStorage is not supported on current platform"),new y(e.root));case"none":return new y(e.root)}}(this.persistenceTag,this.platformInfo.adapter),this.keys=i)}Object.defineProperty(t.prototype,"mode",{get:function(){return this.storage.mode||"sync"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"persistence",{get:function(){return this.persistenceTag},enumerable:!1,configurable:!0}),t.prototype.setStore=function(t,e,n){if("async"!==this.mode){if(this.storage)try{var r={version:n||"localCachev1",content:e};this.storage.setItem(t,JSON.stringify(r))}catch(t){throw new Error(JSON.stringify({code:s.OPERATION_FAIL,msg:"[".concat(o(),"][").concat(s.OPERATION_FAIL,"]setStore failed"),info:t}))}}else a(s.INVALID_OPERATION,"current platform's storage is asynchronous, please use setStoreAsync insteed")},t.prototype.setStoreAsync=function(t,e,n){return h(this,void 0,void 0,(function(){var r;return d(this,(function(o){switch(o.label){case 0:if(!this.storage)return[2];o.label=1;case 1:return o.trys.push([1,3,,4]),r={version:n||"localCachev1",content:e},[4,this.storage.setItem(t,JSON.stringify(r))];case 2:return o.sent(),[3,4];case 3:return o.sent(),[2];case 4:return[2]}}))}))},t.prototype.getStore=function(t,e){var n;if("async"!==this.mode){try{if("undefined"!=typeof process&&(null===(n=process.env)||void 0===n?void 0:n.tcb_token))return process.env.tcb_token;if(!this.storage)return""}catch(t){return""}e=e||"localCachev1";var r=this.storage.getItem(t);return r&&r.indexOf(e)>=0?JSON.parse(r).content:""}a(s.INVALID_OPERATION,"current platform's storage is asynchronous, please use getStoreAsync insteed")},t.prototype.getStoreAsync=function(t,e){var n;return h(this,void 0,void 0,(function(){var r;return d(this,(function(o){switch(o.label){case 0:try{if("undefined"!=typeof process&&(null===(n=process.env)||void 0===n?void 0:n.tcb_token))return[2,process.env.tcb_token];if(!this.storage)return[2,""]}catch(t){return[2,""]}return e=e||"localCachev1",[4,this.storage.getItem(t)];case 1:return(r=o.sent())&&r.indexOf(e)>=0?[2,JSON.parse(r).content]:[2,""]}}))}))},t.prototype.removeStore=function(t){"async"!==this.mode?this.storage.removeItem(t):a(s.INVALID_OPERATION,"current platform's storage is asynchronous, please use removeStoreAsync insteed")},t.prototype.removeStoreAsync=function(t){return h(this,void 0,void 0,(function(){return d(this,(function(e){switch(e.label){case 0:return[4,this.storage.removeItem(t)];case 1:return e.sent(),[2]}}))}))}}();var v=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),g=function(t,e){this.data=e||null,this.name=t},w=function(t){function e(e,n){var r=t.call(this,"error",{error:e,data:n})||this;return r.error=e,r}return v(e,t),e}(g);new(function(){function t(){this.listeners={}}return t.prototype.on=function(t,e){return function(t,e,n){n[t]=n[t]||[],n[t].push(e)}(t,e,this.listeners),this},t.prototype.off=function(t,e){return function(t,e,n){if(null==n?void 0:n[t]){var r=n[t].indexOf(e);-1!==r&&n[t].splice(r,1)}}(t,e,this.listeners),this},t.prototype.fire=function(t,e){if(t instanceof w)return console.error(t.error),this;var n="string"==typeof t?new g(t,e||{}):t,r=n.name;if(this.listens(r)){n.target=this;for(var o=0,i=this.listeners[r]?function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([],this.listeners[r],!0):[];o<i.length;o++)i[o].call(this,n)}return this},t.prototype.listens=function(t){return this.listeners[t]&&this.listeners[t].length>0},t}());"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.indexOf("Firefox");function b(t){this.message=t}function m(t){this.message=t}b.prototype=new Error,b.prototype.name="InvalidCharacterError","undefined"!=typeof window&&window.atob&&window.atob.bind(window),m.prototype=new Error,m.prototype.name="InvalidTokenError";var _=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},O=o,A=s,I=function(t,e,n){if(void 0===n&&(n=null),t&&"function"==typeof t)return t(e,n);if(e)throw e;return n},S=function(t){t.mode,t.customInfo,t.title,t.messages;return function(t,e,n){}},x="functions",R=new(function(){function t(){}return t.prototype.callFunction=function(t,e){return n=this,r=void 0,i=function(){var n,r,o,i,s,a,c,u,f,l,p,h;return function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}(this,(function(d){switch(d.label){case 0:if(n=t.name,r=t.data,o=t.query,i=t.parse,s=t.search,!n)throw new Error(JSON.stringify({code:A.INVALID_PARAMS,msg:"[".concat(x,".callFunction] invalid function name")}));try{a=r?JSON.stringify(r):""}catch(t){throw new Error(JSON.stringify({code:A.INVALID_PARAMS,msg:"[".concat(x,".callFunction] invalid data")}))}c="functions.invokeFunction",u={inQuery:o,parse:i,search:s,function_name:n,request_data:a},f=this.request,d.label=1;case 1:return d.trys.push([1,3,,4]),[4,f.send(c,u)];case 2:if((l=d.sent()).code)return[2,I(e,null,l)];if(p=l.data.response_data,i)return[2,I(e,null,{result:p,requestId:l.requestId})];try{return p=JSON.parse(l.data.response_data),[2,I(e,null,{result:p,requestId:l.requestId})]}catch(t){I(e,new Error("[".concat(O(),"][").concat(A.INVALID_PARAMS,"][").concat(x,".callFunction] response data must be json")))}return[3,4];case 3:return h=d.sent(),I(e,h),[3,4];case 4:return[2]}}))},new((o=void 0)||(o=Promise))((function(t,e){function s(t){try{c(i.next(t))}catch(t){e(t)}}function a(t){try{c(i.throw(t))}catch(t){e(t)}}function c(e){var n;e.done?t(e.value):(n=e.value,n instanceof o?n:new o((function(t){t(n)}))).then(s,a)}c((i=i.apply(n,r||[])).next())}));var n,r,o,i},function(t,e,n,r){var o,i=arguments.length,s=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,n,s):o(e,n))||s);i>3&&s&&Object.defineProperty(e,n,s)}([S({customInfo:{className:"Cloudbase",methodName:"callFunction"},title:"函数调用失败",messages:["请确认以下各项:"," 1 - 调用 callFunction() 的语法或参数是否正确"," 2 - 当前环境下是否存在此函数"," 3 - 函数安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat("https://support.qq.com/products/148793")]}),_("design:type",Function),_("design:paramtypes",[Object,Function]),_("design:returntype",Promise)],t.prototype,"callFunction",null),t}()),j={name:x,entity:{callFunction:R.callFunction}};try{cloudbase.registerComponent(j)}catch(b){}function P(t){try{t.registerComponent(j)}catch(t){console.warn(t)}}},633:()=>{}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={exports:{}};return t[r].call(i.exports,i,i.exports,n),i.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";var t=r;Object.defineProperty(t,"__esModule",{value:!0}),t.registerFunctions=void 0;var e=n(652);t.registerFunctions=e.registerFunctions})(),r})()));
|