echoapi-converter 0.0.32 → 0.0.33
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 +6 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4,10 +4,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var lodash = require('lodash');
|
|
6
6
|
var ATools = require('apipost-tools');
|
|
7
|
+
require('url-parse');
|
|
7
8
|
var MockSchema = require('apipost-mock-schema');
|
|
8
9
|
var axios = require('axios');
|
|
9
10
|
var SwaggerClient = require('swagger-client');
|
|
10
|
-
require('url-parse');
|
|
11
11
|
|
|
12
12
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
13
|
|
|
@@ -4252,12 +4252,12 @@ class InsomniaToApipost {
|
|
|
4252
4252
|
request.auth["type"] = "basic";
|
|
4253
4253
|
request.auth["basic"] = {
|
|
4254
4254
|
username: (authentication === null || authentication === void 0 ? void 0 : authentication.username) || "",
|
|
4255
|
-
password: (authentication === null || authentication === void 0 ? void 0 : authentication.
|
|
4255
|
+
password: (authentication === null || authentication === void 0 ? void 0 : authentication.password) || "",
|
|
4256
4256
|
};
|
|
4257
4257
|
}
|
|
4258
4258
|
else if ((authentication === null || authentication === void 0 ? void 0 : authentication.type) === "digest") {
|
|
4259
4259
|
request.auth["type"] = "digest";
|
|
4260
|
-
request.auth["digest"] = Object.assign(Object.assign({}, request.auth.digest), { username: (authentication === null || authentication === void 0 ? void 0 : authentication.username) || "", password: (authentication === null || authentication === void 0 ? void 0 : authentication.
|
|
4260
|
+
request.auth["digest"] = Object.assign(Object.assign({}, request.auth.digest), { username: (authentication === null || authentication === void 0 ? void 0 : authentication.username) || "", password: (authentication === null || authentication === void 0 ? void 0 : authentication.password) || "" });
|
|
4261
4261
|
}
|
|
4262
4262
|
else if ((authentication === null || authentication === void 0 ? void 0 : authentication.type) === "oauth1") {
|
|
4263
4263
|
request.auth["type"] = "oauth1";
|
|
@@ -4271,7 +4271,7 @@ class InsomniaToApipost {
|
|
|
4271
4271
|
}
|
|
4272
4272
|
else if ((authentication === null || authentication === void 0 ? void 0 : authentication.type) === "ntlm") {
|
|
4273
4273
|
request.auth["type"] = "ntlm";
|
|
4274
|
-
request.auth["ntlm"] = Object.assign(Object.assign({}, request.auth.ntlm), { username: (authentication === null || authentication === void 0 ? void 0 : authentication.username) || "", password: (authentication === null || authentication === void 0 ? void 0 : authentication.
|
|
4274
|
+
request.auth["ntlm"] = Object.assign(Object.assign({}, request.auth.ntlm), { username: (authentication === null || authentication === void 0 ? void 0 : authentication.username) || "", password: (authentication === null || authentication === void 0 ? void 0 : authentication.password) || "" });
|
|
4275
4275
|
}
|
|
4276
4276
|
else if ((authentication === null || authentication === void 0 ? void 0 : authentication.type) === "iam") {
|
|
4277
4277
|
request.auth["type"] = "awsv4";
|
|
@@ -4538,7 +4538,7 @@ class InsomniaToApipost {
|
|
|
4538
4538
|
}
|
|
4539
4539
|
completionApis(resources) {
|
|
4540
4540
|
return resources === null || resources === void 0 ? void 0 : resources.reduce((pre, item) => {
|
|
4541
|
-
var _a;
|
|
4541
|
+
var _a, _b;
|
|
4542
4542
|
if ((item === null || item === void 0 ? void 0 : item._type) === "request_group" && lodash.has(this.foldersMap, item === null || item === void 0 ? void 0 : item._id)) {
|
|
4543
4543
|
pre.push({
|
|
4544
4544
|
target_id: this.foldersMap[item === null || item === void 0 ? void 0 : item._id] || ATools.snowflakeId(),
|
|
@@ -4563,6 +4563,7 @@ class InsomniaToApipost {
|
|
|
4563
4563
|
}
|
|
4564
4564
|
else {
|
|
4565
4565
|
const target = this.completionApiTarget(item);
|
|
4566
|
+
target.url = genUrlByQuery(lodash.cloneDeep(target.url), (_b = target.request.query) === null || _b === void 0 ? void 0 : _b.parameter);
|
|
4566
4567
|
pre.push(target);
|
|
4567
4568
|
}
|
|
4568
4569
|
}
|