echoapi-converter 0.0.23 → 0.0.25
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/dist/index.js +11 -23
- 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
|
|
5176
|
+
pm.expect(isType(data,"${lodash.toString(lodash.toLower(test.value))}")).to.true;
|
|
5173
5177
|
});`,
|
|
5174
5178
|
};
|
|
5175
5179
|
}
|
|
@@ -5214,7 +5218,11 @@ class ThunderToApipost {
|
|
|
5214
5218
|
data: `
|
|
5215
5219
|
pm.test("Schema is valid", function () {
|
|
5216
5220
|
${str}
|
|
5217
|
-
|
|
5221
|
+
let tmpData = {};
|
|
5222
|
+
try {
|
|
5223
|
+
tmpData = JSON.parse(data);
|
|
5224
|
+
} catch (e) {}
|
|
5225
|
+
pm.expect(tv4.validate(tmpData, ${test.value})).to.be.true;
|
|
5218
5226
|
});`,
|
|
5219
5227
|
};
|
|
5220
5228
|
}
|
|
@@ -5521,26 +5529,6 @@ class ThunderToApipost {
|
|
|
5521
5529
|
],
|
|
5522
5530
|
},
|
|
5523
5531
|
});
|
|
5524
|
-
case "setto":
|
|
5525
|
-
asserts.push({
|
|
5526
|
-
type: "pickVars",
|
|
5527
|
-
id: ATools.snowflakeId(),
|
|
5528
|
-
name: "提取变量",
|
|
5529
|
-
enabled: 1,
|
|
5530
|
-
data: {
|
|
5531
|
-
source: "responseJson",
|
|
5532
|
-
variables: [
|
|
5533
|
-
{
|
|
5534
|
-
param_id: ATools.snowflakeId(),
|
|
5535
|
-
// name: replace(test?.value, /\{\{(.+?)\}\}/, "$1"),
|
|
5536
|
-
name: lodash.first(lodash.split(lodash.trim(test === null || test === void 0 ? void 0 : test.value, "{}"), ",")),
|
|
5537
|
-
expression: lodash.replace((test === null || test === void 0 ? void 0 : test.custom) || "", "json.", "$.") || "",
|
|
5538
|
-
type: "globalVars",
|
|
5539
|
-
},
|
|
5540
|
-
],
|
|
5541
|
-
},
|
|
5542
|
-
});
|
|
5543
|
-
break;
|
|
5544
5532
|
}
|
|
5545
5533
|
}
|
|
5546
5534
|
else {
|