@cloudbase/js-sdk 2.5.25-beta.0 → 2.5.26-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.
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("cloudbase_oauth",[],e):"object"==typeof exports?exports.cloudbase_oauth=e():t.cloudbase_oauth=e()}("undefined"!=typeof window?window:this,(()=>(()=>{"use strict";var t={543:(t,e,n)=>{n.r(e),n.d(e,{Auth:()=>N,AuthClient:()=>P,CloudbaseOAuth:()=>L,ErrorType:()=>i,OAuth2Client:()=>m,Syntax:()=>r,authModels:()=>o,defaultRequest:()=>v,defaultStorage:()=>g,generateRequestId:()=>E,toResponseError:()=>y});var r,i,o={};function s(){return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))}n.r(o),function(t){t.CLIENT_ID="client_id",t.CLIENT_SECRET="client_secret",t.RESPONSE_TYPE="response_type",t.SCOPE="scope",t.STATE="state",t.REDIRECT_URI="redirect_uri",t.ERROR="error",t.ERROR_DESCRIPTION="error_description",t.ERROR_URI="error_uri",t.GRANT_TYPE="grant_type",t.CODE="code",t.ACCESS_TOKEN="access_token",t.TOKEN_TYPE="token_type",t.EXPIRES_IN="expires_in",t.USERNAME="username",t.PASSWORD="password",t.REFRESH_TOKEN="refresh_token"}(r||(r={})),function(t){t.UNREACHABLE="unreachable",t.LOCAL="local",t.CANCELLED="cancelled",t.UNKNOWN="unknown",t.INVALID_ARGUMENT="invalid_argument",t.DEADLINE_EXCEEDED="deadline_exceeded",t.NOT_FOUND="not_found",t.ALREADY_EXISTS="already_exists",t.PERMISSION_DENIED="permission_denied",t.UNAUTHENTICATED="unauthenticated",t.RESOURCE_EXHAUSTED="resource_exhausted",t.FAILED_PRECONDITION="failed_precondition",t.ABORTED="aborted",t.OUT_OF_RANGE="out_of_range",t.UNIMPLEMENTED="unimplemented",t.INTERNAL="internal",t.UNAVAILABLE="unavailable",t.DATA_LOSS="data_loss",t.CAPTCHA_REQUIRED="captcha_required",t.CAPTCHA_INVALID="captcha_invalid",t.INVALID_PASSWORD="invalid_password",t.INVALID_STATUS="invalid_status",t.USER_PENDING="user_pending",t.USER_BLOCKED="user_blocked",t.INVALID_VERIFICATION_CODE="invalid_verification_code",t.TWO_FACTOR_REQUIRED="two_factor_required",t.INVALID_TWO_FACTOR="invalid_two_factor",t.INVALID_TWO_FACTOR_RECOVERY="invalid_two_factor_recovery",t.UNDER_REVIEW="under_review",t.INVALID_REQUEST="invalid_request",t.UNAUTHORIZED_CLIENT="unauthorized_client",t.ACCESS_DENIED="access_denied",t.UNSUPPORTED_RESPONSE_TYPE="unsupported_response_type",t.INVALID_SCOPE="invalid_scope",t.INVALID_GRANT="invalid_grant",t.SERVER_ERROR="server_error",t.TEMPORARILY_UNAVAILABLE="temporarily_unavailable",t.INTERACTION_REQUIRED="interaction_required",t.LOGIN_REQUIRED="login_required",t.ACCOUNT_SELECTION_REQUIRED="account_selection_required",t.CONSENT_REQUIRED="consent_required",t.INVALID_REQUEST_URI="invalid_request_uri",t.INVALID_REQUEST_OBJECT="invalid_request_object",t.REQUEST_NOT_SUPPORTED="request_not_supported",t.REQUEST_URI_NOT_SUPPORTED="request_uri_not_supported",t.REGISTRATION_NOT_SUPPORTED="registration_not_supported"}(i||(i={}));var a=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))},u=function(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=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(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},c=function(){function t(){this.fnPromiseMap=new Map}return t.prototype.run=function(t,e){return a(this,void 0,void 0,(function(){var n,r=this;return u(this,(function(i){switch(i.label){case 0:return[4,n=this.fnPromiseMap.get(t)];case 1:return i.sent()||(n=new Promise((function(n,i){a(r,void 0,void 0,(function(){var r,o,s;return u(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,4,5]),[4,this.runIdlePromise()];case 1:return a.sent(),r=e(),o=n,[4,r];case 2:return o.apply(void 0,[a.sent()]),[3,5];case 3:return s=a.sent(),i(s),[3,5];case 4:return this.fnPromiseMap.delete(t),[7];case 5:return[2]}}))}))})),this.fnPromiseMap.set(t,n)),[2,n]}}))}))},t.prototype.runIdlePromise=function(){return Promise.resolve()},t}(),l=function(){return l=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},l.apply(this,arguments)},h=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))},d=function(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=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(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},f="x-request-id",p="x-device-id",_="device_id",v=function(t,e){return h(this,void 0,void 0,(function(){var n,r,o,s,a;return d(this,(function(u){switch(u.label){case 0:n=null,r=null,u.label=1;case 1:return u.trys.push([1,4,,5]),(o=Object.assign({},e)).method||(o.method="GET"),o.body&&"string"!=typeof o.body&&(o.body=JSON.stringify(o.body)),[4,fetch(t,o)];case 2:return[4,u.sent().json()];case 3:return(null==(s=u.sent())?void 0:s.error)?(r=s).error_uri=new URL(t).pathname:n=s,[3,5];case 4:return a=u.sent(),r={error:i.UNREACHABLE,error_description:a.message,error_uri:new URL(t).pathname},[3,5];case 5:if(r)throw r;return[2,n]}}))}))},y=function(t,e){var n,r=e||{};if(t instanceof Error)n={error:r.error||i.LOCAL,error_description:r.error_description||t.message,error_uri:r.error_uri,details:r.details||t.stack};else{var o=t||{};n={error:r.error||o.error||i.LOCAL,error_description:r.error_description||o.error_description,error_uri:r.error_uri||o.error_uri,details:r.details||o.details}}return n};function E(){return s()}var g=new(function(){function t(){}return t.prototype.getItem=function(t){return h(this,void 0,void 0,(function(){return d(this,(function(e){return[2,window.localStorage.getItem(t)]}))}))},t.prototype.removeItem=function(t){return h(this,void 0,void 0,(function(){return d(this,(function(e){return window.localStorage.removeItem(t),[2]}))}))},t.prototype.setItem=function(t,e){return h(this,void 0,void 0,(function(){return d(this,(function(n){return window.localStorage.setItem(t,e),[2]}))}))},t.prototype.getItemSync=function(t){return window.localStorage.getItem(t)},t.prototype.removeItemSync=function(t){window.localStorage.removeItem(t)},t.prototype.setItemSync=function(t,e){window.localStorage.setItem(t,e)},t}());function R(t){var e=!0;return(null==t?void 0:t.expires_at)&&(null==t?void 0:t.access_token)&&(e=t.expires_at<new Date),e}var I,S,T,b=function(){function t(t){this.credentials=null,this.singlePromise=new c,this.tokenSectionName=t.tokenSectionName,this.storage=t.storage}return t.prototype.getStorageCredentialsSync=function(){var t=null,e=this.storage.getItemSync(this.tokenSectionName);if(null!=e)try{(null==(t=JSON.parse(e))?void 0:t.expires_at)&&(t.expires_at=new Date(t.expires_at))}catch(e){this.storage.removeItem(this.tokenSectionName),t=null}return t},t.prototype.setCredentials=function(t){return h(this,void 0,void 0,(function(){var e;return d(this,(function(n){switch(n.label){case 0:return(null==t?void 0:t.expires_in)?(t.expires_at=new Date(Date.now()+1e3*(t.expires_in-30)),this.storage?(e=JSON.stringify(t),[4,this.storage.setItem(this.tokenSectionName,e)]):[3,2]):[3,3];case 1:n.sent(),n.label=2;case 2:return this.credentials=t,[3,6];case 3:return this.storage?[4,this.storage.removeItem(this.tokenSectionName)]:[3,5];case 4:n.sent(),n.label=5;case 5:this.credentials=null,n.label=6;case 6:return[2]}}))}))},t.prototype.getCredentials=function(){return h(this,void 0,void 0,(function(){var t=this;return d(this,(function(e){return[2,this.singlePromise.run("getCredentials",(function(){return h(t,void 0,void 0,(function(){var t;return d(this,(function(e){switch(e.label){case 0:return R(this.credentials)?(t=this,[4,this.getStorageCredentials()]):[3,2];case 1:t.credentials=e.sent(),e.label=2;case 2:return[2,this.credentials]}}))}))}))]}))}))},t.prototype.getStorageCredentials=function(){return h(this,void 0,void 0,(function(){var t=this;return d(this,(function(e){return[2,this.singlePromise.run("_getStorageCredentials",(function(){return h(t,void 0,void 0,(function(){var t,e;return d(this,(function(n){switch(n.label){case 0:return t=null,[4,this.storage.getItem(this.tokenSectionName)];case 1:if(null==(e=n.sent()))return[3,5];n.label=2;case 2:return n.trys.push([2,3,,5]),(null==(t=JSON.parse(e))?void 0:t.expires_at)&&(t.expires_at=new Date(t.expires_at)),[3,5];case 3:return n.sent(),[4,this.storage.removeItem(this.tokenSectionName)];case 4:return n.sent(),t=null,[3,5];case 5:return[2,t]}}))}))}))]}))}))},t}(),m=function(){function t(e){this.singlePromise=new c,this.apiOrigin=e.apiOrigin,this.clientId=e.clientId,this.retry=this.formatRetry(e.retry,t.defaultRetry),e.baseRequest?this.baseRequest=e.baseRequest:this.baseRequest=v,this.tokenInURL=e.tokenInURL,this.headers=e.headers,this.storage=e.storage||g,this.localCredentials=new b({tokenSectionName:"credentials_".concat(e.clientId),storage:this.storage}),this.clientSecret=e.clientSecret,this.refreshTokenFunc=e.refreshTokenFunc||this.defaultRefreshTokenFunc,this.anonymousSignInFunc=e.anonymousSignInFunc}return t.prototype.setCredentials=function(t){return this.localCredentials.setCredentials(t)},t.prototype.getAccessToken=function(){return h(this,void 0,void 0,(function(){var t,e;return d(this,(function(n){switch(n.label){case 0:return[4,this.getCredentials()];case 1:return(null==(t=n.sent())?void 0:t.access_token)?[2,Promise.resolve(t.access_token)]:(e={error:i.UNAUTHENTICATED},[2,Promise.reject(e)])}}))}))},t.prototype.request=function(e,n){return h(this,void 0,void 0,(function(){var r,o,s,a,u,c,h;return d(this,(function(d){switch(d.label){case 0:return n||(n={}),r=this.formatRetry(n.retry,this.retry),n.headers=n.headers||{},this.headers&&(n.headers=l(l({},this.headers),n.headers)),n.headers[f]||(n.headers[f]=E()),n.headers[p]?[3,2]:[4,this.getDeviceId()];case 1:o=d.sent(),n.headers[p]=o,d.label=2;case 2:return(null==n?void 0:n.withCredentials)?[4,this.getCredentials()]:[3,4];case 3:return(s=d.sent())&&(this.tokenInURL?(e.indexOf("?")<0&&(e+="?"),e+="access_token=".concat(s.access_token)):n.headers.Authorization="".concat(s.token_type," ").concat(s.access_token)),[3,5];case 4:this.clientId&&e.indexOf("client_id")<0&&(e+=e.indexOf("?")<0?"?":"&",e+="client_id=".concat(this.clientId)),d.label=5;case 5:e.startsWith("/")&&(e=this.apiOrigin+e),a=null,u=r+1,c=0,d.label=6;case 6:if(!(c<u))return[3,15];d.label=7;case 7:return d.trys.push([7,9,,12]),[4,this.baseRequest(e,n)];case 8:return a=d.sent(),[3,15];case 9:return h=d.sent(),n.withCredentials&&h&&h.error===i.UNAUTHENTICATED?[4,this.setCredentials(null)]:[3,11];case 10:return d.sent(),[2,Promise.reject(h)];case 11:return c!==r&&h&&"unreachable"===h.error?[3,12]:[2,Promise.reject(h)];case 12:return[4,this.sleep(t.retryInterval)];case 13:d.sent(),d.label=14;case 14:return c++,[3,6];case 15:return[2,a]}}))}))},t.prototype.getCredentials=function(){return h(this,void 0,void 0,(function(){var t,e,n;return d(this,(function(r){switch(r.label){case 0:return[4,this.localCredentials.getCredentials()];case 1:return R(t=r.sent())?t&&"anonymous"===t.scope?this.anonymousSignInFunc?[4,this.anonymousSignInFunc(t)]:[3,5]:[3,8]:[3,10];case 2:return e=r.sent(),(n=e)?[3,4]:[4,this.localCredentials.getCredentials()];case 3:n=r.sent(),r.label=4;case 4:return t=n,[3,7];case 5:return[4,this.anonymousSignIn(t)];case 6:t=r.sent(),r.label=7;case 7:return[3,10];case 8:return[4,this.refreshToken(t)];case 9:t=r.sent(),r.label=10;case 10:return[2,t]}}))}))},t.prototype.getCredentialsSync=function(){return this.localCredentials.getStorageCredentialsSync()},t.prototype.getCredentialsAsync=function(){return this.getCredentials()},t.prototype.getScope=function(){return h(this,void 0,void 0,(function(){var t;return d(this,(function(e){switch(e.label){case 0:return[4,this.localCredentials.getCredentials()];case 1:return(t=e.sent())?[2,t.scope]:[2,this.unAuthenticatedError("credentials not found")]}}))}))},t.prototype.getGroups=function(){return h(this,void 0,void 0,(function(){var t;return d(this,(function(e){switch(e.label){case 0:return[4,this.localCredentials.getCredentials()];case 1:return(t=e.sent())?[2,t.groups]:[2,this.unAuthenticatedError("credentials not found")]}}))}))},t.prototype.checkRetry=function(e){var n=null;if(("number"!=typeof e||e<t.minRetry||e>t.maxRetry)&&(n={error:i.UNREACHABLE,error_description:"wrong options param: retry"}),n)throw n;return e},t.prototype.formatRetry=function(t,e){return void 0===t?e:this.checkRetry(t)},t.prototype.sleep=function(t){return h(this,void 0,void 0,(function(){return d(this,(function(e){return[2,new Promise((function(e){setTimeout((function(){e()}),t)}))]}))}))},t.prototype.refreshToken=function(t){return h(this,void 0,void 0,(function(){var e=this;return d(this,(function(n){return[2,this.singlePromise.run("_refreshToken",(function(){return h(e,void 0,void 0,(function(){var e,n;return d(this,(function(r){switch(r.label){case 0:if(!t||!t.refresh_token)return[2,this.unAuthenticatedError("no refresh token found in credentials")];r.label=1;case 1:return r.trys.push([1,4,,7]),[4,this.refreshTokenFunc(t.refresh_token)];case 2:return e=r.sent(),[4,this.localCredentials.setCredentials(e)];case 3:return r.sent(),[2,e];case 4:return(n=r.sent()).error!==i.INVALID_GRANT?[3,6]:[4,this.localCredentials.setCredentials(null)];case 5:return r.sent(),[2,this.unAuthenticatedError(n.error_description)];case 6:return[2,Promise.reject(n)];case 7:return[2]}}))}))}))]}))}))},t.prototype.anonymousSignIn=function(t){return h(this,void 0,void 0,(function(){var e=this;return d(this,(function(n){return[2,this.singlePromise.run("_anonymous",(function(){return h(e,void 0,void 0,(function(){var e,n;return d(this,(function(r){switch(r.label){case 0:if(!t||"anonymous"!==t.scope)return[2,this.unAuthenticatedError("no anonymous in credentials")];r.label=1;case 1:return r.trys.push([1,4,,7]),[4,this.request("/auth/v1/signin/anonymously",{method:"POST",body:{client_id:this.clientId,client_secret:this.clientSecret}})];case 2:return e=r.sent(),[4,this.localCredentials.setCredentials(e)];case 3:return r.sent(),[2,e];case 4:return(n=r.sent()).error!==i.INVALID_GRANT?[3,6]:[4,this.localCredentials.setCredentials(null)];case 5:return r.sent(),[2,this.unAuthenticatedError(n.error_description)];case 6:return[2,Promise.reject(n)];case 7:return[2]}}))}))}))]}))}))},t.prototype.defaultRefreshTokenFunc=function(t){return void 0===t||""===t?this.unAuthenticatedError("refresh token not found"):this.request("/auth/v1/token",{method:"POST",body:{client_id:this.clientId,client_secret:this.clientSecret,grant_type:"refresh_token",refresh_token:t}})},t.prototype.getDeviceId=function(){return h(this,void 0,void 0,(function(){var t;return d(this,(function(e){switch(e.label){case 0:return this.deviceID?[2,this.deviceID]:[4,this.storage.getItem(_)];case 1:return"string"==typeof(t=e.sent())&&t.length>=16&&t.length<=48?[3,3]:(t=s(),[4,this.storage.setItem(_,t)]);case 2:e.sent(),e.label=3;case 3:return this.deviceID=t,[2,t]}}))}))},t.prototype.unAuthenticatedError=function(t){var e={error:i.UNAUTHENTICATED,error_description:t};return Promise.reject(e)},t.defaultRetry=2,t.minRetry=0,t.maxRetry=5,t.retryInterval=1e3,t}();!function(t){t.AUTH_SIGN_IN_URL="/auth/v1/signin",t.AUTH_SIGN_IN_ANONYMOUSLY_URL="/auth/v1/signin/anonymously",t.AUTH_SIGN_IN_WITH_PROVIDER_URL="/auth/v1/signin/with/provider",t.AUTH_SIGN_UP_URL="/auth/v1/signup",t.AUTH_TOKEN_URL="/auth/v1/token",t.AUTH_REVOKE_URL="/auth/v1/revoke",t.PROVIDER_BIND_URL="/auth/v1/user/provider/bind",t.PROVIDER_TOKEN_URL="/auth/v1/provider/token",t.PROVIDER_URI_URL="/auth/v1/provider/uri",t.USER_ME_URL="/auth/v1/user/me",t.WEDA_USER_URL="/auth/v1/plugin/weda/userinfo",t.USER_QUERY_URL="/auth/v1/user/query",t.USER_PRIFILE_URL="/auth/v1/user/profile",t.USER_TRANS_BY_PROVIDER_URL="/auth/v1/user/trans/by/provider",t.VERIFICATION_URL="/auth/v1/verification",t.VERIFY_URL="/auth/v1/verification/verify",t.PROVIDER_LIST="/auth/v1/user/provider",t.PROVIDER_UNBIND_URL="/auth/v1/user/provider",t.CHECK_PWD_URL="/auth/v1/user/sudo",t.SUDO_URL="/auth/v1/user/sudo",t.BIND_CONTACT_URL="/auth/v1/user/contact",t.AUTH_SET_PASSWORD="/auth/v1/user/password",t.AUTH_RESET_PASSWORD="/auth/v1/reset",t.AUTH_GET_DEVICE_CODE="/auth/v1/device/code",t.CHECK_USERNAME="/auth/v1/checkUsername",t.CHECK_IF_USER_EXIST="/auth/v1/checkIfUserExist"}(I||(I={})),function(t){t.REGISTER="REGISTER",t.SIGN_IN="SIGN_IN",t.PASSWORD_RESET="PASSWORD_RESET",t.EMAIL_ADDRESS_CHANGE="EMAIL_ADDRESS_CHANGE",t.PHONE_NUMBER_CHANGE="PHONE_NUMBER_CHANGE"}(S||(S={})),function(t){t.INVALID_ARGUMENT="invalid_argument",t.DEADLINE_EXCEEDED="deadline_exceeded",t.NOT_FOUND="not_found",t.ALREADY_EXISTS="already_exists",t.PERMISSION_DENIED="permission_denied",t.ABORTED="aborted",t.OUT_OF_RANGE="out_of_range",t.UNIMPLEMENTED="unimplemented",t.INTERNAL="internal",t.UNAVAILABLE="unavailable",t.DATA_LOSS="data_loss",t.CAPTCHA_REQUIRED="captcha_required",t.CAPTCHA_INVALID="captcha_invalid",t.INVALID_PASSWORD="invalid_password",t.PASSWORD_NOT_SET="password_not_set",t.INVALID_STATUS="invalid_status",t.USER_PENDING="user_pending",t.USER_BLOCKED="user_blocked"}(T||(T={}));var C=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))},w=function(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=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(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},U=function(){function t(t){t.openURIWithCallback||(t.openURIWithCallback=this.getDefaultOpenURIWithCallback()),t.storage||(t.storage=g),this.config=t,this.tokenSectionName="captcha_".concat(t.clientId)}return t.prototype.request=function(t,e){return C(this,void 0,void 0,(function(){var n,r,i,o;return w(this,(function(s){switch(s.label){case 0:return e||(e={}),e.method||(e.method="GET"),n="".concat(e.method,":").concat(t),r=t,e.withCaptcha?[4,this.appendCaptchaTokenToURL(t,n,!1)]:[3,2];case 1:r=s.sent(),s.label=2;case 2:return s.trys.push([2,4,,7]),[4,this.config.request(r,e)];case 3:return i=s.sent(),[3,7];case 4:return"captcha_required"!==(o=s.sent()).error&&"captcha_invalid"!==o.error?[3,6]:[4,this.appendCaptchaTokenToURL(t,n,"captcha_invalid"===o.error)];case 5:return t=s.sent(),[2,this.config.request(t,e)];case 6:return[2,Promise.reject(o)];case 7:return[2,i]}}))}))},t.prototype.getDefaultOpenURIWithCallback=function(){if(window.location.search.indexOf("__captcha")>0&&(document.body.style.display="none"),null===document.getElementById("captcha_panel_wrap")){var t=document.createElement("div");t.style.cssText="background-color: rgba(0, 0, 0, 0.7);position: fixed;left: 0px;right: 0px;top: 0px;bottom: 0px;padding: 9vw 0 0 0;display: none;z-index:100;",t.setAttribute("id","captcha_panel_wrap"),setTimeout((function(){document.body.appendChild(t)}),0)}return this.defaultOpenURIWithCallback},t.prototype.defaultOpenURIWithCallback=function(t){return C(this,void 0,void 0,(function(){var e,n;return w(this,(function(r){return e=document.getElementById("captcha_panel_wrap"),n=document.createElement("iframe"),e.innerHTML="",n.setAttribute("src",t),n.setAttribute("id","review-panel-iframe"),n.style.cssText="min-width:355px;display:block;height:355px;margin:0 auto;background-color: rgb(255, 255, 255);border: none;",e.appendChild(n),e.style.display="block",[2,new Promise((function(t,r){n.onload=function(){try{var i=window.location,o=n.contentWindow.location;if(o.host+o.pathname===i.host+i.pathname){e.style.display="none";var s=new URLSearchParams(o.search),a=s.get("captcha_token");return a?t({captcha_token:a,expires_in:Number(s.get("expires_in"))}):r({error:s.get("error"),error_description:s.get("error_description")})}e.style.display="block"}catch(t){e.style.display="block"}}}))]}))}))},t.prototype.getCaptchaToken=function(t,e){return C(this,void 0,void 0,(function(){var n,r,i,o,s;return w(this,(function(a){switch(a.label){case 0:return t?[3,2]:[4,this.findCaptchaToken()];case 1:if(n=a.sent())return[2,n];a.label=2;case 2:return r="".concat(window.location.origin+window.location.pathname,"?__captcha=on"),[4,this.config.request("/auth/v1/captcha/init",{method:"POST",body:{client_id:this.config.clientId,redirect_uri:r,state:e},withCredentials:!1})];case 3:return(i=a.sent()).captcha_token?(o={captcha_token:i.captcha_token,expires_in:i.expires_in},this.saveCaptchaToken(o),[2,i.captcha_token]):[4,this.config.openURIWithCallback(i.url)];case 4:return s=a.sent(),this.saveCaptchaToken(s),[2,s.captcha_token]}}))}))},t.prototype.appendCaptchaTokenToURL=function(t,e,n){return C(this,void 0,void 0,(function(){var r;return w(this,(function(i){switch(i.label){case 0:return[4,this.getCaptchaToken(n,e)];case 1:return r=i.sent(),t.indexOf("?")>0?t+="&captcha_token=".concat(r):t+="?captcha_token=".concat(r),[2,t]}}))}))},t.prototype.saveCaptchaToken=function(t){return C(this,void 0,void 0,(function(){var e;return w(this,(function(n){switch(n.label){case 0:return t.expires_at=new Date(Date.now()+1e3*(t.expires_in-10)),e=JSON.stringify(t),[4,this.config.storage.setItem(this.tokenSectionName,e)];case 1:return n.sent(),[2]}}))}))},t.prototype.findCaptchaToken=function(){return C(this,void 0,void 0,(function(){var t,e;return w(this,(function(n){switch(n.label){case 0:return[4,this.config.storage.getItem(this.tokenSectionName)];case 1:if(null==(t=n.sent()))return[3,5];n.label=2;case 2:return n.trys.push([2,3,,5]),(null==(e=JSON.parse(t))?void 0:e.expires_at)&&(e.expires_at=new Date(e.expires_at)),e.expires_at<new Date?[2,null]:[2,e.captcha_token];case 3:return n.sent(),[4,this.config.storage.removeItem(this.tokenSectionName)];case 4:return n.sent(),[2,null];case 5:return[2,null]}}))}))},t}(),O=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))},A=function(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=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(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},N=function(){function t(t){var e=t.request,n=t.credentialsClient;if(!n){var r={apiOrigin:t.apiOrigin,clientId:t.clientId,storage:t.storage};n=new m(r)}if(!e){var i=n.request.bind(n),o=new U({clientId:t.clientId,request:i,storage:t.storage});e=o.request.bind(o)}this.config={apiOrigin:t.apiOrigin,clientId:t.clientId,request:e,credentialsClient:n,storage:t.storage||g}}return t.parseParamsToSearch=function(t){return Object.keys(t).forEach((function(e){t[e]||delete t[e]})),new URLSearchParams(t).toString()},t.prototype.signIn=function(t){return O(this,void 0,void 0,(function(){var e;return A(this,(function(n){switch(n.label){case 0:return[4,this.config.request(I.AUTH_SIGN_IN_URL,{method:"POST",body:t})];case 1:return e=n.sent(),[4,this.config.credentialsClient.setCredentials(e)];case 2:return n.sent(),[2,Promise.resolve(e)]}}))}))},t.prototype.signInAnonymously=function(t){return void 0===t&&(t={}),O(this,void 0,void 0,(function(){var e;return A(this,(function(n){switch(n.label){case 0:return[4,this.config.request(I.AUTH_SIGN_IN_ANONYMOUSLY_URL,{method:"POST",body:t})];case 1:return e=n.sent(),[4,this.config.credentialsClient.setCredentials(e)];case 2:return n.sent(),[2,Promise.resolve(e)]}}))}))},t.prototype.signUp=function(t){return O(this,void 0,void 0,(function(){var e;return A(this,(function(n){switch(n.label){case 0:return[4,this.config.request(I.AUTH_SIGN_UP_URL,{method:"POST",body:t})];case 1:return e=n.sent(),[4,this.config.credentialsClient.setCredentials(e)];case 2:return n.sent(),[2,Promise.resolve(e)]}}))}))},t.prototype.signOut=function(){return O(this,void 0,void 0,(function(){var t,e;return A(this,(function(n){switch(n.label){case 0:return[4,this.config.credentialsClient.getAccessToken()];case 1:return t=n.sent(),[4,this.config.request(I.AUTH_REVOKE_URL,{method:"POST",body:{token:t}})];case 2:return e=n.sent(),[4,this.config.credentialsClient.setCredentials()];case 3:return n.sent(),[2,Promise.resolve(e)]}}))}))},t.prototype.getVerification=function(t){return O(this,void 0,void 0,(function(){var e;return A(this,(function(n){switch(n.label){case 0:return e=!1,"CUR_USER"!==t.target?[3,1]:(e=!0,[3,3]);case 1:return[4,this.hasLoginState()];case 2:n.sent()&&(e=!0),n.label=3;case 3:return[2,this.config.request(I.VERIFICATION_URL,{method:"POST",body:t,withCaptcha:!0,withCredentials:e})]}}))}))},t.prototype.verify=function(t){return O(this,void 0,void 0,(function(){return A(this,(function(e){return[2,this.config.request(I.VERIFY_URL,{method:"POST",body:t})]}))}))},t.prototype.genProviderRedirectUri=function(t){return O(this,void 0,void 0,(function(){var e,n;return A(this,(function(r){return e="".concat(I.PROVIDER_URI_URL,"?client_id=").concat(this.config.clientId,"&provider_id=").concat(t.provider_id,"&redirect_uri=").concat(encodeURIComponent(t.provider_redirect_uri),"&state=").concat(t.state),(n=t.other_params)&&"string"==typeof n.sign_out_uri&&n.sign_out_uri.length>0&&(e+="&other_params[sign_out_uri]=".concat(n.sign_out_uri)),[2,this.config.request(e,{method:"GET"})]}))}))},t.prototype.grantProviderToken=function(t){return O(this,void 0,void 0,(function(){return A(this,(function(e){return[2,this.config.request(I.PROVIDER_TOKEN_URL,{method:"POST",body:t})]}))}))},t.prototype.patchProviderToken=function(t){return O(this,void 0,void 0,(function(){return A(this,(function(e){return[2,this.config.request(I.PROVIDER_TOKEN_URL,{method:"PATCH",body:t})]}))}))},t.prototype.signInWithProvider=function(t){return O(this,void 0,void 0,(function(){var e;return A(this,(function(n){switch(n.label){case 0:return[4,this.config.request(I.AUTH_SIGN_IN_WITH_PROVIDER_URL,{method:"POST",body:t})];case 1:return e=n.sent(),[4,this.config.credentialsClient.setCredentials(e)];case 2:return n.sent(),[2,Promise.resolve(e)]}}))}))},t.prototype.bindWithProvider=function(t){return O(this,void 0,void 0,(function(){return A(this,(function(e){return[2,this.config.request(I.PROVIDER_BIND_URL,{method:"POST",body:t,withCredentials:!0})]}))}))},t.prototype.getUserProfile=function(){return O(this,void 0,void 0,(function(){return A(this,(function(t){return[2,this.getUserInfo()]}))}))},t.prototype.getUserInfo=function(){return O(this,void 0,void 0,(function(){var t;return A(this,(function(e){switch(e.label){case 0:return[4,this.config.request(I.USER_ME_URL,{method:"GET",withCredentials:!0})];case 1:return(t=e.sent()).sub&&(t.uid=t.sub),[2,t]}}))}))},t.prototype.getWedaUserInfo=function(){return O(this,void 0,void 0,(function(){return A(this,(function(t){switch(t.label){case 0:return[4,this.config.request(I.WEDA_USER_URL,{method:"GET",withCredentials:!0})];case 1:return[2,t.sent()]}}))}))},t.prototype.deleteMe=function(e){return O(this,void 0,void 0,(function(){var n;return A(this,(function(r){return n="".concat(I.USER_ME_URL,"?").concat(t.parseParamsToSearch(e)),[2,this.config.request(n,{method:"DELETE",withCredentials:!0})]}))}))},t.prototype.hasLoginState=function(){return O(this,void 0,void 0,(function(){return A(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.config.credentialsClient.getAccessToken()];case 1:return t.sent(),[2,!0];case 2:return t.sent(),[2,!1];case 3:return[2]}}))}))},t.prototype.hasLoginStateSync=function(){return this.config.credentialsClient.getCredentialsSync()},t.prototype.getLoginState=function(){return O(this,void 0,void 0,(function(){return A(this,(function(t){return[2,this.config.credentialsClient.getCredentialsAsync()]}))}))},t.prototype.transByProvider=function(t){return O(this,void 0,void 0,(function(){return A(this,(function(e){return[2,this.config.request(I.USER_TRANS_BY_PROVIDER_URL,{method:"PATCH",body:t,withCredentials:!0})]}))}))},t.prototype.grantToken=function(t){return O(this,void 0,void 0,(function(){return A(this,(function(e){return[2,this.config.request(I.AUTH_TOKEN_URL,{method:"POST",body:t})]}))}))},t.prototype.getProviders=function(){return O(this,void 0,void 0,(function(){return A(this,(function(t){return[2,this.config.request(I.PROVIDER_LIST,{method:"GET",withCredentials:!0})]}))}))},t.prototype.unbindProvider=function(t){return O(this,void 0,void 0,(function(){return A(this,(function(e){return[2,this.config.request("".concat(I.PROVIDER_UNBIND_URL,"/").concat(t.provider_id),{method:"DELETE",withCredentials:!0})]}))}))},t.prototype.checkPassword=function(t){return O(this,void 0,void 0,(function(){return A(this,(function(e){return[2,this.config.request("".concat(I.CHECK_PWD_URL),{method:"POST",withCredentials:!0,body:t})]}))}))},t.prototype.bindPhone=function(t){return O(this,void 0,void 0,(function(){return A(this,(function(e){return[2,this.config.request("".concat(I.BIND_CONTACT_URL),{method:"PATCH",withCredentials:!0,body:t})]}))}))},t.prototype.bindEmail=function(t){return O(this,void 0,void 0,(function(){return A(this,(function(e){return[2,this.config.request("".concat(I.BIND_CONTACT_URL),{method:"PATCH",withCredentials:!0,body:t})]}))}))},t.prototype.setPassword=function(t){return O(this,void 0,void 0,(function(){return A(this,(function(e){return[2,this.config.request("".concat(I.AUTH_SET_PASSWORD),{method:"PATCH",withCredentials:!0,body:t})]}))}))},t.prototype.updatePasswordByOld=function(t){return O(this,void 0,void 0,(function(){var e;return A(this,(function(n){switch(n.label){case 0:return[4,this.sudo({password:t.old_password})];case 1:return e=n.sent(),[2,this.setPassword({sudo_token:e.sudo_token,new_password:t.new_password})]}}))}))},t.prototype.sudo=function(t){return O(this,void 0,void 0,(function(){return A(this,(function(e){return[2,this.config.request("".concat(I.SUDO_URL),{method:"POST",withCredentials:!0,body:t})]}))}))},t.prototype.getCurUserVerification=function(t){return O(this,void 0,void 0,(function(){return A(this,(function(e){return t.target="CUR_USER",[2,this.config.request(I.VERIFICATION_URL,{method:"POST",body:t,withCredentials:!0,withCaptcha:!0})]}))}))},t.prototype.changeBindedProvider=function(t){return O(this,void 0,void 0,(function(){return A(this,(function(e){return[2,this.config.request("".concat(I.PROVIDER_LIST,"/").concat(t.provider_id,"/trans"),{method:"POST",body:{provider_trans_token:t.trans_token},withCredentials:!0})]}))}))},t.prototype.setUserProfile=function(t){return O(this,void 0,void 0,(function(){return A(this,(function(e){return[2,this.config.request(I.USER_PRIFILE_URL,{method:"PATCH",body:t,withCredentials:!0})]}))}))},t.prototype.queryUserProfile=function(t){return O(this,void 0,void 0,(function(){var e;return A(this,(function(n){return e=new URLSearchParams(t),[2,this.config.request("".concat(I.USER_QUERY_URL,"?").concat(e.toString()),{method:"GET",withCredentials:!0})]}))}))},t.prototype.setCustomSignFunc=function(t){this.getCustomSignTicketFn=t},t.prototype.signInWithCustomTicket=function(){return O(this,void 0,void 0,(function(){var t;return A(this,(function(e){switch(e.label){case 0:return[4,this.getCustomSignTicketFn()];case 1:return t=e.sent(),[2,this.signInWithProvider({provider_id:"custom",provider_token:t})]}}))}))},t.prototype.resetPassword=function(t){return O(this,void 0,void 0,(function(){return A(this,(function(e){return[2,this.config.request(I.AUTH_RESET_PASSWORD,{method:"POST",body:t})]}))}))},t.prototype.deviceAuthorize=function(t){return O(this,void 0,void 0,(function(){return A(this,(function(e){return[2,this.config.request(I.AUTH_GET_DEVICE_CODE,{method:"POST",body:t,withCredentials:!0})]}))}))},t.prototype.checkUsername=function(t){return O(this,void 0,void 0,(function(){return A(this,(function(e){return[2,this.config.request(I.CHECK_USERNAME,{method:"GET",body:t,withCredentials:!0})]}))}))},t.prototype.checkIfUserExist=function(t){return O(this,void 0,void 0,(function(){var e;return A(this,(function(n){return e=new URLSearchParams(t),[2,this.config.request("".concat(I.CHECK_IF_USER_EXIST,"?").concat(e.toString()),{method:"GET"})]}))}))},t.prototype.loginScope=function(){return O(this,void 0,void 0,(function(){return A(this,(function(t){return[2,this.config.credentialsClient.getScope()]}))}))},t.prototype.loginGroups=function(){return O(this,void 0,void 0,(function(){return A(this,(function(t){return[2,this.config.credentialsClient.getGroups()]}))}))},t}(),P=function(){},D=function(){return D=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},D.apply(this,arguments)},L=function(t){var e=t.apiOrigin,n=t.clientId,r=t.storage,i=t.request,o=t.anonymousSignInFunc;this.oauth2client=new m({apiOrigin:e,clientId:n,storage:r,baseRequest:i,anonymousSignInFunc:o}),this.authApi=new N(D(D({credentialsClient:this.oauth2client},t),{request:i?this.oauth2client.request.bind(this.oauth2client):void 0}))}},118:function(t,e,n){var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),i(n(543),e)}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={exports:{}};return t[r].call(o.exports,o,o.exports,n),o.exports}return 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.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})},n(118)})()));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("cloudbase_oauth",[],t):"object"==typeof exports?exports.cloudbase_oauth=t():e.cloudbase_oauth=t()}("undefined"!=typeof window?window:this,(()=>(()=>{"use strict";var e={99:(e,t,n)=>{n.r(t),n.d(t,{Auth:()=>L,AuthClient:()=>k,CloudbaseOAuth:()=>q,ErrorType:()=>i,OAuth2Client:()=>C,Syntax:()=>r,authModels:()=>c,defaultRequest:()=>R,defaultStorage:()=>T,generateRequestId:()=>S,toResponseError:()=>I});var r,i,o,s,a,u,c={};function l(){return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}n.r(c),function(e){e.CLIENT_ID="client_id",e.CLIENT_SECRET="client_secret",e.RESPONSE_TYPE="response_type",e.SCOPE="scope",e.STATE="state",e.REDIRECT_URI="redirect_uri",e.ERROR="error",e.ERROR_DESCRIPTION="error_description",e.ERROR_URI="error_uri",e.GRANT_TYPE="grant_type",e.CODE="code",e.ACCESS_TOKEN="access_token",e.TOKEN_TYPE="token_type",e.EXPIRES_IN="expires_in",e.USERNAME="username",e.PASSWORD="password",e.REFRESH_TOKEN="refresh_token"}(r||(r={})),function(e){e.UNREACHABLE="unreachable",e.LOCAL="local",e.CANCELLED="cancelled",e.UNKNOWN="unknown",e.INVALID_ARGUMENT="invalid_argument",e.DEADLINE_EXCEEDED="deadline_exceeded",e.NOT_FOUND="not_found",e.ALREADY_EXISTS="already_exists",e.PERMISSION_DENIED="permission_denied",e.UNAUTHENTICATED="unauthenticated",e.RESOURCE_EXHAUSTED="resource_exhausted",e.FAILED_PRECONDITION="failed_precondition",e.ABORTED="aborted",e.OUT_OF_RANGE="out_of_range",e.UNIMPLEMENTED="unimplemented",e.INTERNAL="internal",e.UNAVAILABLE="unavailable",e.DATA_LOSS="data_loss",e.CAPTCHA_REQUIRED="captcha_required",e.CAPTCHA_INVALID="captcha_invalid",e.INVALID_PASSWORD="invalid_password",e.INVALID_STATUS="invalid_status",e.USER_PENDING="user_pending",e.USER_BLOCKED="user_blocked",e.INVALID_VERIFICATION_CODE="invalid_verification_code",e.TWO_FACTOR_REQUIRED="two_factor_required",e.INVALID_TWO_FACTOR="invalid_two_factor",e.INVALID_TWO_FACTOR_RECOVERY="invalid_two_factor_recovery",e.UNDER_REVIEW="under_review",e.INVALID_REQUEST="invalid_request",e.UNAUTHORIZED_CLIENT="unauthorized_client",e.ACCESS_DENIED="access_denied",e.UNSUPPORTED_RESPONSE_TYPE="unsupported_response_type",e.INVALID_SCOPE="invalid_scope",e.INVALID_GRANT="invalid_grant",e.SERVER_ERROR="server_error",e.TEMPORARILY_UNAVAILABLE="temporarily_unavailable",e.INTERACTION_REQUIRED="interaction_required",e.LOGIN_REQUIRED="login_required",e.ACCOUNT_SELECTION_REQUIRED="account_selection_required",e.CONSENT_REQUIRED="consent_required",e.INVALID_REQUEST_URI="invalid_request_uri",e.INVALID_REQUEST_OBJECT="invalid_request_object",e.REQUEST_NOT_SUPPORTED="request_not_supported",e.REQUEST_URI_NOT_SUPPORTED="request_uri_not_supported",e.REGISTRATION_NOT_SUPPORTED="registration_not_supported"}(i||(i={})),function(e){e.AUTH_SIGN_IN_URL="/auth/v1/signin",e.AUTH_SIGN_IN_ANONYMOUSLY_URL="/auth/v1/signin/anonymously",e.AUTH_SIGN_IN_WITH_PROVIDER_URL="/auth/v1/signin/with/provider",e.AUTH_SIGN_UP_URL="/auth/v1/signup",e.AUTH_TOKEN_URL="/auth/v1/token",e.AUTH_REVOKE_URL="/auth/v1/revoke",e.PROVIDER_BIND_URL="/auth/v1/user/provider/bind",e.PROVIDER_TOKEN_URL="/auth/v1/provider/token",e.PROVIDER_URI_URL="/auth/v1/provider/uri",e.USER_ME_URL="/auth/v1/user/me",e.WEDA_USER_URL="/auth/v1/plugin/weda/userinfo",e.USER_QUERY_URL="/auth/v1/user/query",e.USER_PRIFILE_URL="/auth/v1/user/profile",e.USER_TRANS_BY_PROVIDER_URL="/auth/v1/user/trans/by/provider",e.VERIFICATION_URL="/auth/v1/verification",e.VERIFY_URL="/auth/v1/verification/verify",e.PROVIDER_LIST="/auth/v1/user/provider",e.PROVIDER_UNBIND_URL="/auth/v1/user/provider",e.CHECK_PWD_URL="/auth/v1/user/sudo",e.SUDO_URL="/auth/v1/user/sudo",e.BIND_CONTACT_URL="/auth/v1/user/contact",e.AUTH_SET_PASSWORD="/auth/v1/user/password",e.AUTH_RESET_PASSWORD="/auth/v1/reset",e.AUTH_GET_DEVICE_CODE="/auth/v1/device/code",e.CHECK_USERNAME="/auth/v1/checkUsername",e.CHECK_IF_USER_EXIST="/auth/v1/checkIfUserExist"}(o||(o={})),function(e){e.AUTH_SIGN_IN_URL="/auth/v2/signin/username",e.AUTH_TOKEN_URL="/auth/v2/token",e.USER_ME_URL="/auth/v2/user/me"}(s||(s={})),function(e){e.REGISTER="REGISTER",e.SIGN_IN="SIGN_IN",e.PASSWORD_RESET="PASSWORD_RESET",e.EMAIL_ADDRESS_CHANGE="EMAIL_ADDRESS_CHANGE",e.PHONE_NUMBER_CHANGE="PHONE_NUMBER_CHANGE"}(a||(a={})),function(e){e.INVALID_ARGUMENT="invalid_argument",e.DEADLINE_EXCEEDED="deadline_exceeded",e.NOT_FOUND="not_found",e.ALREADY_EXISTS="already_exists",e.PERMISSION_DENIED="permission_denied",e.ABORTED="aborted",e.OUT_OF_RANGE="out_of_range",e.UNIMPLEMENTED="unimplemented",e.INTERNAL="internal",e.UNAVAILABLE="unavailable",e.DATA_LOSS="data_loss",e.CAPTCHA_REQUIRED="captcha_required",e.CAPTCHA_INVALID="captcha_invalid",e.INVALID_PASSWORD="invalid_password",e.PASSWORD_NOT_SET="password_not_set",e.INVALID_STATUS="invalid_status",e.USER_PENDING="user_pending",e.USER_BLOCKED="user_blocked"}(u||(u={}));var h=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},d=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=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(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},f=function(){function e(){this.fnPromiseMap=new Map}return e.prototype.run=function(e,t){return h(this,void 0,void 0,(function(){var n,r=this;return d(this,(function(i){switch(i.label){case 0:return[4,n=this.fnPromiseMap.get(e)];case 1:return i.sent()||(n=new Promise((function(n,i){h(r,void 0,void 0,(function(){var r,o,s;return d(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,4,5]),[4,this.runIdlePromise()];case 1:return a.sent(),r=t(),o=n,[4,r];case 2:return o.apply(void 0,[a.sent()]),[3,5];case 3:return s=a.sent(),i(s),[3,5];case 4:return this.fnPromiseMap.delete(e),[7];case 5:return[2]}}))}))})),this.fnPromiseMap.set(e,n)),[2,n]}}))}))},e.prototype.runIdlePromise=function(){return Promise.resolve()},e}(),p=function(){return p=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},p.apply(this,arguments)},_=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},v=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=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(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},y="x-request-id",E="x-device-id",g="device_id",R=function(e,t){return _(this,void 0,void 0,(function(){var n,r,o,s,a;return v(this,(function(u){switch(u.label){case 0:n=null,r=null,u.label=1;case 1:return u.trys.push([1,4,,5]),(o=Object.assign({},t)).method||(o.method="GET"),o.body&&"string"!=typeof o.body&&(o.body=JSON.stringify(o.body)),[4,fetch(e,o)];case 2:return[4,u.sent().json()];case 3:return(null==(s=u.sent())?void 0:s.error)?(r=s).error_uri=new URL(e).pathname:n=s,[3,5];case 4:return a=u.sent(),r={error:i.UNREACHABLE,error_description:a.message,error_uri:new URL(e).pathname},[3,5];case 5:if(r)throw r;return[2,n]}}))}))},I=function(e,t){var n,r=t||{};if(e instanceof Error)n={error:r.error||i.LOCAL,error_description:r.error_description||e.message,error_uri:r.error_uri,details:r.details||e.stack};else{var o=e||{};n={error:r.error||o.error||i.LOCAL,error_description:r.error_description||o.error_description,error_uri:r.error_uri||o.error_uri,details:r.details||o.details}}return n};function S(){return l()}var T=new(function(){function e(){}return e.prototype.getItem=function(e){return _(this,void 0,void 0,(function(){return v(this,(function(t){return[2,window.localStorage.getItem(e)]}))}))},e.prototype.removeItem=function(e){return _(this,void 0,void 0,(function(){return v(this,(function(t){return window.localStorage.removeItem(e),[2]}))}))},e.prototype.setItem=function(e,t){return _(this,void 0,void 0,(function(){return v(this,(function(n){return window.localStorage.setItem(e,t),[2]}))}))},e.prototype.getItemSync=function(e){return window.localStorage.getItem(e)},e.prototype.removeItemSync=function(e){window.localStorage.removeItem(e)},e.prototype.setItemSync=function(e,t){window.localStorage.setItem(e,t)},e}());function m(e){var t=!0;return(null==e?void 0:e.expires_at)&&(null==e?void 0:e.access_token)&&(t=e.expires_at<new Date),t}var b=function(){function e(e){this.credentials=null,this.singlePromise=new f,this.tokenSectionName=e.tokenSectionName,this.storage=e.storage}return e.prototype.getStorageCredentialsSync=function(){var e=null,t=this.storage.getItemSync(this.tokenSectionName);if(null!=t)try{(null==(e=JSON.parse(t))?void 0:e.expires_at)&&(e.expires_at=new Date(e.expires_at))}catch(t){this.storage.removeItem(this.tokenSectionName),e=null}return e},e.prototype.setCredentials=function(e){return _(this,void 0,void 0,(function(){var t;return v(this,(function(n){switch(n.label){case 0:return(null==e?void 0:e.expires_in)?(e.expires_at=new Date(Date.now()+1e3*(e.expires_in-30)),this.storage?(t=JSON.stringify(e),[4,this.storage.setItem(this.tokenSectionName,t)]):[3,2]):[3,3];case 1:n.sent(),n.label=2;case 2:return this.credentials=e,[3,6];case 3:return this.storage?[4,this.storage.removeItem(this.tokenSectionName)]:[3,5];case 4:n.sent(),n.label=5;case 5:this.credentials=null,n.label=6;case 6:return[2]}}))}))},e.prototype.getCredentials=function(){return _(this,void 0,void 0,(function(){var e=this;return v(this,(function(t){return[2,this.singlePromise.run("getCredentials",(function(){return _(e,void 0,void 0,(function(){var e;return v(this,(function(t){switch(t.label){case 0:return m(this.credentials)?(e=this,[4,this.getStorageCredentials()]):[3,2];case 1:e.credentials=t.sent(),t.label=2;case 2:return[2,this.credentials]}}))}))}))]}))}))},e.prototype.getStorageCredentials=function(){return _(this,void 0,void 0,(function(){var e=this;return v(this,(function(t){return[2,this.singlePromise.run("_getStorageCredentials",(function(){return _(e,void 0,void 0,(function(){var e,t;return v(this,(function(n){switch(n.label){case 0:return e=null,[4,this.storage.getItem(this.tokenSectionName)];case 1:if(null==(t=n.sent()))return[3,5];n.label=2;case 2:return n.trys.push([2,3,,5]),(null==(e=JSON.parse(t))?void 0:e.expires_at)&&(e.expires_at=new Date(e.expires_at)),[3,5];case 3:return n.sent(),[4,this.storage.removeItem(this.tokenSectionName)];case 4:return n.sent(),e=null,[3,5];case 5:return[2,e]}}))}))}))]}))}))},e}(),C=function(){function e(t){this.singlePromise=new f,this.apiOrigin=t.apiOrigin,this.clientId=t.clientId,this.retry=this.formatRetry(t.retry,e.defaultRetry),t.baseRequest?this.baseRequest=t.baseRequest:this.baseRequest=R,this.tokenInURL=t.tokenInURL,this.headers=t.headers,this.storage=t.storage||T,this.localCredentials=new b({tokenSectionName:"credentials_".concat(t.clientId),storage:this.storage}),this.clientSecret=t.clientSecret,this.refreshTokenFunc=t.refreshTokenFunc||this.defaultRefreshTokenFunc,this.anonymousSignInFunc=t.anonymousSignInFunc}return e.prototype.setCredentials=function(e){return this.localCredentials.setCredentials(e)},e.prototype.getAccessToken=function(){return _(this,void 0,void 0,(function(){var e,t;return v(this,(function(n){switch(n.label){case 0:return[4,this.getCredentials()];case 1:return(null==(e=n.sent())?void 0:e.access_token)?[2,Promise.resolve(e.access_token)]:(t={error:i.UNAUTHENTICATED},[2,Promise.reject(t)])}}))}))},e.prototype.request=function(t,n){return _(this,void 0,void 0,(function(){var r,o,s,a,u,c,l;return v(this,(function(h){switch(h.label){case 0:return n||(n={}),r=this.formatRetry(n.retry,this.retry),n.headers=n.headers||{},this.headers&&(n.headers=p(p({},this.headers),n.headers)),n.headers[y]||(n.headers[y]=S()),n.headers[E]?[3,2]:[4,this.getDeviceId()];case 1:o=h.sent(),n.headers[E]=o,h.label=2;case 2:return(null==n?void 0:n.withCredentials)?[4,this.getCredentials()]:[3,4];case 3:return(s=h.sent())&&(this.tokenInURL?(t.indexOf("?")<0&&(t+="?"),t+="access_token=".concat(s.access_token)):n.headers.Authorization="".concat(s.token_type," ").concat(s.access_token)),[3,5];case 4:this.clientId&&t.indexOf("client_id")<0&&(t+=t.indexOf("?")<0?"?":"&",t+="client_id=".concat(this.clientId)),h.label=5;case 5:t.startsWith("/")&&(t=this.apiOrigin+t),a=null,u=r+1,c=0,h.label=6;case 6:if(!(c<u))return[3,15];h.label=7;case 7:return h.trys.push([7,9,,12]),[4,this.baseRequest(t,n)];case 8:return a=h.sent(),[3,15];case 9:return l=h.sent(),n.withCredentials&&l&&l.error===i.UNAUTHENTICATED?[4,this.setCredentials(null)]:[3,11];case 10:return h.sent(),[2,Promise.reject(l)];case 11:return c!==r&&l&&"unreachable"===l.error?[3,12]:[2,Promise.reject(l)];case 12:return[4,this.sleep(e.retryInterval)];case 13:h.sent(),h.label=14;case 14:return c++,[3,6];case 15:return[2,a]}}))}))},e.prototype.getCredentials=function(){return _(this,void 0,void 0,(function(){var e,t,n;return v(this,(function(r){switch(r.label){case 0:return[4,this.localCredentials.getCredentials()];case 1:return m(e=r.sent())?e&&"anonymous"===e.scope?this.anonymousSignInFunc?[4,this.anonymousSignInFunc(e)]:[3,5]:[3,8]:[3,10];case 2:return t=r.sent(),(n=t)?[3,4]:[4,this.localCredentials.getCredentials()];case 3:n=r.sent(),r.label=4;case 4:return e=n,[3,7];case 5:return[4,this.anonymousSignIn(e)];case 6:e=r.sent(),r.label=7;case 7:return[3,10];case 8:return[4,this.refreshToken(e)];case 9:e=r.sent(),r.label=10;case 10:return[2,e]}}))}))},e.prototype.getCredentialsSync=function(){return this.localCredentials.getStorageCredentialsSync()},e.prototype.getCredentialsAsync=function(){return this.getCredentials()},e.prototype.getScope=function(){return _(this,void 0,void 0,(function(){var e;return v(this,(function(t){switch(t.label){case 0:return[4,this.localCredentials.getCredentials()];case 1:return(e=t.sent())?[2,e.scope]:[2,this.unAuthenticatedError("credentials not found")]}}))}))},e.prototype.getGroups=function(){return _(this,void 0,void 0,(function(){var e;return v(this,(function(t){switch(t.label){case 0:return[4,this.localCredentials.getCredentials()];case 1:return(e=t.sent())?[2,e.groups]:[2,this.unAuthenticatedError("credentials not found")]}}))}))},e.prototype.refreshToken=function(e){return _(this,void 0,void 0,(function(){var t=this;return v(this,(function(n){return[2,this.singlePromise.run("_refreshToken",(function(){return _(t,void 0,void 0,(function(){var t,n;return v(this,(function(r){switch(r.label){case 0:if(!e||!e.refresh_token)return[2,this.unAuthenticatedError("no refresh token found in credentials")];r.label=1;case 1:return r.trys.push([1,4,,7]),[4,this.refreshTokenFunc(e.refresh_token,e)];case 2:return t=r.sent(),[4,this.localCredentials.setCredentials(t)];case 3:return r.sent(),[2,t];case 4:return(n=r.sent()).error!==i.INVALID_GRANT?[3,6]:[4,this.localCredentials.setCredentials(null)];case 5:return r.sent(),[2,this.unAuthenticatedError(n.error_description)];case 6:return[2,Promise.reject(n)];case 7:return[2]}}))}))}))]}))}))},e.prototype.checkRetry=function(t){var n=null;if(("number"!=typeof t||t<e.minRetry||t>e.maxRetry)&&(n={error:i.UNREACHABLE,error_description:"wrong options param: retry"}),n)throw n;return t},e.prototype.formatRetry=function(e,t){return void 0===e?t:this.checkRetry(e)},e.prototype.sleep=function(e){return _(this,void 0,void 0,(function(){return v(this,(function(t){return[2,new Promise((function(t){setTimeout((function(){t()}),e)}))]}))}))},e.prototype.anonymousSignIn=function(e){return _(this,void 0,void 0,(function(){var t=this;return v(this,(function(n){return[2,this.singlePromise.run("_anonymous",(function(){return _(t,void 0,void 0,(function(){var t,n;return v(this,(function(r){switch(r.label){case 0:if(!e||"anonymous"!==e.scope)return[2,this.unAuthenticatedError("no anonymous in credentials")];r.label=1;case 1:return r.trys.push([1,4,,7]),[4,this.request("/auth/v1/signin/anonymously",{method:"POST",body:{client_id:this.clientId,client_secret:this.clientSecret}})];case 2:return t=r.sent(),[4,this.localCredentials.setCredentials(t)];case 3:return r.sent(),[2,t];case 4:return(n=r.sent()).error!==i.INVALID_GRANT?[3,6]:[4,this.localCredentials.setCredentials(null)];case 5:return r.sent(),[2,this.unAuthenticatedError(n.error_description)];case 6:return[2,Promise.reject(n)];case 7:return[2]}}))}))}))]}))}))},e.prototype.defaultRefreshTokenFunc=function(e,t){return _(this,void 0,void 0,(function(){var n,r;return v(this,(function(i){switch(i.label){case 0:return void 0===e||""===e?[2,this.unAuthenticatedError("refresh token not found")]:(n=o.AUTH_TOKEN_URL,"v2"===(null==t?void 0:t.version)&&(n=s.AUTH_TOKEN_URL),[4,this.request(n,{method:"POST",body:{client_id:this.clientId,client_secret:this.clientSecret,grant_type:"refresh_token",refresh_token:e}})]);case 1:return r=i.sent(),[2,p(p({},r),{version:(null==t?void 0:t.version)||"v1"})]}}))}))},e.prototype.getDeviceId=function(){return _(this,void 0,void 0,(function(){var e;return v(this,(function(t){switch(t.label){case 0:return this.deviceID?[2,this.deviceID]:[4,this.storage.getItem(g)];case 1:return"string"==typeof(e=t.sent())&&e.length>=16&&e.length<=48?[3,3]:(e=l(),[4,this.storage.setItem(g,e)]);case 2:t.sent(),t.label=3;case 3:return this.deviceID=e,[2,e]}}))}))},e.prototype.unAuthenticatedError=function(e){var t={error:i.UNAUTHENTICATED,error_description:e};return Promise.reject(t)},e.defaultRetry=2,e.minRetry=0,e.maxRetry=5,e.retryInterval=1e3,e}(),U=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},w=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=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(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},O=function(){function e(e){e.openURIWithCallback||(e.openURIWithCallback=this.getDefaultOpenURIWithCallback()),e.storage||(e.storage=T),this.config=e,this.tokenSectionName="captcha_".concat(e.clientId)}return e.prototype.request=function(e,t){return U(this,void 0,void 0,(function(){var n,r,i,o;return w(this,(function(s){switch(s.label){case 0:return t||(t={}),t.method||(t.method="GET"),n="".concat(t.method,":").concat(e),r=e,t.withCaptcha?[4,this.appendCaptchaTokenToURL(e,n,!1)]:[3,2];case 1:r=s.sent(),s.label=2;case 2:return s.trys.push([2,4,,7]),[4,this.config.request(r,t)];case 3:return i=s.sent(),[3,7];case 4:return"captcha_required"!==(o=s.sent()).error&&"captcha_invalid"!==o.error?[3,6]:[4,this.appendCaptchaTokenToURL(e,n,"captcha_invalid"===o.error)];case 5:return e=s.sent(),[2,this.config.request(e,t)];case 6:return[2,Promise.reject(o)];case 7:return[2,i]}}))}))},e.prototype.getDefaultOpenURIWithCallback=function(){if(window.location.search.indexOf("__captcha")>0&&(document.body.style.display="none"),null===document.getElementById("captcha_panel_wrap")){var e=document.createElement("div");e.style.cssText="background-color: rgba(0, 0, 0, 0.7);position: fixed;left: 0px;right: 0px;top: 0px;bottom: 0px;padding: 9vw 0 0 0;display: none;z-index:100;",e.setAttribute("id","captcha_panel_wrap"),setTimeout((function(){document.body.appendChild(e)}),0)}return this.defaultOpenURIWithCallback},e.prototype.defaultOpenURIWithCallback=function(e){return U(this,void 0,void 0,(function(){var t,n;return w(this,(function(r){return t=document.getElementById("captcha_panel_wrap"),n=document.createElement("iframe"),t.innerHTML="",n.setAttribute("src",e),n.setAttribute("id","review-panel-iframe"),n.style.cssText="min-width:355px;display:block;height:355px;margin:0 auto;background-color: rgb(255, 255, 255);border: none;",t.appendChild(n),t.style.display="block",[2,new Promise((function(e,r){n.onload=function(){try{var i=window.location,o=n.contentWindow.location;if(o.host+o.pathname===i.host+i.pathname){t.style.display="none";var s=new URLSearchParams(o.search),a=s.get("captcha_token");return a?e({captcha_token:a,expires_in:Number(s.get("expires_in"))}):r({error:s.get("error"),error_description:s.get("error_description")})}t.style.display="block"}catch(e){t.style.display="block"}}}))]}))}))},e.prototype.getCaptchaToken=function(e,t){return U(this,void 0,void 0,(function(){var n,r,i,o,s;return w(this,(function(a){switch(a.label){case 0:return e?[3,2]:[4,this.findCaptchaToken()];case 1:if(n=a.sent())return[2,n];a.label=2;case 2:return r="".concat(window.location.origin+window.location.pathname,"?__captcha=on"),[4,this.config.request("/auth/v1/captcha/init",{method:"POST",body:{client_id:this.config.clientId,redirect_uri:r,state:t},withCredentials:!1})];case 3:return(i=a.sent()).captcha_token?(o={captcha_token:i.captcha_token,expires_in:i.expires_in},this.saveCaptchaToken(o),[2,i.captcha_token]):[4,this.config.openURIWithCallback(i.url)];case 4:return s=a.sent(),this.saveCaptchaToken(s),[2,s.captcha_token]}}))}))},e.prototype.appendCaptchaTokenToURL=function(e,t,n){return U(this,void 0,void 0,(function(){var r;return w(this,(function(i){switch(i.label){case 0:return[4,this.getCaptchaToken(n,t)];case 1:return r=i.sent(),e.indexOf("?")>0?e+="&captcha_token=".concat(r):e+="?captcha_token=".concat(r),[2,e]}}))}))},e.prototype.saveCaptchaToken=function(e){return U(this,void 0,void 0,(function(){var t;return w(this,(function(n){switch(n.label){case 0:return e.expires_at=new Date(Date.now()+1e3*(e.expires_in-10)),t=JSON.stringify(e),[4,this.config.storage.setItem(this.tokenSectionName,t)];case 1:return n.sent(),[2]}}))}))},e.prototype.findCaptchaToken=function(){return U(this,void 0,void 0,(function(){var e,t;return w(this,(function(n){switch(n.label){case 0:return[4,this.config.storage.getItem(this.tokenSectionName)];case 1:if(null==(e=n.sent()))return[3,5];n.label=2;case 2:return n.trys.push([2,3,,5]),(null==(t=JSON.parse(e))?void 0:t.expires_at)&&(t.expires_at=new Date(t.expires_at)),t.expires_at<new Date?[2,null]:[2,t.captcha_token];case 3:return n.sent(),[4,this.config.storage.removeItem(this.tokenSectionName)];case 4:return n.sent(),[2,null];case 5:return[2,null]}}))}))},e}(),A=function(e){var t=function(t){for(var n in e)e.hasOwnProperty(n)&&(t[n]=A(e[n]));return t},n=null==e?"NullOrUndefined":Object.prototype.toString.call(e).slice(8,-1);if(["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"].includes(n))return e.slice();switch(n){case"Object":return t(Object.create(Object.getPrototypeOf(e)));case"Array":return t([]);case"Date":return new Date(e.valueOf());case"RegExp":return new RegExp(e.source,(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.sticky?"y":"")+(e.unicode?"u":""));default:return e}},N=function(){return N=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},N.apply(this,arguments)},P=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},D=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=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(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},L=function(){function e(e){var t=e.request,n=e.credentialsClient;if(!n){var r={apiOrigin:e.apiOrigin,clientId:e.clientId,storage:e.storage};n=new C(r)}if(!t){var i=n.request.bind(n),o=new O({clientId:e.clientId,request:i,storage:e.storage});t=o.request.bind(o)}this.config={apiOrigin:e.apiOrigin,clientId:e.clientId,request:t,credentialsClient:n,storage:e.storage||T}}return e.parseParamsToSearch=function(e){return Object.keys(e).forEach((function(t){e[t]||delete e[t]})),new URLSearchParams(e).toString()},e.prototype.getParamsByVersion=function(e,t){var n,r=A(e),i=(null===(n={v2:s}[null==r?void 0:r.version])||void 0===n?void 0:n[t])||o[t];return r&&delete r.version,{params:r,url:i}},e.prototype.signIn=function(e){return P(this,void 0,void 0,(function(){var t,n,r;return D(this,(function(i){switch(i.label){case 0:return t=e.version||"v1",n=this.getParamsByVersion(e,"AUTH_SIGN_IN_URL"),[4,this.config.request(n.url,{method:"POST",body:n.params})];case 1:return r=i.sent(),[4,this.config.credentialsClient.setCredentials(N(N({},r),{version:t}))];case 2:return i.sent(),[2,Promise.resolve(r)]}}))}))},e.prototype.signInAnonymously=function(e){return void 0===e&&(e={}),P(this,void 0,void 0,(function(){var t;return D(this,(function(n){switch(n.label){case 0:return[4,this.config.request(o.AUTH_SIGN_IN_ANONYMOUSLY_URL,{method:"POST",body:e})];case 1:return t=n.sent(),[4,this.config.credentialsClient.setCredentials(t)];case 2:return n.sent(),[2,Promise.resolve(t)]}}))}))},e.prototype.signUp=function(e){return P(this,void 0,void 0,(function(){var t;return D(this,(function(n){switch(n.label){case 0:return[4,this.config.request(o.AUTH_SIGN_UP_URL,{method:"POST",body:e})];case 1:return t=n.sent(),[4,this.config.credentialsClient.setCredentials(t)];case 2:return n.sent(),[2,Promise.resolve(t)]}}))}))},e.prototype.signOut=function(){return P(this,void 0,void 0,(function(){var e,t;return D(this,(function(n){switch(n.label){case 0:return[4,this.config.credentialsClient.getAccessToken()];case 1:return e=n.sent(),[4,this.config.request(o.AUTH_REVOKE_URL,{method:"POST",body:{token:e}})];case 2:return t=n.sent(),[4,this.config.credentialsClient.setCredentials()];case 3:return n.sent(),[2,Promise.resolve(t)]}}))}))},e.prototype.getVerification=function(e){return P(this,void 0,void 0,(function(){var t;return D(this,(function(n){switch(n.label){case 0:return t=!1,"CUR_USER"!==e.target?[3,1]:(t=!0,[3,3]);case 1:return[4,this.hasLoginState()];case 2:n.sent()&&(t=!0),n.label=3;case 3:return[2,this.config.request(o.VERIFICATION_URL,{method:"POST",body:e,withCaptcha:!0,withCredentials:t})]}}))}))},e.prototype.verify=function(e){return P(this,void 0,void 0,(function(){return D(this,(function(t){return[2,this.config.request(o.VERIFY_URL,{method:"POST",body:e})]}))}))},e.prototype.genProviderRedirectUri=function(e){return P(this,void 0,void 0,(function(){var t,n;return D(this,(function(r){return t="".concat(o.PROVIDER_URI_URL,"?client_id=").concat(this.config.clientId,"&provider_id=").concat(e.provider_id,"&redirect_uri=").concat(encodeURIComponent(e.provider_redirect_uri),"&state=").concat(e.state),(n=e.other_params)&&"string"==typeof n.sign_out_uri&&n.sign_out_uri.length>0&&(t+="&other_params[sign_out_uri]=".concat(n.sign_out_uri)),[2,this.config.request(t,{method:"GET"})]}))}))},e.prototype.grantProviderToken=function(e){return P(this,void 0,void 0,(function(){return D(this,(function(t){return[2,this.config.request(o.PROVIDER_TOKEN_URL,{method:"POST",body:e})]}))}))},e.prototype.patchProviderToken=function(e){return P(this,void 0,void 0,(function(){return D(this,(function(t){return[2,this.config.request(o.PROVIDER_TOKEN_URL,{method:"PATCH",body:e})]}))}))},e.prototype.signInWithProvider=function(e){return P(this,void 0,void 0,(function(){var t;return D(this,(function(n){switch(n.label){case 0:return[4,this.config.request(o.AUTH_SIGN_IN_WITH_PROVIDER_URL,{method:"POST",body:e})];case 1:return t=n.sent(),[4,this.config.credentialsClient.setCredentials(t)];case 2:return n.sent(),[2,Promise.resolve(t)]}}))}))},e.prototype.bindWithProvider=function(e){return P(this,void 0,void 0,(function(){return D(this,(function(t){return[2,this.config.request(o.PROVIDER_BIND_URL,{method:"POST",body:e,withCredentials:!0})]}))}))},e.prototype.getUserProfile=function(e){return P(this,void 0,void 0,(function(){return D(this,(function(t){return[2,this.getUserInfo(e)]}))}))},e.prototype.getUserInfo=function(e){var t;return void 0===e&&(e={}),P(this,void 0,void 0,(function(){var n,r,i;return D(this,(function(o){switch(o.label){case 0:return n=this.getParamsByVersion(e,"USER_ME_URL"),(null===(t=n.params)||void 0===t?void 0:t.query)&&(r=new URLSearchParams(n.params.query),n.url+="?".concat(r.toString())),[4,this.config.request(n.url,{method:"GET",withCredentials:!0})];case 1:return(i=o.sent()).sub&&(i.uid=i.sub),[2,i]}}))}))},e.prototype.getWedaUserInfo=function(){return P(this,void 0,void 0,(function(){return D(this,(function(e){switch(e.label){case 0:return[4,this.config.request(o.WEDA_USER_URL,{method:"GET",withCredentials:!0})];case 1:return[2,e.sent()]}}))}))},e.prototype.deleteMe=function(t){return P(this,void 0,void 0,(function(){var n,r;return D(this,(function(i){return n=this.getParamsByVersion(t,"USER_ME_URL"),r="".concat(n.url,"?").concat(e.parseParamsToSearch(n.params)),[2,this.config.request(r,{method:"DELETE",withCredentials:!0})]}))}))},e.prototype.hasLoginState=function(){return P(this,void 0,void 0,(function(){return D(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.config.credentialsClient.getAccessToken()];case 1:return e.sent(),[2,!0];case 2:return e.sent(),[2,!1];case 3:return[2]}}))}))},e.prototype.hasLoginStateSync=function(){return this.config.credentialsClient.getCredentialsSync()},e.prototype.getLoginState=function(){return P(this,void 0,void 0,(function(){return D(this,(function(e){return[2,this.config.credentialsClient.getCredentialsAsync()]}))}))},e.prototype.transByProvider=function(e){return P(this,void 0,void 0,(function(){return D(this,(function(t){return[2,this.config.request(o.USER_TRANS_BY_PROVIDER_URL,{method:"PATCH",body:e,withCredentials:!0})]}))}))},e.prototype.grantToken=function(e){return P(this,void 0,void 0,(function(){var t;return D(this,(function(n){return t=this.getParamsByVersion(e,"AUTH_TOKEN_URL"),[2,this.config.request(t.url,{method:"POST",body:t.params})]}))}))},e.prototype.getProviders=function(){return P(this,void 0,void 0,(function(){return D(this,(function(e){return[2,this.config.request(o.PROVIDER_LIST,{method:"GET",withCredentials:!0})]}))}))},e.prototype.unbindProvider=function(e){return P(this,void 0,void 0,(function(){return D(this,(function(t){return[2,this.config.request("".concat(o.PROVIDER_UNBIND_URL,"/").concat(e.provider_id),{method:"DELETE",withCredentials:!0})]}))}))},e.prototype.checkPassword=function(e){return P(this,void 0,void 0,(function(){return D(this,(function(t){return[2,this.config.request("".concat(o.CHECK_PWD_URL),{method:"POST",withCredentials:!0,body:e})]}))}))},e.prototype.bindPhone=function(e){return P(this,void 0,void 0,(function(){return D(this,(function(t){return[2,this.config.request("".concat(o.BIND_CONTACT_URL),{method:"PATCH",withCredentials:!0,body:e})]}))}))},e.prototype.bindEmail=function(e){return P(this,void 0,void 0,(function(){return D(this,(function(t){return[2,this.config.request("".concat(o.BIND_CONTACT_URL),{method:"PATCH",withCredentials:!0,body:e})]}))}))},e.prototype.setPassword=function(e){return P(this,void 0,void 0,(function(){return D(this,(function(t){return[2,this.config.request("".concat(o.AUTH_SET_PASSWORD),{method:"PATCH",withCredentials:!0,body:e})]}))}))},e.prototype.updatePasswordByOld=function(e){return P(this,void 0,void 0,(function(){var t;return D(this,(function(n){switch(n.label){case 0:return[4,this.sudo({password:e.old_password})];case 1:return t=n.sent(),[2,this.setPassword({sudo_token:t.sudo_token,new_password:e.new_password})]}}))}))},e.prototype.sudo=function(e){return P(this,void 0,void 0,(function(){return D(this,(function(t){return[2,this.config.request("".concat(o.SUDO_URL),{method:"POST",withCredentials:!0,body:e})]}))}))},e.prototype.getCurUserVerification=function(e){return P(this,void 0,void 0,(function(){return D(this,(function(t){return e.target="CUR_USER",[2,this.config.request(o.VERIFICATION_URL,{method:"POST",body:e,withCredentials:!0,withCaptcha:!0})]}))}))},e.prototype.changeBindedProvider=function(e){return P(this,void 0,void 0,(function(){return D(this,(function(t){return[2,this.config.request("".concat(o.PROVIDER_LIST,"/").concat(e.provider_id,"/trans"),{method:"POST",body:{provider_trans_token:e.trans_token},withCredentials:!0})]}))}))},e.prototype.setUserProfile=function(e){return P(this,void 0,void 0,(function(){return D(this,(function(t){return[2,this.config.request(o.USER_PRIFILE_URL,{method:"PATCH",body:e,withCredentials:!0})]}))}))},e.prototype.queryUserProfile=function(e){return P(this,void 0,void 0,(function(){var t;return D(this,(function(n){return t=new URLSearchParams(e),[2,this.config.request("".concat(o.USER_QUERY_URL,"?").concat(t.toString()),{method:"GET",withCredentials:!0})]}))}))},e.prototype.setCustomSignFunc=function(e){this.getCustomSignTicketFn=e},e.prototype.signInWithCustomTicket=function(){return P(this,void 0,void 0,(function(){var e;return D(this,(function(t){switch(t.label){case 0:return[4,this.getCustomSignTicketFn()];case 1:return e=t.sent(),[2,this.signInWithProvider({provider_id:"custom",provider_token:e})]}}))}))},e.prototype.resetPassword=function(e){return P(this,void 0,void 0,(function(){return D(this,(function(t){return[2,this.config.request(o.AUTH_RESET_PASSWORD,{method:"POST",body:e})]}))}))},e.prototype.deviceAuthorize=function(e){return P(this,void 0,void 0,(function(){return D(this,(function(t){return[2,this.config.request(o.AUTH_GET_DEVICE_CODE,{method:"POST",body:e,withCredentials:!0})]}))}))},e.prototype.checkUsername=function(e){return P(this,void 0,void 0,(function(){return D(this,(function(t){return[2,this.config.request(o.CHECK_USERNAME,{method:"GET",body:e,withCredentials:!0})]}))}))},e.prototype.checkIfUserExist=function(e){return P(this,void 0,void 0,(function(){var t;return D(this,(function(n){return t=new URLSearchParams(e),[2,this.config.request("".concat(o.CHECK_IF_USER_EXIST,"?").concat(t.toString()),{method:"GET"})]}))}))},e.prototype.loginScope=function(){return P(this,void 0,void 0,(function(){return D(this,(function(e){return[2,this.config.credentialsClient.getScope()]}))}))},e.prototype.loginGroups=function(){return P(this,void 0,void 0,(function(){return D(this,(function(e){return[2,this.config.credentialsClient.getGroups()]}))}))},e.prototype.refreshTokenForce=function(e){return P(this,void 0,void 0,(function(){var t;return D(this,(function(n){switch(n.label){case 0:return[4,this.config.credentialsClient.getCredentials()];case 1:return t=n.sent(),[4,this.config.credentialsClient.refreshToken(N(N({},t),{version:(null==e?void 0:e.version)||"v1"}))];case 2:return[2,n.sent()]}}))}))},e.prototype.getCredentials=function(){return P(this,void 0,void 0,(function(){return D(this,(function(e){return[2,this.config.credentialsClient.getCredentials()]}))}))},e}(),k=function(){},x=function(){return x=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},x.apply(this,arguments)},q=function(e){var t=e.apiOrigin,n=e.clientId,r=e.storage,i=e.request,o=e.anonymousSignInFunc;this.oauth2client=new C({apiOrigin:t,clientId:n,storage:r,baseRequest:i,anonymousSignInFunc:o}),this.authApi=new L(x(x({credentialsClient:this.oauth2client},e),{request:i?this.oauth2client.request.bind(this.oauth2client):void 0}))}},118:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(99),t)}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}return n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},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(118)})()));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/js-sdk",
3
- "version": "2.5.25-beta.0",
3
+ "version": "2.5.26-beta.0",
4
4
  "description": "cloudbase javascript sdk",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -46,15 +46,15 @@
46
46
  "license": "Apache-2.0",
47
47
  "dependencies": {
48
48
  "@cloudbase/adapter-interface": "^0.4.1",
49
- "@cloudbase/analytics": "^2.5.25-beta.0",
50
- "@cloudbase/app": "^2.5.25-beta.0",
51
- "@cloudbase/auth": "^2.5.25-beta.0",
49
+ "@cloudbase/analytics": "^2.5.26-beta.0",
50
+ "@cloudbase/app": "^2.5.26-beta.0",
51
+ "@cloudbase/auth": "^2.5.26-beta.0",
52
52
  "@cloudbase/database": "0.9.20",
53
- "@cloudbase/functions": "^2.5.25-beta.0",
54
- "@cloudbase/realtime": "^2.5.25-beta.0",
55
- "@cloudbase/storage": "^2.5.25-beta.0",
56
- "@cloudbase/types": "^2.5.25-beta.0",
57
- "@cloudbase/utilities": "^2.5.25-beta.0"
53
+ "@cloudbase/functions": "^2.5.26-beta.0",
54
+ "@cloudbase/realtime": "^2.5.26-beta.0",
55
+ "@cloudbase/storage": "^2.5.26-beta.0",
56
+ "@cloudbase/types": "^2.5.26-beta.0",
57
+ "@cloudbase/utilities": "^2.5.26-beta.0"
58
58
  },
59
59
  "browserslist": [
60
60
  "last 2 version",
@@ -62,5 +62,5 @@
62
62
  "not dead",
63
63
  "chrome 53"
64
64
  ],
65
- "gitHead": "96936d2b1965452c2f7f73eb8e6c0c8f8ec5cb5b"
65
+ "gitHead": "9f36d582728bcf790c9315ba0548244c5457fe7c"
66
66
  }