@alipay-inc/mpaas-ide-openapi-classic
Advanced tools
Comparing version 1.0.40-alpha.0 to 1.0.41-alpha.0
@@ -1,1 +0,1 @@ | ||
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:!0}),exports.request=exports.UPLOAD_PLUGIN_BY_API=exports.UPLOAD_PACKAGE_BY_API=exports.GET_WHITE_LIST_API=exports.GET_PLUGIN_LIST_BY_API=exports.GET_PLUGIN_INFO_BY_API=exports.GET_PACKAGE_INFO_BY_API=exports.GET_MINIPROGRAM_CONFIG_BY_API=exports.GET_ENVIRONMENT_INFO_API=exports.GET_APP_LIST_BY_API=exports.CREATE_SHITE_LIST_BY_API=exports.CLOUD_BUILD_POLL_URL=exports.CLOUD_BUILD_EXEC_URL=exports.CHECK_PLUGIN_BY_API=void 0;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator")),_defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty")),_asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")),_superagent=_interopRequireDefault(require("superagent")),_fsExtra=require("fs-extra"),_path=_interopRequireDefault(require("path")),_mpaasIdeOpenapiCommon=require("@alipay-inc/mpaas-ide-openapi-common");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 GET_ENVIRONMENT_INFO_API=exports.GET_ENVIRONMENT_INFO_API="/privilege/getEnvironmentInfo",GET_APP_LIST_BY_API=exports.GET_APP_LIST_BY_API="/miniProgram/getAppListByApi",GET_PACKAGE_INFO_BY_API=exports.GET_PACKAGE_INFO_BY_API="/miniProgramPackage/getPackageInfoByApi",UPLOAD_PACKAGE_BY_API=exports.UPLOAD_PACKAGE_BY_API="/miniProgramPackage/uploadPackageByApi",CREATE_SHITE_LIST_BY_API=exports.CREATE_SHITE_LIST_BY_API="/whitelist/createWhiteListByApi",GET_MINIPROGRAM_CONFIG_BY_API=exports.GET_MINIPROGRAM_CONFIG_BY_API="/miniProgramConfig/getMiniprogramConfigByApi",GET_WHITE_LIST_API=exports.GET_WHITE_LIST_API="/whitelist/getWhiteListByApi",CLOUD_BUILD_EXEC_URL=exports.CLOUD_BUILD_EXEC_URL="https://hpmweb.alipay.com/tinyApp/cloudBuild/execute",CLOUD_BUILD_POLL_URL=exports.CLOUD_BUILD_POLL_URL="https://hpmweb.alipay.com/tinyApp/cloudBuild/result",GET_PLUGIN_LIST_BY_API=exports.GET_PLUGIN_LIST_BY_API="miniPluginForIde/getMiniPlugins",GET_PLUGIN_INFO_BY_API=exports.GET_PLUGIN_INFO_BY_API="/miniPluginForIde/getMiniPluginInfo",UPLOAD_PLUGIN_BY_API=exports.UPLOAD_PLUGIN_BY_API="/miniPluginForIde/uploadMiniPluginResource",CHECK_PLUGIN_BY_API=exports.CHECK_PLUGIN_BY_API="/miniPluginForIde/checkMiniPlugins",request=exports.request=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;return _regenerator["default"].wrap(function(b){for(;;)switch(b.prev=b.next){case 0:c=a.config,d=a.url,e=a.method,f=a.req,g=void 0===f?{}:f,h=a.files,i=void 0===h?[]:h,j=a.userInfo,k=void 0===j?{}:j,l=c.appId,m=c.workspaceId,n=c.tenantId,b.prev=2,o=_objectSpread(_objectSpread({},g),{},{config:c,appId:l,workspaceId:m,tenantId:n}),p=k.userId,q=k.loginName,p&&(o.userId=p),q&&(o.loginName=q),b.t0=e,b.next="FORM"===b.t0?10:18;break;case 10:return o.config=JSON.stringify(c),o.userInfo=JSON.stringify(k),s=_superagent["default"].post(d).field(o).accept("json"),i&&i[0]&&i.forEach(function(a){var b=a.name,c=a.file,d={value:(0,_fsExtra.createReadStream)(c),options:{filename:_path["default"].basename(c),contentType:"application/zip"}};s.attach(b,d.value,d.options)}),b.next=16,s;case 16:return r=b.sent,b.abrupt("break",24);case 18:return o.config=c,o.userInfo=k,b.next=22,_superagent["default"].get(d).query(o).accept("json");case 22:return r=b.sent,b.abrupt("break",24);case 24:if(_mpaasIdeOpenapiCommon.logger.info("request url: ".concat(d)),_mpaasIdeOpenapiCommon.logger.info("request method: ".concat(e)),_mpaasIdeOpenapiCommon.logger.info("request qs: ".concat(JSON.stringify(o))),_mpaasIdeOpenapiCommon.logger.info("request res: ".concat(JSON.stringify(r.body))),t=r.body.data,u=void 0===t?{}:t,v=u.data,w=u.success,x=void 0!==w&&w,y=u.resultMsg,z=void 0===y?"\u672A\u77E5\u9519\u8BEF":y,!0===x){b.next=31;break}throw new Error(z);case 31:return b.abrupt("return",{data:v,success:!0});case 34:throw b.prev=34,b.t1=b["catch"](2),new Error(b.t1.message);case 37:case"end":return b.stop()}},b,null,[[2,34]])}));return function(){return a.apply(this,arguments)}}(); | ||
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:!0}),exports.request=exports.UPLOAD_PLUGIN_BY_API=exports.UPLOAD_PACKAGE_BY_API=exports.GET_WHITE_LIST_API=exports.GET_PLUGIN_LIST_BY_API=exports.GET_PLUGIN_INFO_BY_API=exports.GET_PACKAGE_INFO_BY_API=exports.GET_MINIPROGRAM_CONFIG_BY_API=exports.GET_ENVIRONMENT_INFO_API=exports.GET_APP_LIST_BY_API=exports.CREATE_SHITE_LIST_BY_API=exports.CLOUD_BUILD_POLL_URL=exports.CLOUD_BUILD_EXEC_URL=exports.CHECK_PLUGIN_BY_API=void 0;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator")),_defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty")),_asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")),_superagent=_interopRequireDefault(require("superagent")),_fsExtra=require("fs-extra"),_path=_interopRequireDefault(require("path")),_mpaasIdeOpenapiCommon=require("@alipay-inc/mpaas-ide-openapi-common");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 GET_ENVIRONMENT_INFO_API=exports.GET_ENVIRONMENT_INFO_API="/privilege/getEnvironmentInfo",GET_APP_LIST_BY_API=exports.GET_APP_LIST_BY_API="/miniProgram/getAppListByApi",GET_PACKAGE_INFO_BY_API=exports.GET_PACKAGE_INFO_BY_API="/miniProgramPackage/getPackageInfoByApi",UPLOAD_PACKAGE_BY_API=exports.UPLOAD_PACKAGE_BY_API="/miniProgramPackage/uploadPackageByApi",CREATE_SHITE_LIST_BY_API=exports.CREATE_SHITE_LIST_BY_API="/whitelist/createWhiteListByApi",GET_MINIPROGRAM_CONFIG_BY_API=exports.GET_MINIPROGRAM_CONFIG_BY_API="/miniProgramConfig/getMiniprogramConfigByApi",GET_WHITE_LIST_API=exports.GET_WHITE_LIST_API="/whitelist/getWhiteListByApi",CLOUD_BUILD_EXEC_URL=exports.CLOUD_BUILD_EXEC_URL="https://hpmweb.alipay.com/tinyApp/cloudBuild/execute",CLOUD_BUILD_POLL_URL=exports.CLOUD_BUILD_POLL_URL="https://hpmweb.alipay.com/tinyApp/cloudBuild/result",GET_PLUGIN_LIST_BY_API=exports.GET_PLUGIN_LIST_BY_API="miniPluginForIde/getMiniPlugins",GET_PLUGIN_INFO_BY_API=exports.GET_PLUGIN_INFO_BY_API="/miniPluginForIde/getMiniPluginInfo",UPLOAD_PLUGIN_BY_API=exports.UPLOAD_PLUGIN_BY_API="/miniPluginForIde/uploadMiniPluginResource",CHECK_PLUGIN_BY_API=exports.CHECK_PLUGIN_BY_API="/miniPluginForIde/checkMiniPlugins",request=exports.request=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:e=a.config,f=a.url,g=a.method,h=a.req,i=void 0===h?{}:h,j=a.files,k=void 0===j?[]:j,l=a.userInfo,m=void 0===l?{}:l,n=e.appId,o=e.workspaceId,p=e.tenantId,b.prev=2,q=_objectSpread(_objectSpread({},i),{},{config:e,appId:n,workspaceId:o,tenantId:p}),r=m.userId,s=m.loginName,r&&(q.userId=r),s&&(q.loginName=s),b.t0=g,b.next="FORM"===b.t0?10:18;break;case 10:return q.config=JSON.stringify(e),q.userInfo=JSON.stringify(m),u=_superagent["default"].post(f).set("Cookie","LOCALE=".concat(null===(c=process)||void 0===c||null===(c=c.env)||void 0===c?void 0:c.VOL_NLS_CONFIG)).field(q).accept("json"),k&&k[0]&&k.forEach(function(a){var b=a.name,c=a.file,d={value:(0,_fsExtra.createReadStream)(c),options:{filename:_path["default"].basename(c),contentType:"application/zip"}};u.attach(b,d.value,d.options)}),b.next=16,u;case 16:return t=b.sent,b.abrupt("break",24);case 18:return q.config=e,q.userInfo=m,b.next=22,_superagent["default"].get(f).set("Cookie","LOCALE=".concat(null===(d=process)||void 0===d||null===(d=d.env)||void 0===d?void 0:d.VOL_NLS_CONFIG)).query(q).accept("json");case 22:return t=b.sent,b.abrupt("break",24);case 24:if(_mpaasIdeOpenapiCommon.logger.info("request url: ".concat(f)),_mpaasIdeOpenapiCommon.logger.info("request method: ".concat(g)),_mpaasIdeOpenapiCommon.logger.info("request qs: ".concat(JSON.stringify(q))),_mpaasIdeOpenapiCommon.logger.info("request res: ".concat(JSON.stringify(t.body))),v=t.body.data,w=void 0===v?{}:v,x=w.data,y=w.success,z=void 0!==y&&y,A=w.resultMsg,B=void 0===A?"\u672A\u77E5\u9519\u8BEF":A,!0===z){b.next=31;break}throw new Error(B);case 31:return b.abrupt("return",{data:x,success:!0});case 34:throw b.prev=34,b.t1=b["catch"](2),new Error(b.t1.message);case 37:case"end":return b.stop()}},b,null,[[2,34]])}));return function(){return a.apply(this,arguments)}}(); |
{ | ||
"name": "@alipay-inc/mpaas-ide-openapi-classic", | ||
"version": "1.0.40-alpha.0", | ||
"version": "1.0.41-alpha.0", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "repository": "https://code.alipay.com/mPaaS-IDE-Adaptor/mPaaS-IDE-openAPI.git", |
20820