runner-runtime 1.0.88 → 1.0.89

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
@@ -2265,6 +2265,14 @@ module.exports = (event, option, callback, eventRuntimeData, eventResultList) =>
2265
2265
  _.assign(AllVars, _.get(eventRuntimeData, `variables.${varName}`))
2266
2266
  })
2267
2267
  preProcessMockExp(request, { postmanJSON }, AllVars, _.pick(option, ['lang', 'custom_functions']))
2268
+
2269
+ if (_.includes(['get_parsed_request'], scene)) {
2270
+ callback(generateHarFromRequest(request));
2271
+ try {
2272
+ run.abort();
2273
+ } catch (e) { }
2274
+ resolve();
2275
+ }
2268
2276
  },
2269
2277
 
2270
2278
  beforePrerequest(err, cursor, events, item) {
@@ -2325,28 +2333,18 @@ module.exports = (event, option, callback, eventRuntimeData, eventResultList) =>
2325
2333
  }
2326
2334
  },
2327
2335
 
2328
- request: function (err, cursor, response, request, item, cookies, history) {
2329
- if (_.includes(['get_parsed_request'], scene)) {
2330
- callback(generateHarFromRequest(request));
2331
- try {
2332
- run.abort();
2333
- } catch (e) { }
2334
- resolve();
2335
- }
2336
- },
2337
-
2338
- responseStart: (err, cursor, response, request, item, cookies, history) => {
2339
- if (_.includes(['get_parsed_request'], scene)) {
2340
- callback(generateHarFromRequest(request));
2341
- try {
2342
- run.abort();
2343
- } catch (e) { }
2344
- resolve();
2345
- }
2346
- },
2336
+ // responseStart: (err, cursor, response, request, item, cookies, history) => {
2337
+ // if (_.includes(['get_parsed_request'], scene)) {
2338
+ // callback(generateHarFromRequest(request));
2339
+ // try {
2340
+ // run.abort();
2341
+ // } catch (e) { }
2342
+ // resolve();
2343
+ // }
2344
+ // },
2347
2345
 
2348
2346
  response: async (err, cursor, response, request, item, cookies, history) => {
2349
- if (_.includes(['get_parsed_request'], scene)) {
2347
+ if (!_.includes(['get_parsed_request'], scene)) {
2350
2348
  callback(generateHarFromRequest(request));
2351
2349
  try {
2352
2350
  run.abort();
package/index.js CHANGED
@@ -169,6 +169,7 @@ const request2HAR = (events, option) => {
169
169
  if (_.isObject(event) && _.has(event, 'type')) {
170
170
  try {
171
171
  await executeEvent(event, _.assign(eventOptions, { scene: 'get_parsed_request' }), (data) => {
172
+ console.log(data,11111)
172
173
  resolve(data)
173
174
  }, eventRuntimeData, eventResultList);
174
175
  } catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "runner-runtime",
3
- "version": "1.0.88",
3
+ "version": "1.0.89",
4
4
  "description": "runner-runtime.",
5
5
  "main": "index.js",
6
6
  "scripts": {
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
  "lang": "zh-cn",
5
5
  "globals": {},
6
6
  "project": {
@@ -77,7 +77,9 @@ module.exports = {
77
77
  "uri": ""
78
78
  }
79
79
  },
80
- "environment": {}
80
+ "environment": {
81
+ "aaa": "123"
82
+ }
81
83
  },
82
84
  "cookies": {
83
85
  "switch": 1,
@@ -101,10 +103,10 @@ module.exports = {
101
103
  "path": "/",
102
104
  "secure": true,
103
105
  "httpOnly": true,
104
- "creation": "2025-06-12T12:56:47.288Z",
106
+ "creation": "2025-06-12T13:22:40.955Z",
105
107
  "name": "liveCookie",
106
108
  "cookie_id": "2f43d903d001b",
107
- "expires": "Thu, 12 Jun 2025 12:58:47 GMT",
109
+ "expires": "Thu, 12 Jun 2025 13:24:41 GMT",
108
110
  "project_id": "478597272401000"
109
111
  },
110
112
  {
@@ -115,10 +117,10 @@ module.exports = {
115
117
  "path": "/",
116
118
  "secure": true,
117
119
  "httpOnly": true,
118
- "creation": "2025-06-12T12:56:47.288Z",
120
+ "creation": "2025-06-12T13:22:40.956Z",
119
121
  "name": "loseCookie",
120
122
  "cookie_id": "2f43d903d001c",
121
- "expires": "Thu, 12 Jun 2025 12:56:47 GMT",
123
+ "expires": "Thu, 12 Jun 2025 13:22:41 GMT",
122
124
  "project_id": "478597272401000"
123
125
  }
124
126
  ]
@@ -161,86 +163,193 @@ module.exports = {
161
163
  },
162
164
  "collection": [
163
165
  {
164
- "target_id": "d34fde6bd0068",
166
+ "target_id": "d3dfd84fd00fe",
165
167
  "target_type": "api",
166
168
  "parent_id": "0",
167
- "name": "https://go.apipost.cn",
169
+ "name": "未命名接口",
168
170
  "request": {
169
171
  "auth": {
170
172
  "type": "inherit"
171
173
  },
172
174
  "body": {
173
- "mode": "urlencoded",
175
+ "binary": null,
176
+ "mode": "json",
177
+ "parameter": [],
178
+ "raw": "+499tM7rZuIPk5/xNVjl2TWhg0HSm0CtVt9AncVwOL9kHTLGBRTxNhOWfjTf6xWl",
179
+ "raw_parameter": [],
180
+ "raw_schema": {
181
+ "type": "object"
182
+ }
183
+ },
184
+ "cookie": {
185
+ "parameter": []
186
+ },
187
+ "header": {
174
188
  "parameter": [
175
189
  {
176
- "description": "用户名",
177
- "field_type": "string",
178
190
  "is_checked": 1,
179
- "key": "username",
180
- "value": "{{username}}",
191
+ "key": "Accept",
192
+ "value": "*/*",
181
193
  "not_null": 1,
182
- "schema": {
183
- "type": "string",
184
- "default": ""
185
- },
186
- "param_id": "d35865b77108c"
194
+ "description": "",
195
+ "field_type": "String",
196
+ "param_id": "d3dfd847d00f0"
197
+ },
198
+ {
199
+ "is_checked": 1,
200
+ "key": "Accept-Encoding",
201
+ "value": "gzip, deflate, br",
202
+ "not_null": 1,
203
+ "description": "",
204
+ "field_type": "String",
205
+ "param_id": "d3dfd847d00f1"
206
+ },
207
+ {
208
+ "is_checked": 1,
209
+ "key": "Bwtoken",
210
+ "value": "aca61450ee6c9c1d18554051d4e0204d",
211
+ "not_null": 1,
212
+ "description": "",
213
+ "field_type": "String",
214
+ "param_id": "d3dfd847d00f2"
215
+ },
216
+ {
217
+ "is_checked": 1,
218
+ "key": "Cache-Control",
219
+ "value": "no-cache",
220
+ "not_null": 1,
221
+ "description": "",
222
+ "field_type": "String",
223
+ "param_id": "d3dfd847d00f3"
224
+ },
225
+ {
226
+ "is_checked": 1,
227
+ "key": "Connection",
228
+ "value": "keep-alive",
229
+ "not_null": 1,
230
+ "description": "",
231
+ "field_type": "String",
232
+ "param_id": "d3dfd847d00f4"
233
+ },
234
+ {
235
+ "is_checked": 1,
236
+ "key": "Content-Type",
237
+ "value": "application/json",
238
+ "not_null": 1,
239
+ "description": "",
240
+ "field_type": "String",
241
+ "param_id": "d3dfd847d00f5"
242
+ },
243
+ {
244
+ "is_checked": 1,
245
+ "key": "Host",
246
+ "value": "lqpt.chinatax.gov.cn:8443",
247
+ "not_null": 1,
248
+ "description": "",
249
+ "field_type": "String",
250
+ "param_id": "d3dfd847d00f6"
251
+ },
252
+ {
253
+ "is_checked": 1,
254
+ "key": "User-Agent",
255
+ "value": "PostmanRuntime-ApipostRuntime/1.1.0",
256
+ "not_null": 1,
257
+ "description": "",
258
+ "field_type": "String",
259
+ "param_id": "d3dfd847d00f7"
260
+ },
261
+ {
262
+ "is_checked": 1,
263
+ "key": "access_signature",
264
+ "value": "",
265
+ "not_null": 1,
266
+ "description": "",
267
+ "field_type": "String",
268
+ "param_id": "d3dfd847d00f8"
269
+ },
270
+ {
271
+ "is_checked": 1,
272
+ "key": "fwbm",
273
+ "value": "CXNCPSGQYFXLX",
274
+ "not_null": 1,
275
+ "description": "",
276
+ "field_type": "String",
277
+ "param_id": "d3dfd847d00f9"
278
+ },
279
+ {
280
+ "is_checked": 1,
281
+ "key": "jrdwptbh",
282
+ "value": "174ba8fa83cf8cd6d905",
283
+ "not_null": 1,
284
+ "description": "",
285
+ "field_type": "String",
286
+ "param_id": "d3dfd847d00fa"
287
+ },
288
+ {
289
+ "is_checked": 1,
290
+ "key": "nlbm",
291
+ "value": "202019",
292
+ "not_null": 1,
293
+ "description": "",
294
+ "field_type": "String",
295
+ "param_id": "d3dfd847d00fb"
296
+ },
297
+ {
298
+ "is_checked": 1,
299
+ "key": "sydwptbh",
300
+ "value": "174ba8fa83cf8cd6d905",
301
+ "not_null": 1,
302
+ "description": "",
303
+ "field_type": "String",
304
+ "param_id": "d3dfd847d00fc"
305
+ },
306
+ {
307
+ "is_checked": 1,
308
+ "key": "ylbm",
309
+ "value": "202019",
310
+ "not_null": 1,
311
+ "description": "",
312
+ "field_type": "String",
313
+ "param_id": "d3dfd847d00fd"
187
314
  }
188
- ],
189
- "raw": "",
190
- "raw_parameter": [],
191
- "raw_schema": {
192
- "type": "object"
193
- },
194
- "binary": null
315
+ ]
195
316
  },
196
- "pre_tasks": [],
197
317
  "post_tasks": [],
198
- "header": {
199
- "parameter": []
200
- },
318
+ "pre_tasks": [],
201
319
  "query": {
202
- "parameter": [],
320
+ "parameter": [
321
+ {
322
+ "is_checked": 1,
323
+ "key": "id",
324
+ "value": "{{$mockjs.idcard()}}",
325
+ "not_null": 1,
326
+ "description": "",
327
+ "field_type": "String",
328
+ "param_id": "d3dfd847d00fd"
329
+ }
330
+ ],
203
331
  "query_add_equal": 1
204
332
  },
205
- "cookie": {
206
- "parameter": [],
207
- "cookie_encode": 1
208
- },
209
333
  "restful": {
210
334
  "parameter": []
211
- },
212
- "tabs_default_active_key": "query"
335
+ }
213
336
  },
214
337
  "parents": [],
338
+ "server_id": "0",
215
339
  "method": "POST",
216
340
  "protocol": "http/1.1",
217
- "url": "https://go.apipost.cn",
341
+ // "url": "https://",
342
+ "url": "lqpt.chinatax.gov.cn:8443/access/newsandbox/v2/invoke/202019/CXNCPSGQYFXLX?id={{$timestamp}}",
218
343
  "pre_url": ""
219
344
  }
220
345
  ],
221
- "database_configs": {},
222
- "name": "未命名测试用例",
223
- "ignore_error": -1,
224
- "enable_sandbox": -1,
225
- "iterationCount": 3,
226
- "sleep": 0,
227
- "testing_id": "d2b58cc3d0042",
228
- "iterates_data_id": "d3540d6fd0073",
229
- "iterationData": [
230
- {
231
- "username": "{{$mockjs.cname()}}"
232
- }
233
- ]
346
+ "database_configs": {}
234
347
  },
235
348
  "test_events": [
236
349
  {
237
350
  "type": "api",
238
- "auto_sync": true,
239
- "test_id": "d2b58cc3d0042",
240
- "event_id": "d353a89bd006e",
241
- "enabled": 1,
242
351
  "data": {
243
- "target_id": "d34fde6bd0068",
352
+ "target_id": "d3dfd84fd00fe",
244
353
  "project_id": "478597272401000",
245
354
  "parent_id": "0",
246
355
  "target_type": "api"