@cloudbase/js-sdk 2.28.8 → 2.29.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/CHANGELOG.md +147 -0
- package/ai/dist/index.esm.js +2 -3
- package/ai/dist/index.esm.js.map +1 -0
- package/ai/dist/index.js +2 -21
- package/ai/dist/index.js.map +1 -0
- package/apis/dist/index.esm.js +2 -3
- package/apis/dist/index.esm.js.map +1 -0
- package/apis/dist/index.js +2 -21
- package/apis/dist/index.js.map +1 -0
- package/app/dist/index.esm.js +2 -11
- package/app/dist/index.esm.js.map +1 -0
- package/app/dist/index.js +2 -18
- package/app/dist/index.js.map +1 -0
- package/auth/dist/index.d.ts +2 -2
- package/auth/dist/index.esm.js +3 -8
- package/auth/dist/index.esm.js.LICENSE.txt +12 -0
- package/auth/dist/index.esm.js.map +1 -0
- package/auth/dist/index.js +3 -13
- package/auth/dist/index.js.LICENSE.txt +12 -0
- package/auth/dist/index.js.map +1 -0
- package/cloudrun/dist/index.esm.js +2 -3
- package/cloudrun/dist/index.esm.js.map +1 -0
- package/cloudrun/dist/index.js +2 -21
- package/cloudrun/dist/index.js.map +1 -0
- package/container/dist/index.d.ts +2 -2
- package/container/dist/index.esm.js +2 -8
- package/container/dist/index.esm.js.map +1 -0
- package/container/dist/index.js +2 -13
- package/container/dist/index.js.map +1 -0
- package/database/dist/commonjs/aggregate.d.ts +29 -0
- package/database/dist/commonjs/aggregate.js +156 -0
- package/database/dist/commonjs/collection.d.ts +9 -0
- package/database/dist/commonjs/collection.js +49 -0
- package/database/dist/commonjs/command.d.ts +175 -0
- package/database/dist/commonjs/command.js +299 -0
- package/database/dist/commonjs/commands/logic.d.ts +24 -0
- package/database/dist/commonjs/commands/logic.js +89 -0
- package/database/dist/commonjs/commands/query.d.ts +68 -0
- package/database/dist/commonjs/commands/query.js +160 -0
- package/database/dist/commonjs/commands/update.d.ts +29 -0
- package/database/dist/commonjs/commands/update.js +51 -0
- package/database/dist/commonjs/config/app.config.d.ts +6 -0
- package/database/dist/commonjs/config/app.config.js +7 -0
- package/database/dist/commonjs/config/error.config.d.ts +3 -0
- package/database/dist/commonjs/config/error.config.js +16 -0
- package/database/dist/commonjs/const/code.d.ts +30 -0
- package/database/dist/commonjs/const/code.js +33 -0
- package/database/dist/commonjs/constant.d.ts +51 -0
- package/database/dist/commonjs/constant.js +75 -0
- package/database/dist/commonjs/document.d.ts +11 -0
- package/database/dist/commonjs/document.js +260 -0
- package/database/dist/commonjs/geo/index.d.ts +6 -0
- package/database/dist/commonjs/geo/index.js +22 -0
- package/database/dist/commonjs/geo/interface.d.ts +24 -0
- package/database/dist/commonjs/geo/interface.js +2 -0
- package/database/dist/commonjs/geo/lineString.d.ts +19 -0
- package/database/dist/commonjs/geo/lineString.js +86 -0
- package/database/dist/commonjs/geo/multiLineString.d.ts +18 -0
- package/database/dist/commonjs/geo/multiLineString.js +95 -0
- package/database/dist/commonjs/geo/multiPoint.d.ts +18 -0
- package/database/dist/commonjs/geo/multiPoint.js +79 -0
- package/database/dist/commonjs/geo/multiPolygon.d.ts +18 -0
- package/database/dist/commonjs/geo/multiPolygon.js +122 -0
- package/database/dist/commonjs/geo/point.d.ts +19 -0
- package/database/dist/commonjs/geo/point.js +50 -0
- package/database/dist/commonjs/geo/polygon.d.ts +19 -0
- package/database/dist/commonjs/geo/polygon.js +109 -0
- package/database/dist/commonjs/helper/symbol.d.ts +14 -0
- package/database/dist/commonjs/helper/symbol.js +31 -0
- package/database/dist/commonjs/index.d.ts +40 -0
- package/database/dist/commonjs/index.js +61 -0
- package/database/dist/commonjs/lib/util.d.ts +1 -0
- package/database/dist/commonjs/lib/util.js +26 -0
- package/database/dist/commonjs/operator-map.d.ts +4 -0
- package/database/dist/commonjs/operator-map.js +24 -0
- package/database/dist/commonjs/query.d.ts +22 -0
- package/database/dist/commonjs/query.js +252 -0
- package/database/dist/commonjs/regexp/index.d.ts +14 -0
- package/database/dist/commonjs/regexp/index.js +33 -0
- package/database/dist/commonjs/serializer/common.d.ts +11 -0
- package/database/dist/commonjs/serializer/common.js +127 -0
- package/database/dist/commonjs/serializer/datatype.d.ts +7 -0
- package/database/dist/commonjs/serializer/datatype.js +132 -0
- package/database/dist/commonjs/serializer/query.d.ts +7 -0
- package/database/dist/commonjs/serializer/query.js +232 -0
- package/database/dist/commonjs/serializer/update.d.ts +15 -0
- package/database/dist/commonjs/serializer/update.js +142 -0
- package/database/dist/commonjs/serverDate/index.d.ts +13 -0
- package/database/dist/commonjs/serverDate/index.js +30 -0
- package/database/dist/commonjs/transaction/collection.d.ts +7 -0
- package/database/dist/commonjs/transaction/collection.js +49 -0
- package/database/dist/commonjs/transaction/document.d.ts +27 -0
- package/database/dist/commonjs/transaction/document.js +205 -0
- package/database/dist/commonjs/transaction/index.d.ts +30 -0
- package/database/dist/commonjs/transaction/index.js +215 -0
- package/database/dist/commonjs/transaction/query.d.ts +43 -0
- package/database/dist/commonjs/transaction/query.js +261 -0
- package/database/dist/commonjs/typings/index.d.ts +40 -0
- package/database/dist/commonjs/typings/index.js +2 -0
- package/database/dist/commonjs/typings/realtime.d.ts +219 -0
- package/database/dist/commonjs/typings/realtime.js +2 -0
- package/database/dist/commonjs/util.d.ts +9 -0
- package/database/dist/commonjs/util.js +145 -0
- package/database/dist/commonjs/utils/error.d.ts +38 -0
- package/database/dist/commonjs/utils/error.js +91 -0
- package/database/dist/commonjs/utils/msg.d.ts +0 -0
- package/database/dist/commonjs/utils/msg.js +0 -0
- package/database/dist/commonjs/utils/symbol.d.ts +8 -0
- package/database/dist/commonjs/utils/symbol.js +58 -0
- package/database/dist/commonjs/utils/type.d.ts +13 -0
- package/database/dist/commonjs/utils/type.js +34 -0
- package/database/dist/commonjs/utils/utils.d.ts +4 -0
- package/database/dist/commonjs/utils/utils.js +39 -0
- package/database/dist/commonjs/validate.d.ts +1 -0
- package/database/dist/commonjs/validate.js +60 -0
- package/database/dist/esm/aggregate.d.ts +29 -0
- package/database/dist/esm/aggregate.js +154 -0
- package/database/dist/esm/collection.d.ts +9 -0
- package/database/dist/esm/collection.js +46 -0
- package/database/dist/esm/command.d.ts +175 -0
- package/database/dist/esm/command.js +296 -0
- package/database/dist/esm/commands/logic.d.ts +24 -0
- package/database/dist/esm/commands/logic.js +84 -0
- package/database/dist/esm/commands/query.d.ts +68 -0
- package/database/dist/esm/commands/query.js +154 -0
- package/database/dist/esm/commands/update.d.ts +29 -0
- package/database/dist/esm/commands/update.js +46 -0
- package/database/dist/esm/config/app.config.d.ts +6 -0
- package/database/dist/esm/config/app.config.js +5 -0
- package/database/dist/esm/config/error.config.d.ts +3 -0
- package/database/dist/esm/config/error.config.js +13 -0
- package/database/dist/esm/const/code.d.ts +30 -0
- package/database/dist/esm/const/code.js +30 -0
- package/database/dist/esm/constant.d.ts +51 -0
- package/database/dist/esm/constant.js +65 -0
- package/database/dist/esm/document.d.ts +11 -0
- package/database/dist/esm/document.js +257 -0
- package/database/dist/esm/geo/index.d.ts +6 -0
- package/database/dist/esm/geo/index.js +6 -0
- package/database/dist/esm/geo/interface.d.ts +24 -0
- package/database/dist/esm/geo/interface.js +1 -0
- package/database/dist/esm/geo/lineString.d.ts +19 -0
- package/database/dist/esm/geo/lineString.js +83 -0
- package/database/dist/esm/geo/multiLineString.d.ts +18 -0
- package/database/dist/esm/geo/multiLineString.js +92 -0
- package/database/dist/esm/geo/multiPoint.d.ts +18 -0
- package/database/dist/esm/geo/multiPoint.js +76 -0
- package/database/dist/esm/geo/multiPolygon.d.ts +18 -0
- package/database/dist/esm/geo/multiPolygon.js +119 -0
- package/database/dist/esm/geo/point.d.ts +19 -0
- package/database/dist/esm/geo/point.js +47 -0
- package/database/dist/esm/geo/polygon.d.ts +19 -0
- package/database/dist/esm/geo/polygon.js +106 -0
- package/database/dist/esm/helper/symbol.d.ts +14 -0
- package/database/dist/esm/helper/symbol.js +14 -0
- package/database/dist/esm/index.d.ts +40 -0
- package/database/dist/esm/index.js +55 -0
- package/database/dist/esm/lib/util.d.ts +1 -0
- package/database/dist/esm/lib/util.js +22 -0
- package/database/dist/esm/operator-map.d.ts +4 -0
- package/database/dist/esm/operator-map.js +20 -0
- package/database/dist/esm/query.d.ts +22 -0
- package/database/dist/esm/query.js +249 -0
- package/database/dist/esm/regexp/index.d.ts +14 -0
- package/database/dist/esm/regexp/index.js +29 -0
- package/database/dist/esm/serializer/common.d.ts +11 -0
- package/database/dist/esm/serializer/common.js +118 -0
- package/database/dist/esm/serializer/datatype.d.ts +7 -0
- package/database/dist/esm/serializer/datatype.js +127 -0
- package/database/dist/esm/serializer/query.d.ts +7 -0
- package/database/dist/esm/serializer/query.js +229 -0
- package/database/dist/esm/serializer/update.d.ts +15 -0
- package/database/dist/esm/serializer/update.js +139 -0
- package/database/dist/esm/serverDate/index.d.ts +13 -0
- package/database/dist/esm/serverDate/index.js +26 -0
- package/database/dist/esm/transaction/collection.d.ts +7 -0
- package/database/dist/esm/transaction/collection.js +46 -0
- package/database/dist/esm/transaction/document.d.ts +27 -0
- package/database/dist/esm/transaction/document.js +202 -0
- package/database/dist/esm/transaction/index.d.ts +30 -0
- package/database/dist/esm/transaction/index.js +210 -0
- package/database/dist/esm/transaction/query.d.ts +43 -0
- package/database/dist/esm/transaction/query.js +258 -0
- package/database/dist/esm/typings/index.d.ts +40 -0
- package/database/dist/esm/typings/index.js +1 -0
- package/database/dist/esm/typings/realtime.d.ts +219 -0
- package/database/dist/esm/typings/realtime.js +1 -0
- package/database/dist/esm/util.d.ts +9 -0
- package/database/dist/esm/util.js +142 -0
- package/database/dist/esm/utils/error.d.ts +38 -0
- package/database/dist/esm/utils/error.js +84 -0
- package/database/dist/esm/utils/msg.d.ts +0 -0
- package/database/dist/esm/utils/msg.js +0 -0
- package/database/dist/esm/utils/symbol.d.ts +8 -0
- package/database/dist/esm/utils/symbol.js +55 -0
- package/database/dist/esm/utils/type.d.ts +13 -0
- package/database/dist/esm/utils/type.js +20 -0
- package/database/dist/esm/utils/utils.d.ts +4 -0
- package/database/dist/esm/utils/utils.js +33 -0
- package/database/dist/esm/validate.d.ts +1 -0
- package/database/dist/esm/validate.js +57 -0
- package/database/package.json +34 -4
- package/dist/index.cjs.js +3 -40
- package/dist/index.cjs.js.LICENSE.txt +12 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.esm.js +3 -35
- package/dist/index.esm.js.LICENSE.txt +12 -0
- package/dist/index.esm.js.map +1 -0
- package/functions/dist/index.d.ts +2 -2
- package/functions/dist/index.esm.js +2 -8
- package/functions/dist/index.esm.js.map +1 -0
- package/functions/dist/index.js +2 -13
- package/functions/dist/index.js.map +1 -0
- package/index.d.ts +654 -45
- package/miniprogram_dist/ai.js +1 -1
- package/miniprogram_dist/apis.js +1 -1
- package/miniprogram_dist/app.js +1 -1
- package/miniprogram_dist/auth.js +1 -1
- package/miniprogram_dist/cloudrun.js +1 -1
- package/miniprogram_dist/container.js +1 -1
- package/miniprogram_dist/database.js +1 -1
- package/miniprogram_dist/functions.js +1 -1
- package/miniprogram_dist/index.js +1 -1
- package/miniprogram_dist/model.js +1 -1
- package/miniprogram_dist/mysql.js +1 -1
- package/miniprogram_dist/oauth.js +2 -1
- package/miniprogram_dist/realtime.js +1 -1
- package/miniprogram_dist/storage.js +1 -1
- package/model/dist/index.esm.js +2 -3
- package/model/dist/index.esm.js.map +1 -0
- package/model/dist/index.js +2 -21
- package/model/dist/index.js.map +1 -0
- package/mysql/dist/index.esm.js +2 -3
- package/mysql/dist/index.esm.js.map +1 -0
- package/mysql/dist/index.js +2 -21
- package/mysql/dist/index.js.map +1 -0
- package/oauth/dist/index.esm.js +3 -3
- package/oauth/dist/index.esm.js.LICENSE.txt +12 -0
- package/oauth/dist/index.esm.js.map +1 -0
- package/oauth/dist/index.js +3 -21
- package/oauth/dist/index.js.LICENSE.txt +12 -0
- package/oauth/dist/index.js.map +1 -0
- package/package.json +113 -20
- package/realtime/dist/index.d.ts +2 -2
- package/realtime/dist/index.esm.js +2 -8
- package/realtime/dist/index.esm.js.map +1 -0
- package/realtime/dist/index.js +2 -13
- package/realtime/dist/index.js.map +1 -0
- package/storage/dist/index.d.ts +2 -2
- package/storage/dist/index.esm.js +2 -4
- package/storage/dist/index.esm.js.map +1 -0
- package/storage/dist/index.js +2 -9
- package/storage/dist/index.js.map +1 -0
- package/types/analytics.d.ts +51 -0
- package/types/auth.d.ts +99 -0
- package/types/cache.d.ts +26 -0
- package/types/cloudrun.d.ts +9 -0
- package/types/component.d.ts +17 -0
- package/types/container.d.ts +93 -0
- package/types/database.d.ts +31 -0
- package/types/events.d.ts +13 -0
- package/types/functions.d.ts +40 -0
- package/types/index.d.ts +211 -0
- package/types/package.json +43 -0
- package/types/realtime.d.ts +350 -0
- package/types/request.d.ts +30 -0
- package/types/storage.d.ts +126 -0
- package/utilities/dist/cjs/adapters/index.d.ts +45 -0
- package/utilities/dist/cjs/adapters/index.js +68 -0
- package/utilities/dist/cjs/adapters/platforms/web.d.ts +20 -0
- package/utilities/dist/cjs/adapters/platforms/web.js +286 -0
- package/utilities/dist/cjs/constants/common.d.ts +6 -0
- package/utilities/dist/cjs/constants/common.js +24 -0
- package/utilities/dist/cjs/constants/errors.d.ts +8 -0
- package/utilities/dist/cjs/constants/errors.js +12 -0
- package/utilities/dist/cjs/constants/index.d.ts +3 -0
- package/utilities/dist/cjs/constants/index.js +21 -0
- package/utilities/dist/cjs/helpers/decorators.d.ts +11 -0
- package/utilities/dist/cjs/helpers/decorators.js +238 -0
- package/utilities/dist/cjs/helpers/index.d.ts +1 -0
- package/utilities/dist/cjs/helpers/index.js +18 -0
- package/utilities/dist/cjs/index.d.ts +13 -0
- package/utilities/dist/cjs/index.js +51 -0
- package/utilities/dist/cjs/libs/abortController.d.ts +9 -0
- package/utilities/dist/cjs/libs/abortController.js +25 -0
- package/utilities/dist/cjs/libs/cache.d.ts +17 -0
- package/utilities/dist/cjs/libs/cache.js +261 -0
- package/utilities/dist/cjs/libs/events.d.ts +27 -0
- package/utilities/dist/cjs/libs/events.js +108 -0
- package/utilities/dist/cjs/libs/langEvent.d.ts +3 -0
- package/utilities/dist/cjs/libs/langEvent.js +7 -0
- package/utilities/dist/cjs/libs/util.d.ts +49 -0
- package/utilities/dist/cjs/libs/util.js +282 -0
- package/utilities/dist/esm/adapters/index.d.ts +45 -0
- package/utilities/dist/esm/adapters/index.js +40 -0
- package/utilities/dist/esm/adapters/platforms/web.d.ts +20 -0
- package/utilities/dist/esm/adapters/platforms/web.js +282 -0
- package/utilities/dist/esm/constants/common.d.ts +6 -0
- package/utilities/dist/esm/constants/common.js +17 -0
- package/utilities/dist/esm/constants/errors.d.ts +8 -0
- package/utilities/dist/esm/constants/errors.js +9 -0
- package/utilities/dist/esm/constants/index.d.ts +3 -0
- package/utilities/dist/esm/constants/index.js +4 -0
- package/utilities/dist/esm/helpers/decorators.d.ts +11 -0
- package/utilities/dist/esm/helpers/decorators.js +234 -0
- package/utilities/dist/esm/helpers/index.d.ts +1 -0
- package/utilities/dist/esm/helpers/index.js +2 -0
- package/utilities/dist/esm/index.d.ts +13 -0
- package/utilities/dist/esm/index.js +14 -0
- package/utilities/dist/esm/libs/abortController.d.ts +9 -0
- package/utilities/dist/esm/libs/abortController.js +23 -0
- package/utilities/dist/esm/libs/cache.d.ts +17 -0
- package/utilities/dist/esm/libs/cache.js +258 -0
- package/utilities/dist/esm/libs/events.d.ts +27 -0
- package/utilities/dist/esm/libs/events.js +102 -0
- package/utilities/dist/esm/libs/langEvent.d.ts +3 -0
- package/utilities/dist/esm/libs/langEvent.js +4 -0
- package/utilities/dist/esm/libs/util.d.ts +49 -0
- package/utilities/dist/esm/libs/util.js +254 -0
- package/utilities/dist/miniprogram/index.js +1 -0
- package/utilities/package.json +26 -0
- package/analytics/dist/index.d.ts +0 -2
- package/analytics/dist/index.esm.js +0 -4
- package/analytics/dist/index.js +0 -9
- package/analytics/package.json +0 -6
- package/database/dist/index.d.ts +0 -3
- package/database/dist/index.esm.js +0 -503
- package/database/dist/index.js +0 -509
- package/miniprogram_dist/analytics.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("cloudbase_analytics",[],e):"object"==typeof exports?exports.cloudbase_analytics=e():t.cloudbase_analytics=e()}("undefined"!=typeof window?window:this,(()=>(()=>{"use strict";var t={702:(t,e,n)=>{n.r(e),n.d(e,{registerAnalytics:()=>N});var o="@cloudbase/js-sdk";function r(){return o}var i,a={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 s(t,e){console.warn("[".concat(r(),"][").concat(t,"]:").concat(e))}var c,u,l=(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)}),p=function(){return p=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},p.apply(this,arguments)},f=function(t,e,n,o){return new(n||(n=Promise))((function(r,i){function a(t){try{c(o.next(t))}catch(t){i(t)}}function s(t){try{c(o.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}c((o=o.apply(t,e||[])).next())}))},d=function(t,e){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[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(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],o=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};!function(t){function e(e){var n=t.call(this)||this,o=e.timeout,r=e.timeoutMsg,i=e.restrictedMethods;return n.timeout=o||0,n.timeoutMsg=r||"请求超时",n.restrictedMethods=i||["get","post","upload","download"],n}l(e,t),e.prototype.get=function(t){return this.request(p(p({},t),{method:"get"}),this.restrictedMethods.includes("get"))},e.prototype.post=function(t){return this.request(p(p({},t),{method:"post"}),this.restrictedMethods.includes("post"))},e.prototype.put=function(t){return this.request(p(p({},t),{method:"put"}))},e.prototype.upload=function(t){var e=t.data,n=t.file,o=t.name,r=t.method,i=t.headers,a=void 0===i?{}:i,s={post:"post",put:"put"}[null==r?void 0:r.toLowerCase()]||"put",c=new FormData;return"post"===s?(Object.keys(e).forEach((function(t){c.append(t,e[t])})),c.append("key",o),c.append("file",n),this.request(p(p({},t),{data:c,method:s}),this.restrictedMethods.includes("upload"))):this.request(p(p({},t),{method:"put",headers:a,body:n}),this.restrictedMethods.includes("upload"))},e.prototype.download=function(t){return f(this,void 0,void 0,(function(){var e,n,o,r;return d(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.get(p(p({},t),{headers:{},responseType:"blob"}))];case 1:return e=i.sent().data,n=window.URL.createObjectURL(new Blob([e])),o=decodeURIComponent(new URL(t.url).pathname.split("/").pop()||""),(r=document.createElement("a")).href=n,r.setAttribute("download",o),r.style.display="none",document.body.appendChild(r),r.click(),window.URL.revokeObjectURL(n),document.body.removeChild(r),[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.fetch=function(t){var e;return f(this,void 0,void 0,(function(){var n,o,r,i,a,s,c,u,l,h,y,b,v,m=this;return d(this,(function(g){switch(g.label){case 0:return n=new AbortController,o=t.url,r=t.enableAbort,i=void 0!==r&&r,a=t.stream,s=void 0!==a&&a,c=t.signal,u=t.timeout,l=t.shouldThrowOnError,h=void 0===l||l,y=null!=u?u:this.timeout,c&&(c.aborted&&n.abort(),c.addEventListener("abort",(function(){return n.abort()}))),b=null,i&&y&&(b=setTimeout((function(){console.warn(m.timeoutMsg),n.abort(new Error(m.timeoutMsg))}),y)),[4,fetch(o,p(p({},t),{signal:n.signal})).then((function(t){return f(m,void 0,void 0,(function(){var e,n,o;return d(this,(function(r){switch(r.label){case 0:return clearTimeout(b),h?t.ok?(e=t,[3,3]):[3,1]:[3,4];case 1:return o=(n=Promise).reject,[4,t.json()];case 2:e=o.apply(n,[r.sent()]),r.label=3;case 3:return[2,e];case 4:return[2,t]}}))}))})).catch((function(t){if(clearTimeout(b),h)return Promise.reject(t)}))];case 1:return v=g.sent(),[2,{data:s?v.body:(null===(e=v.headers.get("content-type"))||void 0===e?void 0:e.includes("application/json"))?v.json():v.text(),statusCode:v.status,header:v.headers}]}}))}))},e.prototype.request=function(t,e){var n=this;void 0===e&&(e=!1);var o=String(t.method).toLowerCase()||"get";return new Promise((function(r){var i,a,s,c=t.url,u=t.headers,l=void 0===u?{}:u,p=t.data,f=t.responseType,d=t.withCredentials,h=t.body,y=t.onUploadProgress,b=function(t,e,n){void 0===n&&(n={});var o=/\?/.test(e),r="";return Object.keys(n).forEach((function(t){""===r?!o&&(e+="?"):r+="&",r+="".concat(t,"=").concat(encodeURIComponent(n[t]))})),/^http(s)?:\/\//.test(e+=r)?e:"".concat(t).concat(e)}("https:",c,"get"===o?p:{}),v=new XMLHttpRequest;v.open(o,b),f&&(v.responseType=f),Object.keys(l).forEach((function(t){v.setRequestHeader(t,l[t])})),y&&v.upload.addEventListener("progress",y),v.onreadystatechange=function(){var t={};if(4===v.readyState){var e=v.getAllResponseHeaders().trim().split(/[\r\n]+/),n={};e.forEach((function(t){var e=t.split(": "),o=e.shift().toLowerCase(),r=e.join(": ");n[o]=r})),t.header=n,t.statusCode=v.status;try{t.data="blob"===f?v.response:JSON.parse(v.responseText)}catch(e){t.data="blob"===f?v.response:v.responseText}clearTimeout(i),r(t)}},e&&n.timeout&&(i=setTimeout((function(){console.warn(n.timeoutMsg),v.abort()}),n.timeout)),s=p,a="[object FormData]"===Object.prototype.toString.call(s)?p:"application/x-www-form-urlencoded"===l["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("&")}(p):h||(p?JSON.stringify(p):void 0),d&&(v.withCredentials=!0),v.send(a)}))}}((function(){})),function(t){t.WEB="web",t.WX_MP="wx_mp"}(u||(u={}));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)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 o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),y=function(t,e,n,o){return new(n||(n=Promise))((function(r,i){function a(t){try{c(o.next(t))}catch(t){i(t)}}function s(t){try{c(o.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}c((o=o.apply(t,e||[])).next())}))},b=function(t,e){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[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(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],o=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},v=function(t){function e(e){var n=t.call(this)||this;return n.root=e,e.tcbCacheObject||(e.tcbCacheObject={}),n}return h(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,o=void 0===n?{}:n,r=t.keys,i=void 0===r?{}:r;this.platformInfo=o,this.storage||(this.persistenceTag=this.platformInfo.adapter.primaryStorage||e,this.storage=function(t,e){switch(t){case"local":default:return e.localStorage?e.localStorage:(s(a.INVALID_PARAMS,"localStorage is not supported on current platform"),new v(e.root));case"none":return new v(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 o={version:n||"localCachev1",content:e};this.storage.setItem(t,JSON.stringify(o))}catch(t){throw new Error(JSON.stringify({code:a.OPERATION_FAIL,msg:"[".concat(r(),"][").concat(a.OPERATION_FAIL,"]setStore failed"),info:t}))}}else s(a.INVALID_OPERATION,"current platform's storage is asynchronous, please use setStoreAsync insteed")},t.prototype.setStoreAsync=function(t,e,n){return y(this,void 0,void 0,(function(){var o;return b(this,(function(r){switch(r.label){case 0:if(!this.storage)return[2];r.label=1;case 1:return r.trys.push([1,3,,4]),o={version:n||"localCachev1",content:e},[4,this.storage.setItem(t,JSON.stringify(o))];case 2:return r.sent(),[3,4];case 3:return r.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={IS_MP_BUILD:!0,IS_BROWSER_BUILD:!0})||void 0===n?void 0:n.tcb_token))return{IS_MP_BUILD:!0,IS_BROWSER_BUILD:!0}.tcb_token;if(!this.storage)return""}catch(t){return""}e=e||"localCachev1";var o=this.storage.getItem(t);return o&&o.indexOf(e)>=0?JSON.parse(o).content:""}s(a.INVALID_OPERATION,"current platform's storage is asynchronous, please use getStoreAsync insteed")},t.prototype.getStoreAsync=function(t,e){var n;return y(this,void 0,void 0,(function(){var o;return b(this,(function(r){switch(r.label){case 0:try{if("undefined"!=typeof process&&(null===(n={IS_MP_BUILD:!0,IS_BROWSER_BUILD:!0})||void 0===n?void 0:n.tcb_token))return[2,{IS_MP_BUILD:!0,IS_BROWSER_BUILD:!0}.tcb_token];if(!this.storage)return[2,""]}catch(t){return[2,""]}return e=e||"localCachev1",[4,this.storage.getItem(t)];case 1:return(o=r.sent())&&o.indexOf(e)>=0?[2,JSON.parse(o).content]:[2,""]}}))}))},t.prototype.removeStore=function(t){"async"!==this.mode?this.storage.removeItem(t):s(a.INVALID_OPERATION,"current platform's storage is asynchronous, please use removeStoreAsync insteed")},t.prototype.removeStoreAsync=function(t){return y(this,void 0,void 0,(function(){return b(this,(function(e){switch(e.label){case 0:return[4,this.storage.removeItem(t)];case 1:return e.sent(),[2]}}))}))}}();var m=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 o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),g=function(t,e){this.data=e||null,this.name=t},w=function(t){function e(e,n){var o=t.call(this,"error",{error:e,data:n})||this;return o.error=e,o}return m(e,t),e}(g),O=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 o=n[t].indexOf(e);-1!==o&&n[t].splice(o,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,o=n.name;if(this.listens(o)){n.target=this;for(var r=0,i=this.listeners[o]?function(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}([],this.listeners[o],!0):[];r<i.length;r++)i[r].call(this,n)}return this},t.prototype.listens=function(t){return this.listeners[t]&&this.listeners[t].length>0},t}();function _(t){this.message=t}function I(t){this.message=t}new O,new O,"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.indexOf("Firefox"),_.prototype=new Error,_.prototype.name="InvalidCharacterError","undefined"!=typeof window&&window.atob&&window.atob.bind(window),I.prototype=new Error,I.prototype.name="InvalidTokenError";var S=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},A=a,j="analytics",R=["mall"],P=new(function(){function t(){}return t.prototype.analytics=function(t){return e=this,n=void 0,r=function(){var e,n,o;return function(t,e){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[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(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],o=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}(this,(function(r){if(!function(t){if("Object"!==Object.prototype.toString.call(t).slice(8,-1))return!1;var e=t.report_data,n=t.report_type;return!1!==R.includes(n)&&"Object"===Object.prototype.toString.call(e).slice(8,-1)&&!(void 0!==e.action_time&&!Number.isInteger(e.action_time))&&"string"==typeof e.action_type}(t))throw new Error(JSON.stringify({code:A.INVALID_PARAMS,msg:"[".concat(j,".analytics] invalid report data")}));return e=void 0===t.report_data.action_time?Math.floor(Date.now()/1e3):t.report_data.action_time,n={analytics_scene:t.report_type,analytics_data:Object.assign({},t.report_data,{action_time:e})},o={requestData:n},this.request.send("analytics.report",o),[2]}))},new((o=void 0)||(o=Promise))((function(t,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function s(t){try{c(r.throw(t))}catch(t){i(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(a,s)}c((r=r.apply(e,n||[])).next())}));var e,n,o,r},function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);i>3&&a&&Object.defineProperty(e,n,a)}([(e={customInfo:{className:"Cloudbase",methodName:"analytics"},title:"上报调用失败",messages:["请确认以下各项:"," 1 - 调用 analytics() 的语法或参数是否正确","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat("https://support.qq.com/products/148793")]},e.mode,e.customInfo,e.title,e.messages,function(t,e,n){}),S("design:type",Function),S("design:paramtypes",[Object]),S("design:returntype",Promise)],t.prototype,"analytics",null),t;var e}()),E={name:j,entity:{analytics:P.analytics}};try{cloudbase.registerComponent(E)}catch(_){}function N(t){try{t.registerComponent(E)}catch(t){console.warn(t)}}}},e={};function n(o){var r=e[o];if(void 0!==r)return r.exports;var i=e[o]={exports:{}};return t[o](i,i.exports,n),i.exports}n.d=(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},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 o={};return(()=>{var t=o;Object.defineProperty(t,"__esModule",{value:!0}),t.registerAnalytics=void 0;var e=n(702);t.registerAnalytics=e.registerAnalytics})(),o})()));
|