@alipay-inc/mpaas-ide-openapi-common
Advanced tools
Comparing version 1.0.13-alpha.2 to 1.0.13-alpha.3
@@ -1,1 +0,1 @@ | ||
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:!0}),exports.getUploadData=exports.getPluginFiles=exports.getPluginData=exports.getMiniFiles=exports.getMiniData=exports.getExtraData=void 0;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator")),_defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty")),_asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")),_index=require("./index.js"),_fsExtra=_interopRequireDefault(require("fs-extra")),_path=_interopRequireDefault(require("path"));function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){(0,_defineProperty2["default"])(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}var getUploadData=function(){var a=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function b(a){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w;return _regenerator["default"].wrap(function(b){for(;;)switch(b.prev=b.next){case 0:c=a.type,d=a.config,e=a.req,f=a.getVhostByApi,g=a.createWhitelistByApi,h=a.uploadFile,b.prev=1,i=e.appInfo,j=e.packageType,k=e.resourceFile,l=e.iconFile,m=e.whiteListValue,n=e.sourceCodeFile,o=e.appxVersion,p=void 0===o?"1.0":o,q=e.uuid,r=e.miniType,s=e.pluginFile,t={},u=e.h5Version,u||(v=(0,_index.getVersion)(null===i||void 0===i?void 0:i.h5Version).data,u="production"===(0,_index.getPackageType)(j).data?v.nextProd:v.nextDev);;if("plugin"!==r){b.next=14;break}return b.next=10,getPluginData(a);case 10:t=b.sent,t.miniPluginVersion=u,b.next=18;break;case 14:return b.next=16,getMiniData(a);case 16:t=b.sent,t.h5Version=u;case 18:if(0!=j-3){b.next=22;break}if(q){b.next=21;break}throw new Error("\u771F\u673A\u8C03\u8BD5\u5305\u9700\u8981\u4F20\u5165uuid");case 21:t.uuid=q;case 22:if(t.packageType=j,0!=j-4||q||(t.uuid="mockuuid"),j){b.next=26;break}throw new Error("\u6CA1\u6709\u5305\u7C7B\u578B\uFF01");case 26:if("development"!==(0,_index.getPackageType)(j).data){b.next=38;break}if(m){b.next=29;break}throw new Error("\u975E\u6B63\u5F0F\u5305\u9700\u8981\u6709\u767D\u540D\u5355\uFF01");case 29:if(i.whitelistContent===m){b.next=37;break}return b.next=32,g();case 32:if(w=b.sent,w.success){b.next=35;break}throw new Error(w.resultMsg);case 35:b.next=38;break;case 37:console.log("whiteListValue from appInfo",i.whitelistContent);case 38:if("plugin"!==r){b.next=47;break}return b.t0=_objectSpread,b.t1=_objectSpread({},t),b.next=43,getPluginFiles(a);case 43:b.t2=b.sent,t=(0,b.t0)(b.t1,b.t2),b.next=53;break;case 47:return b.t3=_objectSpread,b.t4=_objectSpread({},t),b.next=51,getMiniFiles(a);case 51:b.t5=b.sent,t=(0,b.t3)(b.t4,b.t5);case 53:return b.abrupt("return",t);case 56:throw b.prev=56,b.t6=b["catch"](1),new Error(b.t6.message);case 59:case"end":return b.stop();}},b,null,[[1,56]])}));return function(){return a.apply(this,arguments)}}();exports.getUploadData=getUploadData;var getPluginData=function(){var a=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function b(a){var c,d,e,f,g,h,i,j,k,l,m,n;return _regenerator["default"].wrap(function(b){for(;;)switch(b.prev=b.next){case 0:if(c=a.type,d=a.config,e=a.req,f=a.getVhostByApi,g=a.createWhitelistByApi,h=a.uploadFile,i=e.appInfo,j=e.pluginFile,k=(0,_index.transformPluginParams)(i),l=k.miniPluginName,m=k.miniPluginId,n={miniPluginName:l,miniPluginId:m},j){b.next=6;break}throw new Error("\u6CA1\u6709\u5C0F\u7A0B\u5E8F\u63D2\u4EF6\u8D44\u6E90\u6587\u4EF6\uFF01");case 6:return b.abrupt("return",n);case 7:case"end":return b.stop();}},b)}));return function(){return a.apply(this,arguments)}}();exports.getPluginData=getPluginData;var getPluginFiles=function(){var a=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function b(a){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D;return _regenerator["default"].wrap(function(b){for(;;)switch(b.prev=b.next){case 0:if(c=a.type,d=a.config,e=a.req,f=a.getVhostByApi,g=a.createWhitelistByApi,h=a.uploadFile,i=e.appInfo,j=e.packageType,k=e.resourceFile,l=e.iconFile,m=e.whiteListValue,n=e.sourceCodeFile,o=e.appxVersion,p=void 0===o?"1.0":o,q=e.uuid,r=e.miniType,s=e.pluginFile,t=i.h5Id,k||"production"===(0,_index.getPackageType)(j).data){b.next=5;break}throw new Error("\u6CA1\u6709\u5C0F\u7A0B\u5E8F\u5305\u8D44\u6E90\u6587\u4EF6\uFF01");case 5:if(s){b.next=7;break}throw new Error("\u6CA1\u6709\u5C0F\u7A0B\u5E8F\u63D2\u4EF6\u5305\u8D44\u6E90\u6587\u4EF6\uFF01");case 7:u={},b.t0=c,b.next="aliyun"===b.t0?11:26;break;case 11:if(!k){b.next=18;break}return b.next=14,h(k);case 14:if(v=b.sent,v.success){b.next=17;break}throw new Error(v.resultMsg);case 17:u.resourceFileUrl=v.data;case 18:if(!n){b.next=25;break}return b.next=21,h(n);case 21:if(w=b.sent,w.success){b.next=24;break}throw new Error(w.resultMsg);case 24:u.sourceCodeFileUrl=w.data;case 25:return b.abrupt("break",53);case 26:return x=[],b.next=29,(0,_index.getZipFromTar)({tarFilePath:s,h5Id:t});case 29:if(y=b.sent,z=y.data,"production"!==(0,_index.getPackageType)(j).data){b.next=35;break}x.push({name:"resourceFile",file:z}),b.next=51;break;case 35:return b.t1=_fsExtra["default"],b.t2=_path["default"],b.next=39,(0,_index.getTmpDir)();case 39:return b.t3=b.sent,b.t4=t,b.t5=b.t2.resolve.call(b.t2,b.t3,b.t4),A=b.t1.emptydirSync.call(b.t1,b.t5),B=_path["default"].resolve(A,"".concat(t,"-miniProgram.zip")),C=_path["default"].resolve(A,"".concat(t,"-plugin.zip")),_fsExtra["default"].copySync(k,B),_fsExtra["default"].copySync(z,C),b.next=49,(0,_index.getZipFile)({files:[B,C],h5Id:t});case 49:D=b.sent,x.push({name:"resourceFile",file:D});case 51:return u.files=x,b.abrupt("break",53);case 53:return b.abrupt("return",u);case 54:case"end":return b.stop();}},b)}));return function(){return a.apply(this,arguments)}}();exports.getPluginFiles=getPluginFiles;var getMiniData=function(){var a=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function b(a){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X;return _regenerator["default"].wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return c=a.type,d=a.config,e=a.req,f=a.getVhostByApi,g=a.createWhitelistByApi,h=a.uploadFile,i=e.appInfo,j=e.packageType,k=e.resourceFile,l=e.iconFile,m=e.whiteListValue,n=e.sourceCodeFile,o=e.appxVersion,p=void 0===o?"1.0":o,q=e.uuid,r=e.miniType,s=e.pluginFile,t=e.bindMiniPluginIds,u=d.appId,v=d.workspaceId,w=d.tenantId,x=d.userId,y=d.uuid_url,z=i||{},A=z.h5Id,B=z.h5Name,C=z.mainUrl,D=z.suburl,E=void 0===D?"":D,F=z.autoInstall,G=z.resourceType,H=z.installType,I=z.platform,J=z.clientVersionMin,K=z.clientVersionMax,L=getExtraData(i),M=L.extendInfo,N=void 0===M?{}:M,O=L.extraData,P=void 0===O?{}:O,Q=P.enableTabBar,R=void 0===Q?"1":Q,S=P.enableOptionMenu,T=void 0===S?"1":S,U=P.enableKeepAlive,V=void 0===U?"0":U,W={appId:u,workspaceId:v,tenantId:w,userId:x,h5Id:A,h5Name:B,mainUrl:C,suburl:E,extendInfo:N,autoInstall:F,resourceType:G,installType:H,platform:I,clientVersionMin:J,clientVersionMax:K,enableTabBar:R,enableOptionMenu:T,enableKeepAlive:V,packageType:1*j,appxVersion:p},t&&(W.bindMiniPluginIds=t),b.next=10,f();case 10:if(X=b.sent,X.success){b.next=13;break}throw new Error(X.resultMsg);case 13:if(X.data){b.next=15;break}throw new Error("\u65E0\u865A\u62DF\u57DF\u540D\uFF0C\u9700\u8981\u5148\u81F3\u63A7\u5236\u53F0\u8BBE\u7F6E\u865A\u62DF\u57DF\u540D");case 15:return console.log("qs.vhost",A,X.data),W.vhost="".concat(A,".").concat(X.data),b.abrupt("return",W);case 18:case"end":return b.stop();}},b)}));return function(){return a.apply(this,arguments)}}();exports.getMiniData=getMiniData;var getMiniFiles=function(){var a=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function b(a){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B;return _regenerator["default"].wrap(function(b){for(;;)switch(b.prev=b.next){case 0:if(c=a.type,d=a.config,e=a.req,f=a.getVhostByApi,g=a.createWhitelistByApi,h=a.uploadFile,i=e.appInfo,j=e.packageType,k=e.resourceFile,l=e.iconFile,m=e.whiteListValue,n=e.sourceCodeFile,o=e.appxVersion,p=void 0===o?"1.0":o,q=e.uuid,r=e.miniType,s=e.pluginFile,k){b.next=4;break}throw new Error("\u6CA1\u6709\u5C0F\u7A0B\u5E8F\u5305\u8D44\u6E90\u6587\u4EF6\uFF01");case 4:t=getExtraData(i),u=t.extraData,v=void 0===u?{}:u,w=v.iconUrl,x={},b.t0=c,b.next="aliyun"===b.t0?10:36;break;case 10:if(!k){b.next=17;break}return b.next=13,h(k);case 13:if(y=b.sent,y.success){b.next=16;break}throw new Error(y.resultMsg);case 16:x.resourceFileUrl=y.data;case 17:if(!l){b.next=26;break}return b.next=20,h(l);case 20:if(z=b.sent,z.success){b.next=23;break}throw new Error(z.resultMsg);case 23:x.iconFileUrl=z.data,b.next=27;break;case 26:w&&(x.iconUrl=w);case 27:;if(!n){b.next=35;break}return b.next=31,h(n);case 31:if(A=b.sent,A.success){b.next=34;break}throw new Error(A.resultMsg);case 34:x.sourceCodeFileUrl=A.data;case 35:return b.abrupt("break",42);case 36:B=[{name:"resourceFile",file:k}],l?B.push({name:"iconFile",file:l}):w&&(x.iconUrl=w);;return n&&B.push({name:"sourceCodeFile",file:n}),x.files=B,b.abrupt("break",42);case 42:return b.abrupt("return",x);case 43:case"end":return b.stop();}},b)}));return function(){return a.apply(this,arguments)}}();exports.getMiniFiles=getMiniFiles;var getExtraData=function(a){var b=a.extendInfo,c=void 0===b?"":b,d=a.extraData,e=void 0===d?"":d;try{var n=(0,_index.looseJsonParse)(e);e=n.data}catch(a){try{var o=(0,_index.looseJsonParse)(e);e=o.data}catch(a){throw new Error(a)}}var f=e,g=f.enableTabBar,h=void 0===g?"1":g,i=f.enableOptionMenu,j=void 0===i?"1":i,k=f.enableKeepAlive,l=void 0===k?"0":k,m=f.iconUrl;return c=c.replace(/"|&quot;/ig,"\""),{extraData:e,extendInfo:c}};exports.getExtraData=getExtraData; | ||
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:!0}),exports.getUploadData=exports.getPluginFiles=exports.getPluginData=exports.getMiniFiles=exports.getMiniData=exports.getExtraData=void 0;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator")),_defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty")),_asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")),_index=require("./index.js"),_fsExtra=_interopRequireDefault(require("fs-extra")),_path=_interopRequireDefault(require("path"));function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){(0,_defineProperty2["default"])(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}var getUploadData=function(){var a=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function b(a){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y;return _regenerator["default"].wrap(function(b){for(;;)switch(b.prev=b.next){case 0:c=a.type,d=a.config,e=a.req,f=a.getVhostByApi,g=a.createWhitelistByApi,h=a.uploadFile,b.prev=1,i=e.appInfo,j=e.packageType,k=e.resourceFile,l=e.iconFile,m=e.whiteListValue,n=e.sourceCodeFile,o=e.appxVersion,p=void 0===o?"1.0":o,q=e.uuid,r=e.miniType,s=e.pluginFile,t=e.subpackageFlag,u=void 0!==t&&t,v={},w=e.h5Version,w||(x=(0,_index.getVersion)(null===i||void 0===i?void 0:i.h5Version).data,w="production"===(0,_index.getPackageType)(j).data?x.nextProd:x.nextDev);;if("plugin"!==r){b.next=14;break}return b.next=10,getPluginData(a);case 10:v=b.sent,v.miniPluginVersion=w,b.next=18;break;case 14:return b.next=16,getMiniData(a);case 16:v=b.sent,v.h5Version=w;case 18:if(0!=j-3){b.next=22;break}if(q){b.next=21;break}throw new Error("\u771F\u673A\u8C03\u8BD5\u5305\u9700\u8981\u4F20\u5165uuid");case 21:v.uuid=q;case 22:if(v.packageType=j,v.subpackageFlag=u,0!=j-4||q||(v.uuid="mockuuid"),j){b.next=27;break}throw new Error("\u6CA1\u6709\u5305\u7C7B\u578B\uFF01");case 27:if("development"!==(0,_index.getPackageType)(j).data){b.next=39;break}if(m){b.next=30;break}throw new Error("\u975E\u6B63\u5F0F\u5305\u9700\u8981\u6709\u767D\u540D\u5355\uFF01");case 30:if(i.whitelistContent===m){b.next=38;break}return b.next=33,g();case 33:if(y=b.sent,y.success){b.next=36;break}throw new Error(y.resultMsg);case 36:b.next=39;break;case 38:console.log("whiteListValue from appInfo",i.whitelistContent);case 39:if("plugin"!==r){b.next=48;break}return b.t0=_objectSpread,b.t1=_objectSpread({},v),b.next=44,getPluginFiles(a);case 44:b.t2=b.sent,v=(0,b.t0)(b.t1,b.t2),b.next=54;break;case 48:return b.t3=_objectSpread,b.t4=_objectSpread({},v),b.next=52,getMiniFiles(a);case 52:b.t5=b.sent,v=(0,b.t3)(b.t4,b.t5);case 54:return b.abrupt("return",v);case 57:throw b.prev=57,b.t6=b["catch"](1),new Error(b.t6.message);case 60:case"end":return b.stop();}},b,null,[[1,57]])}));return function(){return a.apply(this,arguments)}}();exports.getUploadData=getUploadData;var getPluginData=function(){var a=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function b(a){var c,d,e,f,g,h,i,j,k,l,m,n;return _regenerator["default"].wrap(function(b){for(;;)switch(b.prev=b.next){case 0:if(c=a.type,d=a.config,e=a.req,f=a.getVhostByApi,g=a.createWhitelistByApi,h=a.uploadFile,i=e.appInfo,j=e.pluginFile,k=(0,_index.transformPluginParams)(i),l=k.miniPluginName,m=k.miniPluginId,n={miniPluginName:l,miniPluginId:m},j){b.next=6;break}throw new Error("\u6CA1\u6709\u5C0F\u7A0B\u5E8F\u63D2\u4EF6\u8D44\u6E90\u6587\u4EF6\uFF01");case 6:return b.abrupt("return",n);case 7:case"end":return b.stop();}},b)}));return function(){return a.apply(this,arguments)}}();exports.getPluginData=getPluginData;var getPluginFiles=function(){var a=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function b(a){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D;return _regenerator["default"].wrap(function(b){for(;;)switch(b.prev=b.next){case 0:if(c=a.type,d=a.config,e=a.req,f=a.getVhostByApi,g=a.createWhitelistByApi,h=a.uploadFile,i=e.appInfo,j=e.packageType,k=e.resourceFile,l=e.iconFile,m=e.whiteListValue,n=e.sourceCodeFile,o=e.appxVersion,p=void 0===o?"1.0":o,q=e.uuid,r=e.miniType,s=e.pluginFile,t=i.h5Id,k||"production"===(0,_index.getPackageType)(j).data){b.next=5;break}throw new Error("\u6CA1\u6709\u5C0F\u7A0B\u5E8F\u5305\u8D44\u6E90\u6587\u4EF6\uFF01");case 5:if(s){b.next=7;break}throw new Error("\u6CA1\u6709\u5C0F\u7A0B\u5E8F\u63D2\u4EF6\u5305\u8D44\u6E90\u6587\u4EF6\uFF01");case 7:u={},b.t0=c,b.next="aliyun"===b.t0?11:26;break;case 11:if(!k){b.next=18;break}return b.next=14,h(k);case 14:if(v=b.sent,v.success){b.next=17;break}throw new Error(v.resultMsg);case 17:u.resourceFileUrl=v.data;case 18:if(!n){b.next=25;break}return b.next=21,h(n);case 21:if(w=b.sent,w.success){b.next=24;break}throw new Error(w.resultMsg);case 24:u.sourceCodeFileUrl=w.data;case 25:return b.abrupt("break",53);case 26:return x=[],b.next=29,(0,_index.getZipFromTar)({tarFilePath:s,h5Id:t});case 29:if(y=b.sent,z=y.data,"production"!==(0,_index.getPackageType)(j).data){b.next=35;break}x.push({name:"resourceFile",file:z}),b.next=51;break;case 35:return b.t1=_fsExtra["default"],b.t2=_path["default"],b.next=39,(0,_index.getTmpDir)();case 39:return b.t3=b.sent,b.t4=t,b.t5=b.t2.resolve.call(b.t2,b.t3,b.t4),A=b.t1.emptydirSync.call(b.t1,b.t5),B=_path["default"].resolve(A,"".concat(t,"-miniProgram.zip")),C=_path["default"].resolve(A,"".concat(t,"-plugin.zip")),_fsExtra["default"].copySync(k,B),_fsExtra["default"].copySync(z,C),b.next=49,(0,_index.getZipFile)({files:[B,C],h5Id:t});case 49:D=b.sent,x.push({name:"resourceFile",file:D});case 51:return u.files=x,b.abrupt("break",53);case 53:return b.abrupt("return",u);case 54:case"end":return b.stop();}},b)}));return function(){return a.apply(this,arguments)}}();exports.getPluginFiles=getPluginFiles;var getMiniData=function(){var a=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function b(a){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X;return _regenerator["default"].wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return c=a.type,d=a.config,e=a.req,f=a.getVhostByApi,g=a.createWhitelistByApi,h=a.uploadFile,i=e.appInfo,j=e.packageType,k=e.resourceFile,l=e.iconFile,m=e.whiteListValue,n=e.sourceCodeFile,o=e.appxVersion,p=void 0===o?"1.0":o,q=e.uuid,r=e.miniType,s=e.pluginFile,t=e.bindMiniPluginIds,u=d.appId,v=d.workspaceId,w=d.tenantId,x=d.userId,y=d.uuid_url,z=i||{},A=z.h5Id,B=z.h5Name,C=z.mainUrl,D=z.suburl,E=void 0===D?"":D,F=z.autoInstall,G=z.resourceType,H=z.installType,I=z.platform,J=z.clientVersionMin,K=z.clientVersionMax,L=getExtraData(i),M=L.extendInfo,N=void 0===M?{}:M,O=L.extraData,P=void 0===O?{}:O,Q=P.enableTabBar,R=void 0===Q?"1":Q,S=P.enableOptionMenu,T=void 0===S?"1":S,U=P.enableKeepAlive,V=void 0===U?"0":U,W={appId:u,workspaceId:v,tenantId:w,userId:x,h5Id:A,h5Name:B,mainUrl:C,suburl:E,extendInfo:N,autoInstall:F,resourceType:G,installType:H,platform:I,clientVersionMin:J,clientVersionMax:K,enableTabBar:R,enableOptionMenu:T,enableKeepAlive:V,packageType:1*j,appxVersion:p},t&&(W.bindMiniPluginIds=t),b.next=10,f();case 10:if(X=b.sent,X.success){b.next=13;break}throw new Error(X.resultMsg);case 13:if(X.data){b.next=15;break}throw new Error("\u65E0\u865A\u62DF\u57DF\u540D\uFF0C\u9700\u8981\u5148\u81F3\u63A7\u5236\u53F0\u8BBE\u7F6E\u865A\u62DF\u57DF\u540D");case 15:return console.log("qs.vhost",A,X.data),W.vhost="".concat(A,".").concat(X.data),b.abrupt("return",W);case 18:case"end":return b.stop();}},b)}));return function(){return a.apply(this,arguments)}}();exports.getMiniData=getMiniData;var getMiniFiles=function(){var a=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function b(a){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B;return _regenerator["default"].wrap(function(b){for(;;)switch(b.prev=b.next){case 0:if(c=a.type,d=a.config,e=a.req,f=a.getVhostByApi,g=a.createWhitelistByApi,h=a.uploadFile,i=e.appInfo,j=e.packageType,k=e.resourceFile,l=e.iconFile,m=e.whiteListValue,n=e.sourceCodeFile,o=e.appxVersion,p=void 0===o?"1.0":o,q=e.uuid,r=e.miniType,s=e.pluginFile,k){b.next=4;break}throw new Error("\u6CA1\u6709\u5C0F\u7A0B\u5E8F\u5305\u8D44\u6E90\u6587\u4EF6\uFF01");case 4:t=getExtraData(i),u=t.extraData,v=void 0===u?{}:u,w=v.iconUrl,x={},b.t0=c,b.next="aliyun"===b.t0?10:36;break;case 10:if(!k){b.next=17;break}return b.next=13,h(k);case 13:if(y=b.sent,y.success){b.next=16;break}throw new Error(y.resultMsg);case 16:x.resourceFileUrl=y.data;case 17:if(!l){b.next=26;break}return b.next=20,h(l);case 20:if(z=b.sent,z.success){b.next=23;break}throw new Error(z.resultMsg);case 23:x.iconFileUrl=z.data,b.next=27;break;case 26:w&&(x.iconUrl=w);case 27:;if(!n){b.next=35;break}return b.next=31,h(n);case 31:if(A=b.sent,A.success){b.next=34;break}throw new Error(A.resultMsg);case 34:x.sourceCodeFileUrl=A.data;case 35:return b.abrupt("break",42);case 36:B=[{name:"resourceFile",file:k}],l?B.push({name:"iconFile",file:l}):w&&(x.iconUrl=w);;return n&&B.push({name:"sourceCodeFile",file:n}),x.files=B,b.abrupt("break",42);case 42:return b.abrupt("return",x);case 43:case"end":return b.stop();}},b)}));return function(){return a.apply(this,arguments)}}();exports.getMiniFiles=getMiniFiles;var getExtraData=function(a){var b=a.extendInfo,c=void 0===b?"":b,d=a.extraData,e=void 0===d?"":d;try{var n=(0,_index.looseJsonParse)(e);e=n.data}catch(a){try{var o=(0,_index.looseJsonParse)(e);e=o.data}catch(a){throw new Error(a)}}var f=e,g=f.enableTabBar,h=void 0===g?"1":g,i=f.enableOptionMenu,j=void 0===i?"1":i,k=f.enableKeepAlive,l=void 0===k?"0":k,m=f.iconUrl;return c=c.replace(/"|&quot;/ig,"\""),{extraData:e,extendInfo:c}};exports.getExtraData=getExtraData; |
{ | ||
"name": "@alipay-inc/mpaas-ide-openapi-common", | ||
"version": "1.0.13-alpha.2", | ||
"version": "1.0.13-alpha.3", | ||
"main": "dist/index.js", | ||
@@ -37,3 +37,3 @@ "repository": "https://code.alipay.com/mPaaS-IDE-Adaptor/mPaaS-IDE-openAPI.git", | ||
}, | ||
"gitHead": "c37040b1671db9950beb047aca4766a064925577" | ||
"gitHead": "18830995668eb135d7f61bace1508a9affecd469" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
54973