zmp-sdk 2.30.3 → 2.30.4
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/apis/apis/authorize.js +1 -0
- package/apis/apis/getSetting.js +1 -0
- package/apis/common/apis/general/authorize.js +1 -0
- package/apis/common/apis/general/getSetting.js +1 -0
- package/apis/common/apis/general/getUserInfo.js +1 -1
- package/apis/package.json.js +1 -1
- package/browser.min.js +2 -2
- package/index.es.js +2 -2
- package/index.js +2 -2
- package/index.umd.js +2 -2
- package/package.json +1 -1
- package/zmp-sdk-v2.30.3.tgz +0 -0
- package/zmp-sdk-v2.30.2.tgz +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import o from'./../external/@swc/helpers/src/_async_to_generator.mjs.js';import r from"../appEnv/index.js";import t from"../common/notFound.js";import{functionHandler as e}from"../utils/decorator.js";import s from"../common/apis/general/authorize.js";import n,{object as i,string as a}from'./../external/zod/lib/index.mjs.js';import{__generator as m}from'./../external/tslib/tslib.es6.js';var u=[i({scopes:n.array(a()).max(2).optional()}).optional()];function p(o){return c.apply(this,arguments)}function c(){return c=o((function(n){return m(this,(function(i){return[2,e("authorize",u,[n],(a=o((function(o){var e;return m(this,(function(n){switch(n.label){case 0:return r.isMp?(e=null==o?void 0:o.scopes,[4,s(null!=e?e:void 0)]):[3,2];case 1:return[2,n.sent()];case 2:return r.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(t("authorize",{}))]}}))})),function(o){return a.apply(this,arguments)}))];var a}))})),c.apply(this,arguments)}export{p as authorize};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from'./../external/@swc/helpers/src/_async_to_generator.mjs.js';import e from"../appEnv/index.js";import r from"../common/notFound.js";import{functionHandler as n}from"../utils/decorator.js";import o from"../common/apis/general/getSetting.js";import{__generator as s}from'./../external/tslib/tslib.es6.js';function i(t){return m.apply(this,arguments)}function m(){return(m=t((function(i){return s(this,(function(m){return[2,n("getSetting",[],[i],t((function(){return s(this,(function(t){switch(t.label){case 0:return e.isMp?[4,o()]:[3,2];case 1:return[2,t.sent()];case 2:return e.isMpWeb?[2,Promise.resolve({authSetting:{}})]:[2,Promise.reject(r("getSetting",{}))]}}))})))]}))}))).apply(this,arguments)}export{i as getSetting};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from'./../../../external/@swc/helpers/src/_async_to_generator.mjs.js';import o from"../../call/index.js";import i from"../../../utils/lodash.js";import n from"./getSetting.js";import{__generator as s}from'./../../../external/tslib/tslib.es6.js';import e from"../../../appEnv/getEnv.js";var r,u=(r=t((function(t){return s(this,(function(s){return[2,new Promise((function(s,r){o("MP_USER_AUTHORIZE",{scopes:t,forceUpdate:!0},{success:function(t){var o,r;i.isEmpty(t)?(null===(o=e())||void 0===o||null===(r=o.platform)||void 0===r?void 0:r.isIOS)&&setTimeout((function(){n().then((function(t){t&&s(t.authSetting)}))}),1e3):s(t)},fail:function(t){r(t)}},{isMultiCallback:!0,timeout:!1})}))]}))})),function(t){return r.apply(this,arguments)});export{u as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from'./../../../external/@swc/helpers/src/_async_to_generator.mjs.js';import e from'./../../../external/@swc/helpers/src/_object_spread.mjs.js';import{RESPONSE_CODE as r,MESSAGES as n,APIS as s}from"../../../constants.js";import o from"../../token.js";import{AppError as i}from"../../../utils/errorHandler.js";import{__generator as a}from'./../../../external/tslib/tslib.es6.js';var u,c=(u=t((function(t){var r;return a(this,(function(n){switch(n.label){case 0:return r={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer ".concat(t)}},[4,fetch(s.GET_AUTH_SETTING,e({method:"GET"},r))];case 1:return[4,n.sent().json()];case 2:return[2,n.sent()]}}))})),function(t){return u.apply(this,arguments)}),m=t((function(){return a(this,(function(e){return[2,new Promise((s=t((function(t,e){var s,u,m,l;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),(u=null===(s=o.getMiniProgramConfig())||void 0===s?void 0:s.jwt)||e(new i(r.UNAUTHORIZED,n.LOGIN_REQUIRED,"getSetting")),[4,c(u)];case 1:return(m=a.sent())&&0===m.err?t({authSetting:m.data}):e(new i(m.err,m.msg,"getSetting")),[3,3];case 2:return l=a.sent(),e(l),[3,3];case 3:return[2]}}))})),function(t,e){return s.apply(this,arguments)}))];var s}))}));export{m as default,c as getAuthenSettings};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from'./../../../external/@swc/helpers/src/_async_to_generator.mjs.js';import
|
|
1
|
+
import e from'./../../../external/@swc/helpers/src/_async_to_generator.mjs.js';import t from"../../token.js";import{APIS as n}from"../../../constants.js";import{__generator as s}from'./../../../external/tslib/tslib.es6.js';var i,r=(i=e((function(i){var r,o;return s(this,(function(c){switch(c.label){case 0:return[4,t.getAccessToken()];case 1:return r=c.sent(),o="id,name,user_id_by_oa,is_sensitive",o=i?"".concat(o,",picture.type(").concat(i,")"):"".concat(o,",picture"),[4,fetch("".concat(n.GET_USER_INFO,"?fields=").concat(o),{headers:{access_token:r||""}}).then(function(){var t=e((function(e){var t,n,i;return s(this,(function(s){switch(s.label){case 0:return[4,e.json()];case 1:return[2,{id:null==(i=s.sent())?void 0:i.id,name:null==i?void 0:i.name,avatar:null==i||null===(t=i.picture)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.url,idByOA:null==i?void 0:i.user_id_by_oa,isSensitive:null==i?void 0:i.is_sensitive}]}}))}));return function(e){return t.apply(this,arguments)}}())];case 2:return[2,c.sent()]}}))})),function(e){return i.apply(this,arguments)});export{r as default};
|
package/apis/package.json.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var r="2.30.
|
|
1
|
+
var r="2.30.4";export{r as version};
|