@alipay-inc/mpaas-ide-openapi 1.0.0-beta.14 → 1.0.0-beta.15

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.
Files changed (2) hide show
  1. package/README.md +68 -254
  2. package/package.json +6 -6
package/README.md CHANGED
@@ -8,18 +8,19 @@
8
8
 
9
9
  #### 私有云
10
10
 
11
+ - 请联系PDSA
11
12
 
12
13
 
13
14
  ### 接口返回数据标准
14
15
 
15
16
  ```js
16
17
  {
17
- data: 'any', // 返回数据
18
- errorCode: 'string', // 错误代码,非必选
19
- requestId: 'string', // 请求ID,非必选
20
- resultMsg: 'string', // 当success !== true,必选
21
- success: 'boolean', // 是否正确返回
22
- ... // 各环境自定义字段
18
+ data: '<any>', // 返回数据
19
+ errorCode: '<string>', // 错误代码,非必选
20
+ requestId: '<string>', // 请求ID,非必选
21
+ resultMsg: '<string>', // 当success !== true,必选
22
+ success: '<boolean>', // 是否正确返回
23
+ ... // 各环境自定义字段
23
24
  }
24
25
  ```
25
26
 
@@ -36,28 +37,30 @@
36
37
  - ```javascript
37
38
  {
38
39
  ...配置文件内容,
39
- openapi: {
40
- type: 'aliyun',
41
- accessKeyId: '<阿里云 AccessKey ID>',
42
- accessKeySecret: '<阿里云 AccessKey Secret>',
43
- endpoint: 'mpaas.cn-hangzhou.aliyuncs.com',
40
+ "openapi": {
41
+ "type": 'aliyun', // 必填、固定值
42
+ "userId": '<string>', // 必填、字母数字下划线
43
+ "accessKeyId": '<阿里云 AccessKey ID>', // 必填
44
+ "accessKeySecret": '<阿里云 AccessKey Secret>', // 必填
45
+ "endpoint": 'mpaas.cn-hangzhou.aliyuncs.com', // 必填、固定值
44
46
  }
45
47
  }
46
48
  ```
47
-
49
+
48
50
  - 私有化openapi,需要配置rsa
49
-
51
+
50
52
  - ```javascript
51
53
  {
52
54
  ...配置文件内容,
53
- openapi: {
54
- type: 'antfin',
55
- privateKey: '<私钥 string format>',
56
- api_url: '<私有云api地址>'
55
+ "openapi": {
56
+ "type": 'antfin', // 必填、固定值
57
+ "userId": '<string>', // 必填、字母数字下划线
58
+ "privateKey": '<私钥 string format>', // 必填 https://www.samltool.com/format_privatekey.php
59
+ "api_url": '<私有云api地址>' // 必填
57
60
  }
58
61
  }
59
62
  ```
60
-
63
+
61
64
 
62
65
 
63
66
  ### 使用方法
@@ -80,7 +83,7 @@
80
83
 
81
84
 
82
85
 
83
- ### 主要API
86
+ ### API
84
87
 
85
88
  #### getAppListByApi 拉取小程序列表
86
89
 
@@ -92,315 +95,126 @@
92
95
  {
93
96
  data: [
94
97
  {
95
- appCode: 'string',
96
- gmtCreate: 'string'
97
- gmtModified: 'string',
98
- h5Id: 'string',
99
- h5Name: 'string'
100
- }
98
+ appCode: '<string>',
99
+ gmtCreate: '<string>'
100
+ gmtModified: '<string>',
101
+ h5Id: '<string>',
102
+ h5Name: '<string>',
103
+ ...
104
+ },
105
+ ...
101
106
  ],
102
107
  errorCode: 'OK',
103
- requestId: 'string',
108
+ requestId: '<string>',
104
109
  resultMsg: '',
105
110
  success: true
106
111
  }
107
112
  ```
108
113
 
109
-
110
114
  #### getPackageInfoByApi 拉取小程序配置
111
115
 
112
- - 入参
113
-
114
- - ```js
115
- {
116
- h5Id: 'string',
117
- packageTypes: 'string' // 可选,默认 '1,2,3,4'
118
- }
119
- ```
120
-
121
- - 返回
122
-
123
- - ```javascript
124
- {
125
- data: {
126
- appCode: 'ONEX7036F60021129-a3',
127
- autoInstall: 0,
128
- clientVersionMax: '',
129
- clientVersionMin: '0.0.0.0;0.0.0.0',
130
- downloadUrl: 'https://mcube-prod.cn-hangzhou.oss.aliyuncs.com/ONEX7036F60021129-a3/1234567890123452/1.0.0.1_all/nebula/1234567890123452_1.0.0.1.amr',
131
- extendInfo: '',
132
- 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"}',
133
- 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/',
134
- gmtCreate: '2021-07-22 16:13:44',
135
- gmtModified: '2021-07-22 16:23:43',
136
- h5Id: '1234567890123452',
137
- h5Name: '小程序5',
138
- h5Version: '1.0.0.1',
139
- id: 587253,
140
- installType: 0,
141
- mainUrl: '',
142
- memo: 'https://mcube-prod.cn-hangzhou.oss.aliyuncs.com/ONEX7036F60021129-a3/1234567890123452/1.0.0.1_all/nebula/nebula_json/h5_json.json',
143
- packageType: 1,
144
- platform: 'all',
145
- publishPeriod: 3,
146
- resourceType: 4,
147
- status: 1
148
- },
149
- errorCode: 'OK',
150
- requestId: 'string',
151
- resultMsg: '',
152
- success: true
153
- }
154
- ```
155
-
156
- #### createWhiteListByApi 创建白名单
116
+ - 若此小程序从未发布过,则读取默认配置
157
117
 
158
118
  - 入参
159
119
 
160
120
  - ```js
161
121
  {
162
- userId: 'string', // IDE 中如果非openapi的话,拿login返回的userId。如果是openapi去local设置的uuid
163
- whitelistValue: 'string'
122
+ h5Id: '<string>', // 必填,小程序ID
123
+ h5Name: '<string>', // 必填,小程序名称
124
+ packageTypes: '<string>' // 可选,默认 '1,2,3,4'
164
125
  }
165
126
  ```
166
127
 
167
128
  - 返回
168
129
 
169
- - ```js
130
+ - ```javascript
170
131
  {
171
- data: 'string', // 创建的白名单ID
132
+ data: '<object>',
172
133
  errorCode: 'OK',
173
- requestId: 'string',
134
+ requestId: '<string>',
174
135
  resultMsg: '',
175
136
  success: true
176
137
  }
177
138
  ```
178
139
 
179
- #### uploadPackage 上传小程序包
180
-
181
- - 入参
182
-
183
- - ```js
184
- {
185
- appInfo: 'object', // 小程序配置
186
- packageType: 'string', // 包类型 (1,2 为正式包。3,4 为测试包)
187
- resourceFile: 'string', // 小程序包的本地绝对路径 (远程包需要自行下载到本地转换为本地绝对路径)
188
- iconFile: 'string', // 小程序图标的本地绝对路径 (远程包需要自行下载到本地转换为本地绝对路径)
189
- }
190
- ```
140
+ #### uploadPackageByApi 上传小程序并发布
191
141
 
192
- - 返回
142
+ - 上传小程序包之前,需要检测是否配置虚拟域名,若未配置,则报错
193
143
 
194
- - ```js
195
- {
196
- data: 'string', // 上传任务ID
197
- errorCode: 'OK',
198
- requestId: 'string',
199
- resultMsg: '',
200
- success: true
201
- }
202
- ```
144
+ - 预览调试包上传并发布,正式包只上传
203
145
 
204
- #### createNebulaTask 发布小程序
146
+ - 调试包上传之前需要检测是否有白名单,若无白名单,则直接报错返回
205
147
 
206
148
  - 入参
207
149
 
208
150
  - ```js
209
151
  {
210
- packageId: 'string', // 白名单ID
211
- whitelistIds: 'string', // 上传任务ID
152
+ appInfo: '<object>', // 必填,小程序配置
153
+ packageType: '<string>', // 必填,包类型(1,2 为正式包。3,4 为测试包)
154
+ resourceFile: '<string>', // 必填,小程序包的本地绝对路径
155
+ iconFile: '<string>', // 选填,小程序图标的本地绝对路径
156
+ h5Version: '<string>', // 选填,版本号(若传入,则使用此版本号。若未传入,则使用appInfo.h5Version + packageType生成新的版本号)
157
+ whitelistValue: '<string>', // 选填,白名单(若packageType === '3' || '4',则为测试包,需要白名单)
212
158
  }
213
159
  ```
214
160
 
215
161
  - 返回
216
162
 
217
- - ```js
163
+ - ```javascript
218
164
  {
219
- data: 'string', // 发布任务ID
165
+ data: '<string>',
166
+ // packageType === 3 || 4。"{&quot;debugUrl&quot;:&quot;mpaas://platformapi/startapp?appId=20001101&amp;token=ide_qr&amp;scheme=mpaas%3A%2F%2Fplatformapi%2Fstartapp%3FappId%3D1234567890123456%26nbsv%3D1.4.25.62%26nbsource%3Ddebug%26nbprefer%3DYES%26nbsn%3DDEBUG%26nboffline%3Dsync%26nbtoken%3Dide_qr%26enableBugme%3Dfalse%26chInfo%3Dch_scan%26channelId%3Dnull%26enablePolyfillWorker%3D%26isRemoteDebug%3Dfalse%26enableBugme%3Dfalse%26websocketUrl%3Dwss%3A%2F%2Fcn-hangzhou-mproxy.cloud.alipay.com&quot;,&quot;userId&quot;:&quot;shengyong_zhu&quot;}"
167
+ // packageType === 1 || 2。 "发布ID"
220
168
  errorCode: 'OK',
221
- requestId: 'string',
169
+ requestId: '<string>',
222
170
  resultMsg: '',
223
171
  success: true
224
172
  }
225
173
  ```
226
174
 
175
+ ### 公共API
227
176
 
228
-
229
- #### uploadPackageByApi 上传小程序并发布
230
-
231
- - 集合了createWhiteListByApi、uploadPackage、createNebulaTask 三个接口
232
-
233
- - 预览调试包上传并发布,正式包只上传。
234
- - 调试包上传之前需要检测是否有白名单,若无白名单,则直接报错返回。
235
-
236
- - 此接口只有IDE原有的classic提供,其他端需要模拟
237
- - https://yuque.antfin-inc.com/docs/share/7a4a6272-36e4-4176-b50d-2d346a351267?#%20%E3%80%8AIDE%E4%B8%8A%E4%BC%A0%E5%B0%8F%E7%A8%8B%E5%BA%8F%E5%8C%85%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E%E3%80%8B
238
-
239
- - 入参
240
-
241
- - ```javascript
242
- {
243
- appInfo: 'object', // 小程序配置
244
- packageType: 'string', // 包类型 (1,2 为正式包。3,4 为测试包)
245
- resourceFile: 'string', // 小程序包的本地绝对路径 (远程包需要自行下载到本地转换为本地绝对路径)
246
- iconFile: 'string', // 小程序图标的本地绝对路径 (远程包需要自行下载到本地转换为本地绝对路径)
247
- h5Version: 'string', // 版本号,可选。(若传入,则使用此版本号。若未传入,则使用appInfo.h5Version + packageType生成新的版本号)
248
- whitelistValue: 'string', // 白名单(若packageType === '3' || '4',则为测试包,需要白名单)
249
- userId: 'string', // 可选。用来区分白名单名称 `${appId}-${workspaceId}-${tenantId}-${userId}`
250
- }
251
- ```
252
-
253
-
254
-
255
- ### 通用API
256
-
257
- #### uploadFile 上传文件
177
+ #### cloudBuild 云构建小程序
258
178
 
259
179
  - 入参
260
180
 
261
181
  - ```js
262
182
  {
263
- filePath: 'string', // 目前支持本地文件的绝对路径,后期可以考虑file object/远程文件地址
183
+ file: '<string>', // 必填,本地amr文件路径
184
+ config: '<object>' // 必填,配置文件
264
185
  }
265
186
  ```
266
187
 
267
188
  - 返回
268
189
 
269
- - ```js
270
- {
271
- data: 'string', // 上传文件后保存在服务器的地址
272
- errorCode: '',
273
- success: true
274
- }
275
- ```
276
-
277
- #### getVersion 获取版本
278
-
279
- - 入参
280
-
281
- - ```js
282
- {
283
- version: '1.1.1.5'
284
- }
285
- ```
286
-
287
- - 返回
288
-
289
- - ```js
190
+ - ```javascript
290
191
  {
291
192
  data: {
292
- current: '1.1.1.5', // 当前版本
293
- nextProd: '1.1.2.0', // 下一生产版本
294
- nextDev: '1.1.1.6' // 下一测试版本
193
+ file: '<string>', // 本地根据appId生成的mPaaS zip文件,可以直接从控制台上传
194
+ originFile: '<string>' // 云构建原始文件
295
195
  },
296
- success: true
297
- }
298
- ```
299
-
300
- #### getUUID 获取uuid
301
-
302
- - 入参
303
-
304
- - ```js
305
- {
306
- url: 'string'
307
- }
308
- ```
309
-
310
- - 返回
311
-
312
- - ```js
313
- {
314
- data: 'dbc1898e-2501-417f-b2dc-5e6e1fc2739e',
315
- success: true
196
+ success: true
316
197
  }
317
198
  ```
318
199
 
319
- #### getZipFromTar tar文件转zip ,用来拿到IDE/mpaasu 构建后的小程序包转为mpaas可上传的格式
200
+ #### getZipFromTar 将本地IDE/mpaasu构建后的小程序tar文件转为mPaaS格式的zip文件
320
201
 
321
202
  - 入参
322
203
 
323
204
  - ```js
324
205
  {
325
- tarFilePath: '/var/folders/ls/9svnt3gj0_q3f_gyflbk7gqw0000gn/T/minicode_compile_dy/dist-OikE6ZQHD-1629797477127/dist.tar',
326
- appId: '123456'
327
- }
328
- ```
329
-
330
- - 返回
331
-
332
- - ```js
333
- {
334
- data: '/var/folders/ls/9svnt3gj0_q3f_gyflbk7gqw0000gn/T/9593340d-8e28-4681-880c-4d7320736685/123456.zip',
335
- success: true
206
+ tarFilePath: '<string>', // 必填,本地tar文件
207
+ appId: '<string>' // 必填,配置文件中的appId
336
208
  }
337
209
  ```
338
210
 
339
- #### getVhostByApi 查询当前app是否设置虚拟域名
340
-
341
- - 入参 -
342
-
343
211
  - 返回
344
212
 
345
- - ```js
346
- {
347
- data: 'tinyapp.com',
348
- errorCode: 'OK',
349
- requestId: '599D03FC-2558-533C-BB88-3B3DCD67FB05',
350
- resultMsg: '',
351
- success: true
352
- }
353
- ```
354
-
355
- #### getPackageType 判断当前的包类型
356
-
357
- - 入参
358
-
359
- - packageType
360
-
361
- - 返回
362
-
363
- - ```js
364
- {
365
- data: 'production' || 'development',
366
- success: true
367
- }
368
- ```
369
-
370
- #### looseJsonParse 不规范json string转换json object
371
-
372
- - 入参
373
-
374
- - string
375
-
376
- - 返回
377
-
378
- - ```js
379
- {
380
- data: 'json object',
381
- success: true
382
- }
383
- ```
384
-
385
- #### downloadFile 远程文件保存至本地
386
-
387
- - 入参
388
-
389
- - ```
390
- {
391
- url: 'string', // 需要下载文件的远程地址
392
- target: 'string' // 需要保存至本地的路径。可选,不填写的话,会保存至本地的 `${tmpdir()}/.mpaas_ide_openapi`
393
- }
394
- ```
395
-
396
-
397
-
398
- - 返回
399
-
400
- - ```js
213
+ - ```javascript
401
214
  {
402
- data: 'string', // 下载至本地的文件地址
403
- success: true
215
+ data: '<string>', // 转换后的zip文件本地路径
216
+ success: true
404
217
  }
405
218
  ```
406
219
 
220
+ ####
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alipay-inc/mpaas-ide-openapi",
3
- "version": "1.0.0-beta.14",
3
+ "version": "1.0.0-beta.15",
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.0-beta.14",
15
- "@alipay-inc/mpaas-ide-openapi-antfin": "^1.0.0-beta.14",
16
- "@alipay-inc/mpaas-ide-openapi-classic": "^1.0.0-beta.14",
17
- "@alipay-inc/mpaas-ide-openapi-common": "^1.0.0-beta.14",
14
+ "@alipay-inc/mpaas-ide-openapi-aliyun": "^1.0.0-beta.15",
15
+ "@alipay-inc/mpaas-ide-openapi-antfin": "^1.0.0-beta.15",
16
+ "@alipay-inc/mpaas-ide-openapi-classic": "^1.0.0-beta.15",
17
+ "@alipay-inc/mpaas-ide-openapi-common": "^1.0.0-beta.15",
18
18
  "archiver": "^5.3.0",
19
19
  "fs-extra": "^10.0.0",
20
20
  "get-folder-size": "^3.1.0",
@@ -29,5 +29,5 @@
29
29
  "publishConfig": {
30
30
  "access": "public"
31
31
  },
32
- "gitHead": "20e0bab27a0f64ac069cd38cbea2e994abcac44d"
32
+ "gitHead": "4a6d95759508d8a8c5630cba03127c12e58ee1b9"
33
33
  }