@cloudbase/apis 2.25.0 → 2.25.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("tcbauth",[],t):"object"==typeof exports?exports.tcbauth=t():e.tcbauth=t()}("undefined"!=typeof window?window:this,()=>(()=>{"use strict";var 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=("undefined"==typeof process||process.env,!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}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})};var o={};return(()=>{n.r(o),n.d(o,{generateApis:()=>s,registerApis:()=>f});var e=n(794),t=function(){return(t=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}).apply(this,arguments)},r=function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{u(o.next(e))}catch(e){i(e)}}function c(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(a,c)}u((o=o.apply(e,t||[])).next())}))},i=function(e,t){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:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(u){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,o&&(r=2&c[0]?o.return:c[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,c[1])).done)return r;switch(o=0,r&&(c=[2&c[0],r.value]),c[0]){case 0:case 1:r=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,o=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!r||c[1]>r[0]&&c[1]<r[3])){a.label=c[1];break}if(6===c[0]&&a.label<r[1]){a.label=r[1],r=c;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(c);break}r[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],o=0}finally{n=r=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,u])}}};function a(n,o){var a,c,u;return r(this,void 0,void 0,(function(){var r,s,l,f,d,p,h,v,y,O,b,E,g,P,_,R,T,w,A,m,S;return i(this,(function(i){switch(i.label){case 0:if(s=(r=n||{}).name,l=r.body,f=r.path,d=void 0===f?"":f,p=r.method,h=void 0===p?"POST":p,v=r.headers,y=void 0===v?{}:v,O=(n||{}).token,!s)throw new Error(JSON.stringify({code:e.ERRORS.INVALID_PARAMS,msg:"[apis] invalid api name"}));return b="",g=(E=this).gatewayOrigin,P=E.getAccessToken,_=E.env,g?b="".concat(g,"/v1"):this.getEndPointWithKey?(R=this.getEndPointWithKey("GATEWAY"),T=R.BASE_URL,w=R.PROTOCOL,b="".concat(w).concat(T)):b="https://".concat(_,".api.tcloudbasegateway.com/v1"),A="".concat(b,"/apis/").concat(s),m=d.startsWith("/")?d:"/".concat(d),P?[4,P()]:[3,2];case 1:S=i.sent().accessToken,y.Authorization="Bearer ".concat(S),i.label=2;case 2:return[4,this.request.fetch(t({url:"".concat(A).concat(m),method:h||"POST",headers:t({"Content-Type":"application/json; charset=utf-8"},y),body:l,token:(null===(a=null==O?void 0:O.trim)||void 0===a?void 0:a.call(O))||(null===(u=null===(c=y.Authorization)||void 0===c?void 0:c.replace)||void 0===u?void 0:u.call(c,/^Bearer /,""))||null},o))];case 3:return[4,i.sent().data];case 4:return[2,i.sent()]}}))}))}var c=["GET","POST","PUT","DELETE","HEAD","OPTIONS","PATCH","REQUEST"];function u(e){var n=this;return new Proxy({},{get:function(o,u){if("string"!=typeof u)throw new Error("[apis] method must be string");var s=u.toLocaleUpperCase();if(!c.includes(s))throw new Error("[apis] invalid method: ".concat(u));return function(o,c){return r(n,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return[4,a.call(this,t({name:e,method:("REQUEST"===s?o.method:s)||"POST"},o),c)];case 1:return[2,n.sent()]}}))}))}}})}function s(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 u.call(t,n)}})}var l={name:"apis",IIFE:!0,entity:function(){Object.defineProperty(this.prototype,"apis",{get:function(){return s.call(this)},configurable:!0,enumerable:!0})}};function f(e){try{e.registerComponent(l)}catch(e){console.warn(e)}}try{cloudbase.registerComponent(l)}catch(e){}try{window.registerApis=f}catch(e){}})(),o})());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudbase/apis",
|
|
3
|
-
"version": "2.25.
|
|
3
|
+
"version": "2.25.1",
|
|
4
4
|
"description": "cloudbase js sdk apis module",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"author": "",
|
|
31
31
|
"license": "Apache-2.0",
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@cloudbase/types": "2.25.
|
|
34
|
-
"@cloudbase/utilities": "2.25.
|
|
33
|
+
"@cloudbase/types": "2.25.1",
|
|
34
|
+
"@cloudbase/utilities": "2.25.1"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@cloudbase/adapter-interface": "^0.7.1"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "6bd91c071d8fd06ef6d6d3ed2c8afcb84db4d9d5"
|
|
40
40
|
}
|