Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@alipay-inc/mpaas-ide-openapi-aliyun

Package Overview
Dependencies
Maintainers
4
Versions
96
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@alipay-inc/mpaas-ide-openapi-aliyun - npm Package Compare versions

Comparing version 1.0.12-alpha.2 to 1.0.12-alpha.5

2

dist/index.js

@@ -1,1 +0,1 @@

"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator")),_asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")),_classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")),_createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass")),_defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));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 superagent=require("superagent"),chalk=require("chalk"),fs=require("fs-extra"),path=require("path"),isElectron=require("is-electron");if(isElectron()){var tempPackage=path.resolve(__dirname,"../","../","package.json");fs.existsSync(tempPackage)||(fs.ensureFileSync(tempPackage),fs.writeFileSync(tempPackage,"{\"name\": \"@alicloud/credentials\", \"version\": \"2.2.0\"}"))}var _require=require("@alipay-inc/mpaas-ide-openapi-common"),getPackageType=_require.getPackageType,looseJsonParse=_require.looseJsonParse,logger=_require.logger,getUploadData=_require.getUploadData,delay=_require.delay,getUploadResult=_require.getUploadResult,getDefaultTinyappConfig=_require.getDefaultTinyappConfig,Request=require("./utils")["default"],OpenAPI=function(){function a(b){var c=this;(0,_classCallCheck2["default"])(this,a),(0,_defineProperty2["default"])(this,"getAppListByApi",(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function a(){var b,d,e=arguments;return _regenerator["default"].wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return b=0<e.length&&void 0!==e[0]?e[0]:{},logger.info("getAppListByApi req",b),a.prev=2,a.next=5,c.request({name:"listMcubeMiniApps",resultKey:"listMiniResult",dataKey:"miniProgramList",req:b});case 5:return d=a.sent,logger.info("getAppListByApi res",d),console.log(chalk.green("getAppListByApi done")),a.abrupt("return",d);case 11:return a.prev=11,a.t0=a["catch"](2),logger.error("getAppListByApi error",a.t0.message),a.next=16,delay(0);case 16:throw new Error(a.t0.message);case 17:case"end":return a.stop();}},a,null,[[2,11]])}))),(0,_defineProperty2["default"])(this,"getPackageInfoByApi",(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function a(){var b,d,e,f,g,h,i,j=arguments;return _regenerator["default"].wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return b=0<j.length&&void 0!==j[0]?j[0]:{},logger.info("getPackageInfoByApi req",b),d=b.h5Id,e=b.h5Name,f=b.packageTypes,g=void 0===f?"1,2,3,4":f,a.prev=3,a.next=6,c.request({name:"listMcubeMiniPackages",resultKey:"listMiniPackageResult",dataKey:"miniPackageList",req:{h5Id:d,h5Name:e,packageTypes:g}});case 6:if(h=a.sent,h.success){a.next=9;break}throw new Error(h.resultMsg);case 9:;if(!(null!==h&&void 0!==h&&h.data[0])){a.next=16;break}return a.next=13,c.request({name:"queryMcubeMiniPackage",resultKey:"queryMiniPackageResult",dataKey:"miniPackageInfo",req:{h5Id:d,id:h.data[0].id}});case 13:i=a.sent,a.next=18;break;case 16:logger.info("getPackageInfoByApi info \u672A\u62C9\u53D6\u5230\u5C0F\u7A0B\u5E8F\u914D\u7F6E\uFF0C\u5C06\u4F7F\u7528\u9ED8\u8BA4\u914D\u7F6E"),i={data:getDefaultTinyappConfig({h5Id:d,h5Name:e}).data,success:!0};case 18:return logger.info("getPackageInfoByApi res",i),console.log(chalk.green("getPackageInfoByApi done")),a.abrupt("return",i);case 23:return a.prev=23,a.t0=a["catch"](3),logger.error("getPackageInfoByApi error",a.t0.message),a.next=28,delay(0);case 28:throw new Error(a.t0.message);case 29:case"end":return a.stop();}},a,null,[[3,23]])}))),(0,_defineProperty2["default"])(this,"uploadPackageByApi",(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function a(){var b,d,e,f,g,h=arguments;return _regenerator["default"].wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return b=0<h.length&&void 0!==h[0]?h[0]:{},logger.info("getPackageInfoByApi req",b),a.prev=2,d=c.config.userId,e=b.whiteListValue,a.next=7,getUploadData({type:"aliyun",config:c.config,req:b,getVhostByApi:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return c.methods.queryMcubeVhost(_objectSpread({},a))},createWhitelistByApi:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return c.methods.createMcubeWhitelistForIde(_objectSpread(_objectSpread({},a),{},{whitelistValue:e,userId:d}))},uploadFile:function(a){return c.methods.uploadFile({filePath:a})}});case 7:return f=a.sent,logger.info("uploadPackageByApi qs",f),f.onexFlag=!0,a.next=12,c.request({name:"uploadMcubeMiniPackage",resultKey:"uploadMiniPackageResult",dataKey:"returnPackageResult",req:f});case 12:return g=a.sent,logger.info("uploadPackageByApi res",g),console.log(chalk.green("uploadPackageByApi done")),a.abrupt("return",getUploadResult({res:g,h5Version:f.h5Version,req:b}));case 18:return a.prev=18,a.t0=a["catch"](2),logger.error("uploadPackageByApi error",a.t0.message),a.next=23,delay(0);case 23:throw new Error(a.t0.message);case 24:case"end":return a.stop();}},a,null,[[2,18]])}))),logger.info("********************************\u914D\u7F6E\u6587\u4EF6\u7C7B\u578B\uFF1Aaliyun********************************"),this.config=b;var d=new Request(this.config),e=d.request;this.request=e,this.createMethods()}return(0,_createClass2["default"])(a,[{key:"createMethods",value:function createMethods(){var a=this;this.methods={createMcubeWhitelistForIde:function createMcubeWhitelistForIde(b){var c=b.userId,d=b.whitelistValue;return a.request({name:"createMcubeWhitelistForIde",resultKey:"createWhitelistForIdeResult",dataKey:"whitelistId",req:{userId:c,whitelistValue:d}})},getMcubeFileToken:function getMcubeFileToken(){return a.request({name:"getMcubeFileToken",resultKey:"getFileTokenResult",dataKey:"fileToken",req:{onexFlag:!0}})},queryMcubeVhost:function queryMcubeVhost(){return a.request({name:"queryMcubeVhost",resultKey:"queryVhostResult",dataKey:"data"})},uploadFile:function(){var b=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function c(b){var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;return _regenerator["default"].wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return d=b.filePath,c.prev=1,e=fs.readFileSync(d),f=path.basename(d).replace(/\s/g,"_"),c.next=6,a.methods.getMcubeFileToken();case 6:return g=c.sent,h=g.data,h=void 0===h?{}:h,i=h.host,j=h.accessid,k=h.policy,l=h.signature,m=h.dir,n=void 0===m?"":m,o="".concat(n,"/").concat(f),p="".concat(i,"/").concat(o),q={Key:o,Name:f,Policy:k,OSSAccessKeyId:j,success_action_status:"200",Signature:l,OnexFlag:!0,File:e},c.next=15,superagent.post(i).field(q);case 15:return r=c.sent,c.abrupt("return",{data:p,errorCode:"",success:!0});case 19:throw c.prev=19,c.t0=c["catch"](1),new Error(c.t0);case 22:case"end":return c.stop();}},c,null,[[1,19]])}));return function uploadFile(){return b.apply(this,arguments)}}()}}}]),a}(),_default=OpenAPI;exports["default"]=_default;
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator")),_asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")),_classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")),_createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass")),_defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));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 superagent=require("superagent"),chalk=require("chalk"),fs=require("fs-extra"),path=require("path"),isElectron=require("is-electron");if(isElectron()){var tempPackage=path.resolve(__dirname,"../","../","package.json");fs.existsSync(tempPackage)||(fs.ensureFileSync(tempPackage),fs.writeFileSync(tempPackage,"{\"name\": \"@alicloud/credentials\", \"version\": \"2.2.0\"}"))}var _require=require("@alipay-inc/mpaas-ide-openapi-common"),getPackageType=_require.getPackageType,looseJsonParse=_require.looseJsonParse,logger=_require.logger,getUploadData=_require.getUploadData,delay=_require.delay,getUploadResult=_require.getUploadResult,getDefaultTinyappConfig=_require.getDefaultTinyappConfig,Request=require("./utils")["default"],OpenAPI=function(){function a(b){var c=this;(0,_classCallCheck2["default"])(this,a),(0,_defineProperty2["default"])(this,"getAppListByApi",(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function a(){var b,d,e=arguments;return _regenerator["default"].wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return b=0<e.length&&void 0!==e[0]?e[0]:{},logger.info("getAppListByApi req",b),a.prev=2,a.next=5,c.request({name:"listMcubeMiniApps",resultKey:"listMiniResult",dataKey:"miniProgramList",req:b});case 5:return d=a.sent,logger.info("getAppListByApi res",d),console.log(chalk.green("getAppListByApi done")),a.abrupt("return",d);case 11:return a.prev=11,a.t0=a["catch"](2),logger.error("getAppListByApi error",a.t0.message),a.next=16,delay(0);case 16:throw new Error(a.t0.message);case 17:case"end":return a.stop();}},a,null,[[2,11]])}))),(0,_defineProperty2["default"])(this,"getPackageInfoByApi",(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function a(){var b,d,e,f,g,h,i,j=arguments;return _regenerator["default"].wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return b=0<j.length&&void 0!==j[0]?j[0]:{},logger.info("getPackageInfoByApi req",b),d=b.h5Id,e=b.h5Name,f=b.packageTypes,g=void 0===f?"1,2,3,4":f,a.prev=3,a.next=6,c.request({name:"listMcubeMiniPackages",resultKey:"listMiniPackageResult",dataKey:"miniPackageList",req:{h5Id:d,h5Name:e,packageTypes:g}});case 6:if(h=a.sent,h.success){a.next=9;break}throw new Error(h.resultMsg);case 9:;if(!(null!==h&&void 0!==h&&h.data[0])){a.next=16;break}return a.next=13,c.request({name:"queryMcubeMiniPackage",resultKey:"queryMiniPackageResult",dataKey:"miniPackageInfo",req:{h5Id:d,id:h.data[0].id}});case 13:i=a.sent,a.next=18;break;case 16:logger.info("getPackageInfoByApi info \u672A\u62C9\u53D6\u5230\u5C0F\u7A0B\u5E8F\u914D\u7F6E\uFF0C\u5C06\u4F7F\u7528\u9ED8\u8BA4\u914D\u7F6E"),i={data:getDefaultTinyappConfig({h5Id:d,h5Name:e}).data,success:!0};case 18:return logger.info("getPackageInfoByApi res",i),console.log(chalk.green("getPackageInfoByApi done")),a.abrupt("return",i);case 23:return a.prev=23,a.t0=a["catch"](3),logger.error("getPackageInfoByApi error",a.t0.message),a.next=28,delay(0);case 28:throw new Error(a.t0.message);case 29:case"end":return a.stop();}},a,null,[[3,23]])}))),(0,_defineProperty2["default"])(this,"uploadPackageByApi",(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function a(){var b,d,e,f,g,h=arguments;return _regenerator["default"].wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return b=0<h.length&&void 0!==h[0]?h[0]:{},logger.info("getPackageInfoByApi req",b),a.prev=2,d=c.config.userId,e=b.whiteListValue,a.next=7,getUploadData({type:"aliyun",config:c.config,req:b,getVhostByApi:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return c.methods.queryMcubeVhost(_objectSpread({},a))},createWhitelistByApi:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return c.methods.createMcubeWhitelistForIde(_objectSpread(_objectSpread({},a),{},{whitelistValue:e,userId:d}))},uploadFile:function(a){return c.methods.uploadFile({filePath:a})}});case 7:return f=a.sent,logger.info("uploadPackageByApi qs",f),f.onexFlag=!0,a.next=12,c.request({name:"uploadMcubeMiniPackage",resultKey:"uploadMiniPackageResult",dataKey:"returnPackageResult",req:f});case 12:return g=a.sent,logger.info("uploadPackageByApi res",g),console.log(chalk.green("uploadPackageByApi done")),a.abrupt("return",getUploadResult({res:g,h5Version:f.h5Version,req:b}));case 18:return a.prev=18,a.t0=a["catch"](2),logger.error("uploadPackageByApi error",a.t0.message),a.next=23,delay(0);case 23:throw new Error(a.t0.message);case 24:case"end":return a.stop();}},a,null,[[2,18]])}))),logger.info("********************************\u914D\u7F6E\u6587\u4EF6\u7C7B\u578B\uFF1Aaliyun********************************"),this.config=b;var d=new Request(this.config),e=d.request;this.request=e,this.createMethods()}return(0,_createClass2["default"])(a,[{key:"createMethods",value:function createMethods(){var a=this;this.methods={createMcubeWhitelistForIde:function createMcubeWhitelistForIde(b){var c=b.userId,d=b.whitelistValue;return a.request({name:"createMcubeWhitelistForIde",resultKey:"createWhitelistForIdeResult",dataKey:"whitelistId",req:{userId:c,whitelistValue:d}})},getMcubeFileToken:function getMcubeFileToken(){return a.request({name:"getMcubeFileToken",resultKey:"getFileTokenResult",dataKey:"fileToken",req:{onexFlag:!0}})},queryMcubeVhost:function queryMcubeVhost(){return a.request({name:"queryMcubeVhost",resultKey:"queryVhostResult",dataKey:"data"})},uploadFile:function(){function b(){return c.apply(this,arguments)}var c=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function c(b){var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;return _regenerator["default"].wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return d=b.filePath,c.prev=1,e=fs.readFileSync(d),f=path.basename(d).replace(/\s/g,"_"),c.next=6,a.methods.getMcubeFileToken();case 6:return g=c.sent,h=g.data,h=void 0===h?{}:h,i=h.host,j=h.accessid,k=h.policy,l=h.signature,m=h.dir,n=void 0===m?"":m,o="".concat(n,"/").concat(f),p="".concat(i,"/").concat(o),q={Key:o,Name:f,Policy:k,OSSAccessKeyId:j,success_action_status:"200",Signature:l,OnexFlag:!0,File:e},c.next=15,superagent.post(i).field(q);case 15:return r=c.sent,c.abrupt("return",{data:p,errorCode:"",success:!0});case 19:throw c.prev=19,c.t0=c["catch"](1),new Error(c.t0);case 22:case"end":return c.stop();}},c,null,[[1,19]])}));return b}()}}}]),a}(),_default=OpenAPI;exports["default"]=_default;
{
"name": "@alipay-inc/mpaas-ide-openapi-aliyun",
"version": "1.0.12-alpha.2",
"version": "1.0.12-alpha.5",
"main": "dist/index.js",

@@ -18,3 +18,3 @@ "repository": "https://code.alipay.com/mPaaS-IDE-Adaptor/mPaaS-IDE-openAPI.git",

"@alicloud/tea-util": "^1.4.2",
"@alipay-inc/mpaas-ide-openapi-common": "^1.0.12-alpha.2",
"@alipay-inc/mpaas-ide-openapi-common": "^1.0.12-alpha.5",
"@babel/runtime": "^7.15.4",

@@ -36,3 +36,3 @@ "chalk": "^4.1.2",

},
"gitHead": "68403aa9a9ae3d93a97bc7d7c7ec1a0670a4985c"
"gitHead": "41cb15582ea0bf7fb1c250b4c5e0f0ce04b67e76"
}

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc