axe-api 1.7.2 → 1.7.3

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.
@@ -522,6 +522,9 @@ const deepMerge = (base, source) => {
522
522
  }
523
523
  return merged;
524
524
  };
525
+ const normalizeSwaggerPath = (path) => {
526
+ return path.replaceAll(/:([^/]+)/g, "{$1}");
527
+ };
525
528
  const generateDocumentation = () => __awaiter(void 0, void 0, void 0, function* () {
526
529
  const docs = Services_1.DocumentationService.getInstance();
527
530
  const api = Services_1.APIService.getInstance();
@@ -582,10 +585,11 @@ const generateDocumentation = () => __awaiter(void 0, void 0, void 0, function*
582
585
  const modelPatterns = {};
583
586
  const paths = {};
584
587
  for (const endpoint of docs.get()) {
585
- if (paths[endpoint.url] === undefined) {
586
- paths[endpoint.url] = {};
588
+ const normalizedPath = normalizeSwaggerPath(endpoint.url);
589
+ if (paths[normalizedPath] === undefined) {
590
+ paths[normalizedPath] = {};
587
591
  }
588
- modelPatterns[endpoint.url] = endpoint.model;
592
+ modelPatterns[normalizedPath] = endpoint.model;
589
593
  const path = {
590
594
  tags: [endpoint.model],
591
595
  summary: toEndpointSummary(endpoint),
@@ -598,20 +602,21 @@ const generateDocumentation = () => __awaiter(void 0, void 0, void 0, function*
598
602
  if (requestBody) {
599
603
  path.requestBody = requestBody;
600
604
  }
601
- paths[endpoint.url][endpoint.method.toLowerCase()] = path;
605
+ paths[normalizedPath][endpoint.method.toLowerCase()] = path;
602
606
  }
603
607
  const modelPatternsKeys = Object.keys(modelPatterns);
604
608
  // Added custom endpoint
605
609
  for (const custom of docs.getCustoms()) {
606
- if (paths[custom.url] === undefined) {
607
- paths[custom.url] = {};
610
+ const normalizedPath = normalizeSwaggerPath(custom.url);
611
+ if (paths[normalizedPath] === undefined) {
612
+ paths[normalizedPath] = {};
608
613
  }
609
- const samePattern = modelPatternsKeys.find((key) => custom.url.startsWith(key));
614
+ const samePattern = modelPatternsKeys.find((key) => normalizedPath.startsWith(key));
610
615
  const tags = [];
611
616
  if (samePattern) {
612
617
  tags.push(modelPatterns[samePattern]);
613
618
  }
614
- paths[custom.url][custom.method.toLowerCase()] = {
619
+ paths[normalizedPath][custom.method.toLowerCase()] = {
615
620
  tags,
616
621
  description: "Custom endpoint",
617
622
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "axe-api",
3
- "version": "1.7.2",
3
+ "version": "1.7.3",
4
4
  "description": "AXE API is a simple tool to create Rest APIs quickly.",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -60,64 +60,64 @@
60
60
  "node": ">=20.0.0"
61
61
  },
62
62
  "dependencies": {
63
- "body-parser": "^2.2.0",
63
+ "body-parser": "^2.2.2",
64
64
  "change-case": "^4.1.2",
65
65
  "colors": "^1.4.0",
66
- "commander": "^14.0.0",
66
+ "commander": "^14.0.3",
67
67
  "connect": "^3.7.0",
68
- "dotenv": "^16.5.0",
68
+ "dotenv": "^16.6.1",
69
69
  "formidable": "^3.5.4",
70
70
  "knex": "^3.1.0",
71
- "knex-paginate": "^3.1.4",
71
+ "knex-paginate": "^3.2.0",
72
72
  "knex-schema-inspector": "^3.1.0",
73
73
  "nanoid": "^3.3.11",
74
- "pino": "^9.7.0",
75
- "pino-pretty": "^13.0.0",
74
+ "pino": "^9.14.0",
75
+ "pino-pretty": "^13.1.3",
76
76
  "pluralize": "^8.0.0",
77
- "rimraf": "^6.0.1",
77
+ "rimraf": "^6.1.3",
78
78
  "shelljs": "^0.10.0",
79
79
  "validatorjs": "^3.22.1"
80
80
  },
81
81
  "devDependencies": {
82
- "@babel/core": "^7.27.4",
83
- "@babel/preset-env": "^7.27.2",
84
- "@babel/preset-typescript": "^7.27.1",
85
- "@elastic/elasticsearch": "^8.18.2",
82
+ "@babel/core": "^7.29.0",
83
+ "@babel/preset-env": "^7.29.0",
84
+ "@babel/preset-typescript": "^7.28.5",
85
+ "@elastic/elasticsearch": "^8.19.1",
86
86
  "@types/accept-language-parser": "^1.5.8",
87
- "@types/aws-lambda": "^8.10.149",
87
+ "@types/aws-lambda": "^8.10.161",
88
88
  "@types/cors": "^2.8.19",
89
- "@types/formidable": "^3.4.5",
89
+ "@types/formidable": "^3.4.7",
90
90
  "@types/multer": "^1.4.13",
91
91
  "@types/pluralize": "^0.0.33",
92
92
  "@types/validatorjs": "^3.15.5",
93
93
  "@typescript-eslint/eslint-plugin": "^7.18.0",
94
94
  "@typescript-eslint/parser": "^7.18.0",
95
- "cors": "^2.8.5",
95
+ "cors": "^2.8.6",
96
96
  "eslint": "^8.57.1",
97
97
  "eslint-config-standard": "^17.1.0",
98
- "eslint-plugin-import": "^2.30.0",
98
+ "eslint-plugin-import": "^2.32.0",
99
99
  "eslint-plugin-node": "^11.1.0",
100
100
  "eslint-plugin-promise": "^6.6.0",
101
101
  "eslint-plugin-unicorn": "^56.0.1",
102
102
  "eslint-watch": "^8.0.0",
103
- "glob": "^11.0.3",
103
+ "glob": "^11.1.0",
104
104
  "husky": "^9.1.7",
105
- "lint-staged": "^16.1.0",
106
- "multer": "^2.0.1",
105
+ "lint-staged": "^16.3.1",
106
+ "multer": "^2.1.0",
107
107
  "mysql": "^2.18.1",
108
- "mysql2": "^3.14.1",
108
+ "mysql2": "^3.18.2",
109
109
  "node-cache": "^5.1.2",
110
- "pg": "^8.16.0",
111
- "prettier": "^3.5.3",
110
+ "pg": "^8.19.0",
111
+ "prettier": "^3.8.1",
112
112
  "redis": "^4.7.1",
113
113
  "robust-validator": "^2.2.1",
114
- "serve-static": "^2.2.0",
114
+ "serve-static": "^2.2.1",
115
115
  "set-value": ">=4.1.0",
116
116
  "sqlite3": "^5.1.7",
117
117
  "ts-node": "^10.9.2",
118
- "tsx": "^4.20.3",
119
- "typescript": "^5.8.3",
120
- "vitest": "^3.2.3"
118
+ "tsx": "^4.21.0",
119
+ "typescript": "^5.9.3",
120
+ "vitest": "^3.2.4"
121
121
  },
122
122
  "lint-staged": {
123
123
  "**/*": "prettier --write --ignore-unknown"