echoapi-converter 0.0.30 → 0.0.32

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 +15 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -4229,6 +4229,17 @@ class InsomniaToApipost {
4229
4229
  },
4230
4230
  ];
4231
4231
  }
4232
+ if (item === null || item === void 0 ? void 0 : item.afterResponseScript) {
4233
+ request["post_tasks"] = [
4234
+ {
4235
+ type: "customScript",
4236
+ enabled: 1,
4237
+ name: "Script",
4238
+ id: ATools.snowflakeId(),
4239
+ data: (item === null || item === void 0 ? void 0 : item.afterResponseScript) || "",
4240
+ },
4241
+ ];
4242
+ }
4232
4243
  if ((authentication === null || authentication === void 0 ? void 0 : authentication.type) === "apikey") {
4233
4244
  request.auth["type"] = "kv";
4234
4245
  request.auth["kv"] = {
@@ -4346,6 +4357,7 @@ class InsomniaToApipost {
4346
4357
  project_id: this.project.project_id || "",
4347
4358
  target_id: ATools.snowflakeId(),
4348
4359
  parent_id: ((_a = this.foldersMap) === null || _a === void 0 ? void 0 : _a[item === null || item === void 0 ? void 0 : item.parentId]) || "0",
4360
+ description: (item === null || item === void 0 ? void 0 : item.description) || '',
4349
4361
  target_type: "websocket2",
4350
4362
  name: (item === null || item === void 0 ? void 0 : item.name) || "New Websocket",
4351
4363
  sort: 0,
@@ -4387,7 +4399,7 @@ class InsomniaToApipost {
4387
4399
  completionGraphqlRequestBody(body) {
4388
4400
  return {
4389
4401
  query_schema: {},
4390
- query_list: [Object.assign({ param_id: ATools.snowflakeId(), name: 'New Query' }, this.getGraphQLQuery(body))],
4402
+ query_list: [Object.assign({ param_id: ATools.snowflakeId(), name: 'New Query' }, this.getGraphQLQuery(body === null || body === void 0 ? void 0 : body.text))],
4391
4403
  };
4392
4404
  }
4393
4405
  completionGraphqlTarget(item) {
@@ -4526,6 +4538,7 @@ class InsomniaToApipost {
4526
4538
  }
4527
4539
  completionApis(resources) {
4528
4540
  return resources === null || resources === void 0 ? void 0 : resources.reduce((pre, item) => {
4541
+ var _a;
4529
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)) {
4530
4543
  pre.push({
4531
4544
  target_id: this.foldersMap[item === null || item === void 0 ? void 0 : item._id] || ATools.snowflakeId(),
@@ -4544,7 +4557,7 @@ class InsomniaToApipost {
4544
4557
  });
4545
4558
  }
4546
4559
  if ((item === null || item === void 0 ? void 0 : item._type) === "request") {
4547
- if ((item === null || item === void 0 ? void 0 : item.body) === 'application/graphql') {
4560
+ if (((_a = item === null || item === void 0 ? void 0 : item.body) === null || _a === void 0 ? void 0 : _a.mimeType) === 'application/graphql') {
4548
4561
  const target = this.completionGraphqlTarget(item);
4549
4562
  pre.push(target);
4550
4563
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "echoapi-converter",
3
- "version": "0.0.30",
3
+ "version": "0.0.32",
4
4
  "description": "echoapi to swagger",
5
5
  "main": "dist/index.js",
6
6
  "files": [