echoapi-converter 0.0.18 → 0.0.20

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 +16 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -5206,6 +5206,19 @@ class ThunderToApipost {
5206
5206
  });`,
5207
5207
  };
5208
5208
  }
5209
+ else if (action === "schema") {
5210
+ return {
5211
+ type: "customScript",
5212
+ id: ATools.snowflakeId(),
5213
+ name: "Script",
5214
+ enabled: 1,
5215
+ data: `
5216
+ pm.test("Schema is valid", function () {
5217
+ ${str}
5218
+ pm.expect(tv4.validate(data, ${test.value})).to.be.true;
5219
+ });`,
5220
+ };
5221
+ }
5209
5222
  }
5210
5223
  });
5211
5224
  Object.defineProperty(this, "buildFolderApiTree", {
@@ -5502,7 +5515,7 @@ class ThunderToApipost {
5502
5515
  variables: [
5503
5516
  {
5504
5517
  param_id: ATools.snowflakeId(),
5505
- name: lodash.replace(test === null || test === void 0 ? void 0 : test.value, /\{\{(.+?)\}\}/, "$1"),
5518
+ name: _.first(_.split(_.trim(test === null || test === void 0 ? void 0 : test.value, "{}"), ",")),
5506
5519
  expression: lodash.replace((test === null || test === void 0 ? void 0 : test.custom) || "", "json.", "$.") || "",
5507
5520
  type: "globalVars",
5508
5521
  },
@@ -5520,7 +5533,8 @@ class ThunderToApipost {
5520
5533
  variables: [
5521
5534
  {
5522
5535
  param_id: ATools.snowflakeId(),
5523
- name: lodash.replace(test === null || test === void 0 ? void 0 : test.value, /\{\{(.+?)\}\}/, "$1"),
5536
+ // name: replace(test?.value, /\{\{(.+?)\}\}/, "$1"),
5537
+ name: _.first(_.split(_.trim(test === null || test === void 0 ? void 0 : test.value, "{}"), ",")),
5524
5538
  expression: lodash.replace((test === null || test === void 0 ? void 0 : test.custom) || "", "json.", "$.") || "",
5525
5539
  type: "globalVars",
5526
5540
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "echoapi-converter",
3
- "version": "0.0.18",
3
+ "version": "0.0.20",
4
4
  "description": "echoapi to swagger",
5
5
  "main": "dist/index.js",
6
6
  "files": [