@alipay-inc/mpaas-ide-openapi 1.0.9-alpha.9 → 1.0.11-alpha.0
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/README.md +59 -13
- package/dist/index.js +1 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -102,7 +102,13 @@
|
|
|
102
102
|
|
|
103
103
|
#### getAppListByApi 拉取小程序列表
|
|
104
104
|
|
|
105
|
-
- 入参
|
|
105
|
+
- 入参
|
|
106
|
+
|
|
107
|
+
- ```js
|
|
108
|
+
{
|
|
109
|
+
miniType: 'plugin' // 选填,是否为小程序插件
|
|
110
|
+
}
|
|
111
|
+
```
|
|
106
112
|
|
|
107
113
|
- 返回
|
|
108
114
|
|
|
@@ -136,7 +142,8 @@
|
|
|
136
142
|
{
|
|
137
143
|
h5Id: '<string>', // 必填,小程序ID
|
|
138
144
|
h5Name: '<string>', // 必填,小程序名称
|
|
139
|
-
packageTypes: '<string>'
|
|
145
|
+
packageTypes: '<string>', // 可选,默认 '1,2,3,4',
|
|
146
|
+
miniType: 'plugin' // 选填,是否为小程序插件
|
|
140
147
|
}
|
|
141
148
|
```
|
|
142
149
|
|
|
@@ -164,14 +171,19 @@
|
|
|
164
171
|
|
|
165
172
|
- ```js
|
|
166
173
|
{
|
|
167
|
-
appInfo:
|
|
168
|
-
packageType:
|
|
169
|
-
resourceFile:
|
|
170
|
-
iconFile:
|
|
171
|
-
h5Version:
|
|
172
|
-
whiteListValue:
|
|
173
|
-
|
|
174
|
-
|
|
174
|
+
appInfo: '<object>', // 必填,小程序配置
|
|
175
|
+
packageType: '<string>', // 必填,包类型(1,2 为正式包。3,4 为测试包)
|
|
176
|
+
resourceFile: '<string>', // 必填,小程序包的本地绝对路径
|
|
177
|
+
iconFile: '<string>', // 选填,小程序图标的本地绝对路径
|
|
178
|
+
h5Version: '<string>', // 选填,版本号(若传入,则使用此版本号。若未传入,则使用appInfo.h5Version + packageType生成新的版本号)
|
|
179
|
+
whiteListValue: '<string>', // 选填,白名单(若packageType === '3' || '4',则为测试包,需要白名单)
|
|
180
|
+
uuid: '<string>', // 选填,真机调试的UUID(若packageType === '3',则为调试包,需要UUID,未必填项)
|
|
181
|
+
sourceCodeFile: '<string>', // 选填,源码包本地的压缩包地址,
|
|
182
|
+
appxVersion: '<string>', // 选填,'1.0' || '2.0',appx的版本。默认 '1.0',
|
|
183
|
+
buildTarget: '<string>', // 选填,远程调试类型,'RemoteBoatman' 为新版,需要匹配新容器
|
|
184
|
+
miniType: 'plugin', // 选填,是否为小程序插件
|
|
185
|
+
pluginFile: '<string>', // 选填,小程序插件的本地绝对路径(无需转换zip格式)
|
|
186
|
+
bindMiniPluginIds: '<string>', // 选填,小程序需要使用的插件资源id,多个使用逗号分隔
|
|
175
187
|
}
|
|
176
188
|
```
|
|
177
189
|
|
|
@@ -179,15 +191,49 @@
|
|
|
179
191
|
|
|
180
192
|
- ```javascript
|
|
181
193
|
{
|
|
182
|
-
data: '<
|
|
183
|
-
|
|
184
|
-
|
|
194
|
+
data: '<object>',
|
|
195
|
+
/**
|
|
196
|
+
* packageType === 3 || 4
|
|
197
|
+
* {
|
|
198
|
+
* debugUrl: '....', // 二维码地址
|
|
199
|
+
* userId: 'xxx', //
|
|
200
|
+
* h5Version: 'xxx', // 本次上传的版本号
|
|
201
|
+
* gmtCreate: 'xxx', // 本次上传的时间戳
|
|
202
|
+
* }
|
|
203
|
+
*
|
|
204
|
+
*
|
|
205
|
+
* packageType === 1 || 2
|
|
206
|
+
* {
|
|
207
|
+
* packageId: '....',// 本次上传的ID
|
|
208
|
+
* h5Version: 'xxx', // 本次上传的版本号
|
|
209
|
+
* gmtCreate: 'xxx', // 本次上传的时间戳
|
|
210
|
+
* }
|
|
211
|
+
*/
|
|
185
212
|
errorCode: 'OK',
|
|
186
213
|
requestId: '<string>',
|
|
187
214
|
resultMsg: '',
|
|
188
215
|
success: true
|
|
189
216
|
}
|
|
190
217
|
```
|
|
218
|
+
#### checkPluginByApi 查询小程序插件权限
|
|
219
|
+
|
|
220
|
+
- 入参
|
|
221
|
+
|
|
222
|
+
- ```js
|
|
223
|
+
{
|
|
224
|
+
miniPluginId: '<string>', // 必填,小程序插件ID
|
|
225
|
+
miniProgramId: '<string>', // 必填,小程序ID
|
|
226
|
+
}
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
- 返回
|
|
230
|
+
|
|
231
|
+
- ```js
|
|
232
|
+
{
|
|
233
|
+
data: '<string>', // 小程序插件包地址
|
|
234
|
+
success: true // false
|
|
235
|
+
}
|
|
236
|
+
```
|
|
191
237
|
|
|
192
238
|
### 公共API
|
|
193
239
|
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault"),_typeof=require("@babel/runtime/helpers/typeof");Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;var
|
|
1
|
+
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault"),_typeof=require("@babel/runtime/helpers/typeof");Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator")),_asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")),_objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties")),_classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")),_createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass")),_defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty")),_mpaasIdeOpenapiAliyun=_interopRequireDefault(require("@alipay-inc/mpaas-ide-openapi-aliyun")),_mpaasIdeOpenapiAntfin=_interopRequireDefault(require("@alipay-inc/mpaas-ide-openapi-antfin")),_mpaasIdeOpenapiClassic=_interopRequireDefault(require("@alipay-inc/mpaas-ide-openapi-classic")),CommonClient=_interopRequireWildcard(require("@alipay-inc/mpaas-ide-openapi-common")),_superagent=_interopRequireDefault(require("superagent")),_excluded=["openapi"];function _getRequireWildcardCache(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(_getRequireWildcardCache=function(a){return a?c:b})(a)}function _interopRequireWildcard(a,b){if(!b&&a&&a.__esModule)return a;if(null===a||"object"!==_typeof(a)&&"function"!=typeof a)return{default:a};var c=_getRequireWildcardCache(b);if(c&&c.has(a))return c.get(a);var d={},e=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in a)if("default"!=f&&Object.prototype.hasOwnProperty.call(a,f)){var g=e?Object.getOwnPropertyDescriptor(a,f):null;g&&(g.get||g.set)?Object.defineProperty(d,f,g):d[f]=a[f]}return d["default"]=a,c&&c.set(a,d),d}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 OpenAPI=function(){function a(b){var c=this;(0,_classCallCheck2["default"])(this,a),(0,_defineProperty2["default"])(this,"updateConfig",function(a){c.client.config=_objectSpread(_objectSpread({},c.client.config),a)}),global.mpaasOpenApi=global.mpaasOpenApi||{},this.config=b,global.mpaasOpenApi.log=b.log,this.checkConfig(),this.createClient()}return(0,_createClass2["default"])(a,[{key:"createClient",value:function createClient(){var a=this;try{var b={},c=this.config,d=c.openapi,e=(0,_objectWithoutProperties2["default"])(c,_excluded),f=CommonClient.getConfigType(this.config),g=f.data;"classic"===g?b=new _mpaasIdeOpenapiClassic["default"](this.config):"aliyun"===g?b=new _mpaasIdeOpenapiAliyun["default"](_objectSpread(_objectSpread({},e),d)):"antfin"===g?b=new _mpaasIdeOpenapiAntfin["default"](_objectSpread(_objectSpread({},e),d)):void 0,b=Object.assign(b,CommonClient),this.client=_objectSpread({},b);var h=this.config.callback;h=void 0===h?{}:h;var i=h.api_url,j=h.actions,k=void 0===j?["getAppListByApi","getPackageInfoByApi","uploadPackageByApi","login"]:j;if(i){if(!Array.isArray(k))throw new Error("\u914D\u7F6E\u6587\u4EF6\u4E2D callback.actions \u683C\u5F0F\u9519\u8BEF");k.forEach(function(b){if(!a.client[b])throw new Error("\u914D\u7F6E\u6587\u4EF6\u4E2D callback.actions \u4E2D\u5B58\u5728\u65E0\u6548action: ".concat(b))}),k.forEach(function(c){delete a.client[c],a.client[c]=function(){var d=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function e(d){var f;return _regenerator["default"].wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,b[c](d);case 2:return f=e.sent,_superagent["default"].post(i).send({action:c,config:a.config,userInfo:CommonClient.getUserInfo(),req:d,res:f}).end(),e.abrupt("return",f);case 5:case"end":return e.stop();}},e)}));return function(){return d.apply(this,arguments)}}()})}global.mpaasOpenApi.client=this.client}catch(a){throw new Error(a.message)}}},{key:"checkConfig",value:function checkConfig(){var a=this.config.openapi;if(!a);else{var b=a.type,c=a.userId,d=a.privateKey,e=a.api_url,f=a.accessKeyId,g=a.accessKeySecret,h=a.endpoint;if(!c)throw new Error("userId \u5B57\u6BB5\u4E3A\u7A7A");if(!/^\w+$/.test(c))throw new Error("userId \u683C\u5F0F\u9519\u8BEF\u3001\u5B57\u6BCD\u6570\u5B57\u4E0B\u5212\u7EBF");if(!["aliyun","antfin"].includes(b))throw new Error("type \u7C7B\u578B\u4E0D\u5BF9");if("aliyun"===b){if(!f)throw new Error("accessKeyId \u5B57\u6BB5\u4E3A\u7A7A");if(!g)throw new Error("accessKeySecret \u5B57\u6BB5\u4E3A\u7A7A");if(!h)throw new Error("endpoint \u5B57\u6BB5\u4E3A\u7A7A")}else if("antfin"===b){if(!d)throw new Error("privateKey \u5B57\u6BB5\u4E3A\u7A7A");if(!e)throw new Error("api_url \u5B57\u6BB5\u4E3A\u7A7A")}}}}]),a}(),_default=OpenAPI;exports["default"]=_default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alipay-inc/mpaas-ide-openapi",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11-alpha.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"repository": "https://code.alipay.com/mPaaS-IDE-Adaptor/mPaaS-IDE-openAPI.git",
|
|
6
6
|
"author": "跟着勇哥有肉吃 <shengyong.zhu@antgroup.com>",
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
"prepublish": "yarn build"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@alipay-inc/mpaas-ide-openapi-aliyun": "^1.0.
|
|
15
|
-
"@alipay-inc/mpaas-ide-openapi-antfin": "^1.0.
|
|
16
|
-
"@alipay-inc/mpaas-ide-openapi-classic": "^1.0.
|
|
17
|
-
"@alipay-inc/mpaas-ide-openapi-common": "^1.0.
|
|
14
|
+
"@alipay-inc/mpaas-ide-openapi-aliyun": "^1.0.11-alpha.0",
|
|
15
|
+
"@alipay-inc/mpaas-ide-openapi-antfin": "^1.0.11-alpha.0",
|
|
16
|
+
"@alipay-inc/mpaas-ide-openapi-classic": "^1.0.11-alpha.0",
|
|
17
|
+
"@alipay-inc/mpaas-ide-openapi-common": "^1.0.11-alpha.0",
|
|
18
18
|
"@babel/runtime": "^7.15.4",
|
|
19
19
|
"archiver": "^5.3.0",
|
|
20
20
|
"chalk": "^4.1.2",
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"publishConfig": {
|
|
32
32
|
"access": "public"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "fa09d90121518fe32d0fb36ae853b3373eeef60a"
|
|
35
35
|
}
|