openapi-ts-request 1.5.0 → 1.5.1

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.
@@ -245,10 +245,11 @@ class ServiceGenerator {
245
245
  (0, log_1.default)('✅ 成功生成 api 文件目录-> ', this.config.serversPath);
246
246
  }
247
247
  getInterfaceTPConfigs() {
248
- var _a, _b;
248
+ var _a, _b, _c;
249
249
  const schemas = (_a = this.openAPIData.components) === null || _a === void 0 ? void 0 : _a.schemas;
250
250
  const lastTypes = this.interfaceTPConfigs;
251
251
  const includeTags = ((_b = this.config) === null || _b === void 0 ? void 0 : _b.includeTags) || [];
252
+ const includePaths = ((_c = this.config) === null || _c === void 0 ? void 0 : _c.includePaths) || [];
252
253
  // 强行替换掉请求参数params的类型,生成方法对应的 xxxxParams 类型
253
254
  (0, lodash_1.keys)(this.openAPIData.paths).forEach((pathKey) => {
254
255
  const pathItem = this.openAPIData.paths[pathKey];
@@ -260,11 +261,14 @@ class ServiceGenerator {
260
261
  return;
261
262
  }
262
263
  const tags = hookCustomFileNames(operationObject, pathKey, method);
263
- if ((0, lodash_1.isEmpty)(includeTags) || (!(0, lodash_1.isEmpty)(includeTags) && (0, lodash_1.isEmpty)(tags))) {
264
+ if ((0, lodash_1.isEmpty)(includeTags) ||
265
+ (!(0, lodash_1.isEmpty)(includeTags) && (0, lodash_1.isEmpty)(tags)) ||
266
+ (0, lodash_1.isEmpty)(includePaths)) {
264
267
  return;
265
268
  }
266
269
  const flag = this.validateRegexp((0, lodash_1.filter)((0, lodash_1.map)(tags, (tag) => (tag === null || tag === void 0 ? void 0 : tag.toLowerCase) ? tag.toLowerCase() : undefined), (tag) => !!tag), includeTags);
267
- if (!flag) {
270
+ const pathFlag = this.validateRegexp(pathKey, includePaths);
271
+ if (!flag || !pathFlag) {
268
272
  return;
269
273
  }
270
274
  // 筛选出 pathItem 包含的 $ref 对应的schema
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openapi-ts-request",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "Swagger2/OpenAPI3/Apifox to TypeScript/JavaScript, request client(support any client), request mock service, enum and enum translation, react-query/vue-query, type field label, JSON Schemas",
5
5
  "engines": {
6
6
  "node": ">=18.0.0",
@@ -24,7 +24,7 @@
24
24
  "prettier.config.cjs"
25
25
  ],
26
26
  "dependencies": {
27
- "@prettier/sync": "^0.5.2",
27
+ "@prettier/sync": "^0.6.1",
28
28
  "@trivago/prettier-plugin-sort-imports": "^5.2.1",
29
29
  "axios": "^1.7.2",
30
30
  "bing-translate-api": "^4.0.2",
@@ -66,7 +66,7 @@
66
66
  "@typescript-eslint/parser": "^7.9.0",
67
67
  "eslint": "^8.57.1",
68
68
  "husky": "^9.0.11",
69
- "lint-staged": "^15.3.0",
69
+ "lint-staged": "^16.0.0",
70
70
  "openapi-types": "^12.1.3",
71
71
  "ts-node": "^10.9.2",
72
72
  "typescript": "5.8.3"