runner-runtime 1.0.62 → 1.0.63

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/events/api.js CHANGED
@@ -2197,6 +2197,7 @@ module.exports = (event, option, callback, eventRuntimeData, eventResultList) =>
2197
2197
  _.set(eventRuntimeData, [event?.event_id, "console"], []);
2198
2198
  }
2199
2199
  const time = Date.now()
2200
+ console.log({ time, level, args })
2200
2201
  eventRuntimeData[event?.event_id].console.push({ time, level, args })
2201
2202
  },
2202
2203
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "runner-runtime",
3
- "version": "1.0.62",
3
+ "version": "1.0.63",
4
4
  "description": "runner-runtime.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -24,6 +24,7 @@
24
24
  "apipost-tools": "^0.0.38",
25
25
  "atomic-sleep": "^1.0.0",
26
26
  "content-disposition": "^0.5.4",
27
+ "database-query": "^1.1.12",
27
28
  "exp-mock": "^2.0.15",
28
29
  "file-type": "^16.5.4",
29
30
  "is-image": "^3.0.0",
@@ -39,7 +40,7 @@
39
40
  "msgpack5": "^6.0.2",
40
41
  "net": "^1.0.2",
41
42
  "postman-collection": "^5.0.2",
42
- "postman-runtime-pro": "^7.43.16",
43
+ "postman-runtime-pro": "^7.43.17",
43
44
  "request-har": "^1.0.0",
44
45
  "strip-json-comments": "^3.1.1",
45
46
  "tough": "^0.6.0",
package/tmp/request.js CHANGED
@@ -1,6 +1,6 @@
1
1
  module.exports = {
2
2
  "option": {
3
- "scene": "auto_test",
3
+ "scene": "http_request",
4
4
  "globals": {},
5
5
  "project": {
6
6
  "request": {
@@ -186,39 +186,56 @@ module.exports = {
186
186
  "custom_functions": {},
187
187
  "collection": [
188
188
  {
189
- "target_id": "2b835ab23069000",
189
+ "target_id": "cf94971317030",
190
190
  "target_type": "api",
191
- "parent_id": "ac6c2b71700a",
192
- "name": "Anything",
191
+ "parent_id": "0",
192
+ "name": "GET 请求API 副本",
193
193
  "request": {
194
194
  "auth": {
195
195
  "type": "inherit"
196
196
  },
197
197
  "body": {
198
- "mode": "json",
198
+ "mode": "urlencoded",
199
199
  "parameter": [
200
200
  {
201
- "param_id": "12a8a25771004",
202
- "description": "",
201
+ "param_id": "cf59342771004",
202
+ "description": "记录对象最后更新的时间,精确到时分秒。\n",
203
203
  "field_type": "string",
204
204
  "is_checked": 1,
205
- "key": "aaaaaaa",
205
+ "key": "UpdatedAt",
206
206
  "not_null": 1,
207
- "value": "",
207
+ "value": "2024-10-01 12:00:00",
208
208
  "content_type": "",
209
209
  "file_name": "",
210
210
  "file_base64": "",
211
211
  "schema": {
212
- "type": "string"
212
+ "type": "string",
213
+ "default": "2024-10-01 12:00:00"
214
+ }
215
+ },
216
+ {
217
+ "param_id": "d90f4cb771009",
218
+ "description": "代表用户的姓氏,是用户个人信息中家族姓氏部分。\n",
219
+ "field_type": "string",
220
+ "is_checked": 1,
221
+ "key": "last_name",
222
+ "not_null": 1,
223
+ "value": "张",
224
+ "content_type": "",
225
+ "file_name": "",
226
+ "file_base64": "",
227
+ "schema": {
228
+ "type": "string",
229
+ "default": "张"
213
230
  }
214
231
  }
215
232
  ],
216
- "raw": "{\n \"id\": 1,\n \"name\": \"\"\n}",
233
+ "raw": "",
217
234
  "raw_parameter": [
218
235
  {
219
236
  "param_id": "2b835c6eb86902c",
220
237
  "description": "用户主键id",
221
- "field_type": "long",
238
+ "field_type": "Long",
222
239
  "is_checked": 1,
223
240
  "key": "id",
224
241
  "not_null": 1,
@@ -238,55 +255,53 @@ module.exports = {
238
255
  }
239
256
  ],
240
257
  "raw_schema": {
241
- "type": "object"
258
+ "type": "object",
259
+ "x-refs": {
260
+ "d90a9b9b17001": {
261
+ "$ref": "#/components/schemas/3eb25347fd6011"
262
+ }
263
+ },
264
+ "x-orders": [
265
+ "d90a9b9b17001"
266
+ ],
267
+ "properties": {}
242
268
  },
243
269
  "binary": {}
244
270
  },
245
- "pre_tasks": [
271
+ "pre_tasks": [],
272
+ "post_tasks": [
246
273
  {
247
- "type": "database",
274
+ "type": "customScript",
248
275
  "enabled": -1,
276
+ "data": "pm.environment.set(\"code\", 201);\napt.test(\"正文匹配含有字符串\", function () {\n apt.expect(apt.response.text()).to.include(\"期望查找的字符串\");\n });",
277
+ "name": "自定义脚本",
278
+ "id": "3d53b40ffd6022"
279
+ },
280
+ {
281
+ "type": "database",
282
+ "enabled": 1,
249
283
  "data": {
284
+ "query": "",
250
285
  "variables": [],
251
286
  "connectionId": "2b9e0de71864000",
252
- "isConsoleOutput": 1,
253
- "query": "select * from user limit 0,2"
287
+ "isConsoleOutput": -1
254
288
  },
255
289
  "name": "数据库",
256
- "id": "3d59fd65bd6066"
290
+ "id": "bcb573cb17048"
257
291
  },
258
292
  {
259
- "type": "customScript",
260
- "enabled": -1,
261
- "data": "// console.log(a)",
262
- "name": "自定义脚本",
263
- "id": "e7e75273d602e"
264
- }
265
- ],
266
- "post_tasks": [
267
- {
268
- "type": "customScript",
293
+ "type": "assert",
269
294
  "enabled": -1,
270
- "data": "pm.environment.set(\"code\", 201);\napt.test(\"成功的POST请求\", function () {\n apt.expect(apt.response.code).to.be.oneOf([201, 202]);\n});\npm.environment.set(\"code\", 201);\napt.test(\"成功的POST请求\", function () {\n apt.expect(apt.response.code).to.be.oneOf([201, 202]);\n});\n\napt.test(\"响应时间小于 200ms\", function () {\n apt.expect(apt.response.responseTime).to.be.below(200);\n });\napt.test(\"存在响应头 Content-Type\", function () {\n apt.response.to.have.header(\"Content-Type\");\n });\napt.test(\"状态码包含字符串\", function () {\n apt.response.to.have.status(\"Created\");\n });\nvar jsonObject = xml2Json(responseBody);\nvar schema = {\n \"items\": {\n \"type\": \"boolean\"\n }\n };\n\n var data1 = [true, false];\n var data2 = [true, 123];\n\n apt.test('Schema is valid', function () {\n apt.expect(tv4.validate(data1, schema)).to.be.true;\n apt.expect(tv4.validate(data2, schema)).to.be.true;\n });",
271
- "name": "自定义脚本",
272
- "id": "3d53b40ffd6022"
273
- },
274
- {
275
- "type": "pickVars",
276
- "id": "e91b563fd601a",
277
- "name": "提取变量",
278
- "enabled": 1,
279
295
  "data": {
280
- "source": "responseJson",
281
- "variables": [
282
- {
283
- "param_id": "e91b5723d601c",
284
- "name": "aaa",
285
- "expression": "$.proto",
286
- "type": "tempVars"
287
- }
288
- ]
289
- }
296
+ "type": "responseJson",
297
+ "expression": {
298
+ "path": "",
299
+ "compareType": "eq",
300
+ "compareValue": ""
301
+ }
302
+ },
303
+ "name": "断言",
304
+ "id": "bcb5b9931704a"
290
305
  }
291
306
  ],
292
307
  "header": {
@@ -296,13 +311,25 @@ module.exports = {
296
311
  "query_add_equal": 1,
297
312
  "parameter": [
298
313
  {
299
- "param_id": "cfaaea831700d",
314
+ "param_id": "3d55bc7d39b04a",
315
+ "description": "",
316
+ "field_type": "string",
317
+ "is_checked": 1,
318
+ "key": "id",
319
+ "not_null": 1,
320
+ "value": "1",
321
+ "schema": {
322
+ "type": "string"
323
+ }
324
+ },
325
+ {
326
+ "param_id": "bca53b876e042",
300
327
  "description": "",
301
328
  "field_type": "string",
302
329
  "is_checked": 1,
303
- "key": "code",
330
+ "key": "",
304
331
  "not_null": 1,
305
- "value": "{{code}}",
332
+ "value": "",
306
333
  "schema": {
307
334
  "type": "string"
308
335
  }
@@ -317,85 +344,46 @@ module.exports = {
317
344
  "parameter": []
318
345
  }
319
346
  },
320
- "parents": [
321
- {
322
- "target_id": "ac6c2b71700a",
323
- "target_type": "folder"
324
- }
325
- ],
326
- "method": "POST",
327
- "protocol": "http/1.1",
328
- "url": "https://go.apipost.cn?code={{code}}",
329
- "pre_url": ""
330
- },
331
- {
332
- "target_id": "ac6c2b71700a",
333
- "target_type": "folder",
334
- "parent_id": "0",
335
- "name": "未命名目录",
336
- "request": {
337
- "auth": {
338
- "type": "inherit"
339
- },
340
- "pre_tasks": [],
341
- "post_tasks": [],
342
- "body": {
343
- "parameter": []
344
- },
345
- "header": {
346
- "parameter": []
347
- },
348
- "query": {
349
- "parameter": []
350
- },
351
- "cookie": {
352
- "parameter": []
353
- }
354
- },
355
347
  "parents": [],
356
- "server_id": "0",
348
+ "method": "GET",
349
+ "protocol": "http/1.1",
350
+ "url": "https://httpbin.org/get?id=1",
357
351
  "pre_url": ""
358
352
  }
359
353
  ],
360
- "database_configs": {},
361
- "name": "pre_url",
362
- "ignore_error": -1,
363
- "enable_sandbox": -1,
364
- "iterationCount": 1,
365
- "sleep": 0,
366
- "testing_id": "e775c94fd600b",
367
- "iterates_data_id": "0",
368
- "iterationData": []
354
+ "database_configs": {
355
+ "2b9e0de71864000": {
356
+ "type": "mysql",
357
+ "dbconfig": {
358
+ "host": "10.10.10.20",
359
+ "port": 3306,
360
+ "user": "root",
361
+ "password": "12333333333",
362
+ "database": "apipost",
363
+ "auth_source": ""
364
+ },
365
+ "ssh": {
366
+ "enable": -1,
367
+ "host": "",
368
+ "port": 22,
369
+ "auth_type": 1,
370
+ "username": "",
371
+ "password": "",
372
+ "private_key": "",
373
+ "passphrase": ""
374
+ }
375
+ }
376
+ }
369
377
  },
370
378
  "test_events": [
371
379
  {
372
- "parent_event_id": "0",
373
- "enabled": 1,
374
- "type": "if",
380
+ "type": "api",
375
381
  "data": {
376
- "var": "{{code}}",
377
- "compare": "notexist",
378
- "value": ""
379
- },
380
- "project_id": "2adc267c9064000",
381
- "test_id": "e775c94fd600b",
382
- "event_id": "e929fdbbd6032",
383
- "sort": 0,
384
- "children": [
385
- {
386
- "type": "api",
387
- "auto_sync": true,
388
- "test_id": "e775c94fd600b",
389
- "event_id": "e919aca3d600c",
390
- "enabled": 1,
391
- "data": {
392
- "target_id": "2b835ab23069000",
393
- "project_id": "2adc267c9064000",
394
- "parent_id": "ac6c2b71700a",
395
- "target_type": "api"
396
- }
397
- }
398
- ]
382
+ "target_id": "cf94971317030",
383
+ "project_id": "2adc267c9064000",
384
+ "parent_id": "0",
385
+ "target_type": "api"
386
+ }
399
387
  }
400
388
  ]
401
389
  }