Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
@alipay-inc/mpaas-ide-openapi
Advanced tools
{
data: 'any', // 返回数据
errorCode: 'string', // 错误代码,非必选
requestId: 'string', // 请求ID,非必选
resultMsg: 'string', // 当success !== true,必选
success: 'boolean', // 是否正确返回
... // 各环境自定义字段
}
从控制台下载配置文件 config
阿里云openapi,需要开通ak. https://help.aliyun.com/document_detail/175967.htm?spm=a2c4g.11186623.0.0.2bf41dcfwOHEGC
并自行完善配置文件
{
...配置文件内容,
openapi: {
type: 'aliyun',
accessKeyId: '<阿里云 AccessKey ID>',
accessKeySecret: '<阿里云 AccessKey Secret>',
endpoint: 'mpaas.cn-hangzhou.aliyuncs.com',
}
}
私有化openapi,需要配置rsa
{
...配置文件内容,
openapi: {
type: 'antfin',
privateKey: '<私钥 string format>',
api_url: '<私有云api地址>'
}
}
// 引入依赖
const Client = require('@alipay-inc/mpaas-ide-openapi').default;
// 引入配置文件
const config = '<上文中的配置文件>';
// 创建实例
const {
client
} = new Client(config);
// 发起请求
(async () => {
const result = await client.getAppListByApi();
console.log(result);
}());
入参 -
返回
{
data: [
{
appCode: 'string',
gmtCreate: 'string'
gmtModified: 'string',
h5Id: 'string',
h5Name: 'string'
}
],
errorCode: 'OK',
requestId: 'string',
resultMsg: '',
success: true
}
入参
{
h5Id: 'string',
packageTypes: 'string' // 可选,默认 '1,2,3,4'
}
返回
{
data: {
appCode: 'ONEX7036F60021129-a3',
autoInstall: 0,
clientVersionMax: '',
clientVersionMin: '0.0.0.0;0.0.0.0',
downloadUrl: 'https://mcube-prod.cn-hangzhou.oss.aliyuncs.com/ONEX7036F60021129-a3/1234567890123452/1.0.0.1_all/nebula/1234567890123452_1.0.0.1.amr',
extendInfo: '',
extraData: '{"enableKeepAlive":"0","enableOptionMenu":"1","enableTabBar":"0","iconUrl":"https://mcube-prod.cn-hangzhou.oss.aliyuncs.com/ONEX7036F60021129-a3/1234567890123452/1.0.0.1_all/icon/1234567890123452_1.0.0.1_版权.png","resourceType":"4"}',
fallbackBaseUrl: 'https://mcube-prod.cn-hangzhou.oss.aliyuncs.com/ONEX7036F60021129-a3/1234567890123452/1.0.0.1_all/nebula/fallback/;https://mcube-prod.cn-hangzhou.oss.aliyuncs.com/ONEX7036F60021129-a3/1234567890123452/1.0.0.1_all/nebula/fallback/',
gmtCreate: '2021-07-22 16:13:44',
gmtModified: '2021-07-22 16:23:43',
h5Id: '1234567890123452',
h5Name: '小程序5',
h5Version: '1.0.0.1',
id: 587253,
installType: 0,
mainUrl: '',
memo: 'https://mcube-prod.cn-hangzhou.oss.aliyuncs.com/ONEX7036F60021129-a3/1234567890123452/1.0.0.1_all/nebula/nebula_json/h5_json.json',
packageType: 1,
platform: 'all',
publishPeriod: 3,
resourceType: 4,
status: 1
},
errorCode: 'OK',
requestId: 'string',
resultMsg: '',
success: true
}
入参
{
userId: 'string', // IDE 中如果非openapi的话,拿login返回的userId。如果是openapi去local设置的uuid
whitelistValue: 'string'
}
返回
{
data: 'string', // 创建的白名单ID
errorCode: 'OK',
requestId: 'string',
resultMsg: '',
success: true
}
入参
{
appInfo: 'object', // 小程序配置
packageType: 'string', // 包类型 (1,2 为正式包。3,4 为测试包)
resourceFile: 'string', // 小程序包的本地绝对路径 (远程包需要自行下载到本地转换为本地绝对路径)
iconFile: 'string', // 小程序图标的本地绝对路径 (远程包需要自行下载到本地转换为本地绝对路径)
}
返回
{
data: 'string', // 上传任务ID
errorCode: 'OK',
requestId: 'string',
resultMsg: '',
success: true
}
入参
{
packageId: 'string', // 白名单ID
whitelistIds: 'string', // 上传任务ID
}
返回
{
data: 'string', // 发布任务ID
errorCode: 'OK',
requestId: 'string',
resultMsg: '',
success: true
}
集合了createWhiteListByApi、uploadPackage、createNebulaTask 三个接口
预览调试包上传并发布,正式包只上传。
调试包上传之前需要检测是否有白名单,若无白名单,则直接报错返回。
此接口只有IDE原有的classic提供,其他端需要模拟
入参
{
appInfo: 'object', // 小程序配置
packageType: 'string', // 包类型 (1,2 为正式包。3,4 为测试包)
resourceFile: 'string', // 小程序包的本地绝对路径 (远程包需要自行下载到本地转换为本地绝对路径)
iconFile: 'string', // 小程序图标的本地绝对路径 (远程包需要自行下载到本地转换为本地绝对路径)
h5Version: 'string', // 版本号,可选。(若传入,则使用此版本号。若未传入,则使用appInfo.h5Version + packageType生成新的版本号)
whitelistValue: 'string', // 白名单(若packageType === '3' || '4',则为测试包,需要白名单)
userId: 'string', // 可选。用来区分白名单名称 `${appId}-${workspaceId}-${tenantId}-${userId}`
}
入参
{
filePath: 'string', // 目前支持本地文件的绝对路径,后期可以考虑file object/远程文件地址
}
返回
{
data: 'string', // 上传文件后保存在服务器的地址
errorCode: '',
success: true
}
入参
{
version: '1.1.1.5'
}
返回
{
data: {
current: '1.1.1.5', // 当前版本
nextProd: '1.1.2.0', // 下一生产版本
nextDev: '1.1.1.6' // 下一测试版本
},
success: true
}
入参
{
url: 'string'
}
返回
{
data: 'dbc1898e-2501-417f-b2dc-5e6e1fc2739e',
success: true
}
入参
{
tarFilePath: '/var/folders/ls/9svnt3gj0_q3f_gyflbk7gqw0000gn/T/minicode_compile_dy/dist-OikE6ZQHD-1629797477127/dist.tar',
appId: '123456'
}
返回
{
data: '/var/folders/ls/9svnt3gj0_q3f_gyflbk7gqw0000gn/T/9593340d-8e28-4681-880c-4d7320736685/123456.zip',
success: true
}
入参 -
返回
{
data: 'tinyapp.com',
errorCode: 'OK',
requestId: '599D03FC-2558-533C-BB88-3B3DCD67FB05',
resultMsg: '',
success: true
}
入参
返回
{
data: 'production' || 'development',
success: true
}
入参
返回
{
data: 'json object',
success: true
}
入参
{
url: 'string', // 需要下载文件的远程地址
target: 'string' // 需要保存至本地的路径。可选,不填写的话,会保存至本地的 `${tmpdir()}/.mpaas_ide_openapi`
}
返回
{
data: 'string', // 下载至本地的文件地址
success: true
}
FAQs
### 接口说明
The npm package @alipay-inc/mpaas-ide-openapi receives a total of 18 weekly downloads. As such, @alipay-inc/mpaas-ide-openapi popularity was classified as not popular.
We found that @alipay-inc/mpaas-ide-openapi demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.