axe-api 1.4.4 → 1.4.6
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.
|
@@ -58,7 +58,11 @@ class ModelTreeBuilder {
|
|
|
58
58
|
// We should add recursive models
|
|
59
59
|
this.version.modelList.get().forEach((model) => {
|
|
60
60
|
const recursiveRelations = model.relations.filter((relation) => relation.model === model.name);
|
|
61
|
-
|
|
61
|
+
const hasManyCount = recursiveRelations.filter((item) => item.type === Enums_1.Relationships.HAS_MANY).length;
|
|
62
|
+
const hasOneCount = recursiveRelations.filter((item) => item.type === Enums_1.Relationships.HAS_ONE).length;
|
|
63
|
+
if (recursiveRelations.length === 2 &&
|
|
64
|
+
hasManyCount === 1 &&
|
|
65
|
+
hasOneCount === 1) {
|
|
62
66
|
model.setAsRecursive();
|
|
63
67
|
tree.push(model);
|
|
64
68
|
}
|
|
@@ -106,7 +106,7 @@ class RouterBuilder {
|
|
|
106
106
|
return;
|
|
107
107
|
}
|
|
108
108
|
// We should different parameter name for child routes
|
|
109
|
-
const subRelations = model.relations.filter((item) => item.type === Enums_1.Relationships.HAS_MANY);
|
|
109
|
+
const subRelations = model.relations.filter((item) => item.type === Enums_1.Relationships.HAS_MANY && item.options.autoRouting);
|
|
110
110
|
for (const relation of subRelations) {
|
|
111
111
|
const child = model.children.find((item) => item.name === relation.model);
|
|
112
112
|
// It should be recursive
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "axe-api",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.6",
|
|
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",
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
"eslint-plugin-import": "^2.30.0",
|
|
113
113
|
"eslint-plugin-node": "^11.1.0",
|
|
114
114
|
"eslint-plugin-promise": "^6.6.0",
|
|
115
|
-
"eslint-plugin-unicorn": "^
|
|
115
|
+
"eslint-plugin-unicorn": "^56.0.0",
|
|
116
116
|
"eslint-watch": "^8.0.0",
|
|
117
117
|
"glob": "^11.0.0",
|
|
118
118
|
"husky": "^9.1.6",
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
"pg": "^8.13.0",
|
|
126
126
|
"prettier": "^3.3.3",
|
|
127
127
|
"redis": "^4.7.0",
|
|
128
|
-
"robust-validator": "^
|
|
128
|
+
"robust-validator": "^2.0.1",
|
|
129
129
|
"serve-static": "^1.16.2",
|
|
130
130
|
"set-value": ">=4.1.0",
|
|
131
131
|
"sqlite3": "^5.1.7",
|
package/readme.md
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
|
|
28
28
|
It offers a comprehensive structure for your API, including numerous features and best practices that will save you time.
|
|
29
29
|
|
|
30
|
-
## Video Introduction
|
|
30
|
+
## 🎥 Video Introduction
|
|
31
31
|
|
|
32
32
|
<div style="display: flex; justify-content: center;">
|
|
33
33
|
|
|
@@ -37,10 +37,18 @@ It offers a comprehensive structure for your API, including numerous features an
|
|
|
37
37
|
|
|
38
38
|
</div>
|
|
39
39
|
|
|
40
|
-
## Documentation
|
|
40
|
+
## 📚 Documentation
|
|
41
41
|
|
|
42
42
|
Axe API has great documentation. Please [check it out in here](https://axe-api.com/).
|
|
43
43
|
|
|
44
|
-
##
|
|
44
|
+
## 👥 Contributors
|
|
45
|
+
|
|
46
|
+
<a href="https://github.com/axe-api/axe-api/graphs/contributors">
|
|
47
|
+
<img src="https://contrib.rocks/image?repo=axe-api/axe-api" />
|
|
48
|
+
</a>
|
|
49
|
+
|
|
50
|
+
Made with [contrib.rocks](https://contrib.rocks).
|
|
51
|
+
|
|
52
|
+
## 📜 License
|
|
45
53
|
|
|
46
54
|
[MIT License](LICENSE)
|