@cloudbase/js-sdk 3.1.2 → 3.1.3-beta.1
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 +3 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.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/index.js +1 -1
- package/miniprogram_dist/oauth.js +1 -1
- package/miniprogram_dist/storage.js +1 -1
- package/package.json +15 -15
package/CHANGELOG.md
CHANGED
package/dist/index.cjs.js
CHANGED
|
@@ -14,7 +14,7 @@ var cloudrun_1 = require("@cloudbase/cloudrun");
|
|
|
14
14
|
var mysql_1 = require("@cloudbase/mysql");
|
|
15
15
|
var apis_1 = require("@cloudbase/apis");
|
|
16
16
|
var database_1 = require("./../database");
|
|
17
|
-
var version = "3.1.
|
|
17
|
+
var version = "3.1.3-beta.1";
|
|
18
18
|
app_1.default.registerVersion(version);
|
|
19
19
|
try {
|
|
20
20
|
(0, auth_1.registerAuth)(app_1.default);
|
package/dist/index.esm.js
CHANGED
|
@@ -10,7 +10,7 @@ import { registerCloudrun } from '@cloudbase/cloudrun';
|
|
|
10
10
|
import { registerMySQL } from '@cloudbase/mysql';
|
|
11
11
|
import { registerApis } from '@cloudbase/apis';
|
|
12
12
|
import { registerDatabase } from './../database';
|
|
13
|
-
var version = "3.1.
|
|
13
|
+
var version = "3.1.3-beta.1";
|
|
14
14
|
cloudbase.registerVersion(version);
|
|
15
15
|
try {
|
|
16
16
|
registerAuth(cloudbase);
|
package/miniprogram_dist/apis.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("cloudbase_apis",[],t):"object"==typeof exports?exports.cloudbase_apis=t():e.cloudbase_apis=t()}("undefined"!=typeof window?window:this,(()=>(()=>{"use strict";var e={465:function(e,t,n){var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(248),t)},248:(e,t,n)=>{n.r(t),n.d(t,{generateApis:()=>l,registerApis:()=>p});var o=n(794),r=function(){return r=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},r.apply(this,arguments)},i=function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function c(e){try{u(o.next(e))}catch(e){i(e)}}function a(e){try{u(o.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,a)}u((o=o.apply(e,t||[])).next())}))},c=function(e,t){var n,o,r,i,c={label:0,sent:function(){if(1&r[0])throw r[1];return r[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(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(c=0)),c;)try{if(n=1,o&&(r=2&a[0]?o.return:a[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,a[1])).done)return r;switch(o=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++,o=a[1],a=[0];continue;case 7:a=c.ops.pop(),c.trys.pop();continue;default:if(!((r=(r=c.trys).length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){c=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){c.label=a[1];break}if(6===a[0]&&c.label<r[1]){c.label=r[1],r=a;break}if(r&&c.label<r[2]){c.label=r[2],c.ops.push(a);break}r[2]&&c.ops.pop(),c.trys.pop();continue}a=t.call(e,c)}catch(e){a=[6,e],o=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}};function a(e,t){var n,a,u,s;return i(this,void 0,void 0,(function(){var i,l,f,d,p,h,v,O,y,b,_,g,E,P,w,R,T,m,A,
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("cloudbase_apis",[],t):"object"==typeof exports?exports.cloudbase_apis=t():e.cloudbase_apis=t()}("undefined"!=typeof window?window:this,(()=>(()=>{"use strict";var e={465:function(e,t,n){var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(248),t)},248:(e,t,n)=>{n.r(t),n.d(t,{generateApis:()=>l,registerApis:()=>p});var o=n(794),r=function(){return r=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},r.apply(this,arguments)},i=function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function c(e){try{u(o.next(e))}catch(e){i(e)}}function a(e){try{u(o.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,a)}u((o=o.apply(e,t||[])).next())}))},c=function(e,t){var n,o,r,i,c={label:0,sent:function(){if(1&r[0])throw r[1];return r[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(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(c=0)),c;)try{if(n=1,o&&(r=2&a[0]?o.return:a[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,a[1])).done)return r;switch(o=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++,o=a[1],a=[0];continue;case 7:a=c.ops.pop(),c.trys.pop();continue;default:if(!((r=(r=c.trys).length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){c=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){c.label=a[1];break}if(6===a[0]&&c.label<r[1]){c.label=r[1],r=a;break}if(r&&c.label<r[2]){c.label=r[2],c.ops.push(a);break}r[2]&&c.ops.pop(),c.trys.pop();continue}a=t.call(e,c)}catch(e){a=[6,e],o=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}};function a(e,t){var n,a,u,s;return i(this,void 0,void 0,(function(){var i,l,f,d,p,h,v,O,y,b,_,g,E,P,w,R,S,T,m,A,I,N,j;return c(this,(function(c){switch(c.label){case 0:l=(i=e||{}).name,f=i.body,d=i.path,p=void 0===d?"":d,h=i.method,v=void 0===h?"POST":h,O=i.headers,y=void 0===O?{}:O,b=(e||{}).token,_={};try{_=JSON.parse(f)}catch(e){_=f||{}}if(!l)throw new Error(JSON.stringify({code:o.ERRORS.INVALID_PARAMS,msg:"[apis] invalid api name"}));return g="",P=(E=this).gatewayOrigin,w=E.getAccessToken,R=E.env,P?g="".concat(P,"/v1"):this.getEndPointWithKey?(S=this.getEndPointWithKey("GATEWAY"),T=S.BASE_URL,m=S.PROTOCOL,g="".concat(m).concat(T)):g="https://".concat(R,".api.tcloudbasegateway.com/v1"),A="".concat(g,"/apis/").concat(l),I=p.startsWith("/")?p:"/".concat(p),w?[4,w()]:[3,2];case 1:N=c.sent().accessToken,y.Authorization="Bearer ".concat(N),c.label=2;case 2:if(j=["GET","HEAD"].includes(null===(n=null==v?void 0:v.toUpperCase)||void 0===n?void 0:n.call(v)))try{I="".concat(I).concat(I.includes("?")?"&":"?").concat(Object.keys(_).map((function(e){return"".concat(e,"=").concat(_[e])})).join("&"))}catch(e){}return[4,this.request.fetch(r(r(r({url:"".concat(A).concat(I),method:v||"POST",headers:r({"Content-Type":"application/json; charset=utf-8"},y)},j?{}:{body:JSON.stringify(_)}),{token:(null===(a=null==b?void 0:b.trim)||void 0===a?void 0:a.call(b))||(null===(s=null===(u=y.Authorization)||void 0===u?void 0:u.replace)||void 0===s?void 0:s.call(u,/^Bearer /,""))||null}),t))];case 3:return[4,c.sent().data];case 4:return[2,c.sent()]}}))}))}var u=["GET","POST","PUT","DELETE","HEAD","OPTIONS","PATCH","REQUEST"];function s(e){var t=this;return new Proxy({},{get:function(n,o){if("string"!=typeof o)throw new Error("[apis] method must be string");var s=o.toLocaleUpperCase();if(!u.includes(s))throw new Error("[apis] invalid method: ".concat(o));return function(n,o){return i(t,void 0,void 0,(function(){return c(this,(function(t){switch(t.label){case 0:return[4,a.call(this,r({name:e,method:("REQUEST"===s?n.method:s)||"POST"},n),o)];case 1:return[2,t.sent()]}}))}))}}})}function l(e){var t=this;return Object.keys(e||{}).forEach((function(n){void 0!==e[n]&&(t[n]=e[n])})),new Proxy({},{get:function(e,n){if("string"==typeof n)return s.call(t,n)}})}var f="apis",d={name:f,IIFE:!0,entity:function(){Object.defineProperty(this.prototype,f,{get:function(){return l.call(this)},configurable:!0,enumerable:!0})}};function p(e){try{e.registerComponent(d)}catch(e){console.warn(e)}}try{cloudbase.registerComponent(d)}catch(e){}try{window.registerApis=p}catch(e){}},946:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.COMMUNITY_SITE_URL=t.IS_DEBUG_MODE=t.getProtocol=t.setProtocol=t.getSdkName=t.setSdkName=void 0;var n="@cloudbase/js-sdk";t.setSdkName=function(e){n=e},t.getSdkName=function(){return n};var o="https:";t.setProtocol=function(e){o=e},t.getProtocol=function(){return o},t.IS_DEBUG_MODE=!1,t.COMMUNITY_SITE_URL="https://support.qq.com/products/148793"},205:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ERRORS=void 0,t.ERRORS={INVALID_PARAMS:"INVALID_PARAMS",INVALID_SYNTAX:"INVALID_SYNTAX",INVALID_OPERATION:"INVALID_OPERATION",OPERATION_FAIL:"OPERATION_FAIL",NETWORK_ERROR:"NETWORK_ERROR",UNKOWN_ERROR:"UNKOWN_ERROR"}},794:function(e,t,n){var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.OATUH_LOGINTYPE=void 0,r(n(946),t),r(n(205),t),t.OATUH_LOGINTYPE="constants"}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={exports:{}};return e[o].call(i.exports,i,i.exports,n),i.exports}return n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(465)})()));
|