echoapi-converter 0.0.24 → 0.0.26

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/dist/index.js +7 -23
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -208,6 +208,7 @@ const ASSERT_COMPARE_TYPES_MAP_THUNDER = {
208
208
  "<=": "lte",
209
209
  ">": "gt",
210
210
  ">=": "gte",
211
+ setto: "setto",
211
212
  };
212
213
 
213
214
  // @ts-nocheck
@@ -5122,7 +5123,10 @@ class ThunderToApipost {
5122
5123
  str = `const data = response.headers['${lodash.toLower(test === null || test === void 0 ? void 0 : test.custom)}']`;
5123
5124
  }
5124
5125
  else if (lodash.isEqual(test === null || test === void 0 ? void 0 : test.type, "json-query")) {
5125
- str = `const data = _.get(response.json, ${lodash.toString(lodash.trimStart(test === null || test === void 0 ? void 0 : test.custom, "json."))})`;
5126
+ str = `const data = _.get(response.json, "${lodash.toString(lodash.trimStart(test === null || test === void 0 ? void 0 : test.custom, "json."))}")`;
5127
+ }
5128
+ else if (lodash.isEqual(test === null || test === void 0 ? void 0 : test.type, "set-env-var")) {
5129
+ str = `const data = _.get(response.json, "${lodash.toString(lodash.trimStart(test === null || test === void 0 ? void 0 : test.custom, "json."))}")`;
5126
5130
  }
5127
5131
  if (action === "istype") {
5128
5132
  return {
@@ -5169,7 +5173,7 @@ class ThunderToApipost {
5169
5173
 
5170
5174
  pm.test("${test.action}", function () {
5171
5175
  ${str}
5172
- pm.expect(isType(data,${lodash.toString(lodash.toLower(test.value))})).to.true;
5176
+ pm.expect(isType(data,"${lodash.toString(lodash.toLower(test.value))}")).to.true;
5173
5177
  });`,
5174
5178
  };
5175
5179
  }
@@ -5520,31 +5524,11 @@ class ThunderToApipost {
5520
5524
  param_id: ATools.snowflakeId(),
5521
5525
  name: lodash.first(lodash.split(lodash.trim(test === null || test === void 0 ? void 0 : test.value, "{}"), ",")),
5522
5526
  expression: lodash.replace((test === null || test === void 0 ? void 0 : test.custom) || "", "json.", "$.") || "",
5523
- type: "globalVars",
5527
+ type: "envVars",
5524
5528
  },
5525
5529
  ],
5526
5530
  },
5527
5531
  });
5528
- case "setto":
5529
- asserts.push({
5530
- type: "pickVars",
5531
- id: ATools.snowflakeId(),
5532
- name: "提取变量",
5533
- enabled: 1,
5534
- data: {
5535
- source: "responseJson",
5536
- variables: [
5537
- {
5538
- param_id: ATools.snowflakeId(),
5539
- // name: replace(test?.value, /\{\{(.+?)\}\}/, "$1"),
5540
- name: lodash.first(lodash.split(lodash.trim(test === null || test === void 0 ? void 0 : test.value, "{}"), ",")),
5541
- expression: lodash.replace((test === null || test === void 0 ? void 0 : test.custom) || "", "json.", "$.") || "",
5542
- type: "globalVars",
5543
- },
5544
- ],
5545
- },
5546
- });
5547
- break;
5548
5532
  }
5549
5533
  }
5550
5534
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "echoapi-converter",
3
- "version": "0.0.24",
3
+ "version": "0.0.26",
4
4
  "description": "echoapi to swagger",
5
5
  "main": "dist/index.js",
6
6
  "files": [