axe-api 0.22.0 → 0.30.0-rc10

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 (73) hide show
  1. package/build/dev-kit.d.ts +1 -0
  2. package/build/dev-kit.js +16 -0
  3. package/build/index.d.ts +3 -3
  4. package/build/index.js +4 -1
  5. package/build/src/Builders/ModelTreeBuilder.d.ts +3 -0
  6. package/build/src/Builders/ModelTreeBuilder.js +21 -17
  7. package/build/src/Builders/RouterBuilder.d.ts +3 -0
  8. package/build/src/Builders/RouterBuilder.js +28 -27
  9. package/build/src/Enums.d.ts +98 -0
  10. package/build/src/Enums.js +103 -1
  11. package/build/src/Exceptions/ApiError.d.ts +1 -1
  12. package/build/src/Exceptions/ApiError.js +2 -2
  13. package/build/src/Exceptions/AxeError.d.ts +8 -0
  14. package/build/src/Exceptions/AxeError.js +11 -0
  15. package/build/src/Handlers/AllHandler.js +4 -5
  16. package/build/src/Handlers/DocsHandler.d.ts +3 -0
  17. package/build/src/Handlers/DocsHandler.js +22 -0
  18. package/build/src/Handlers/HandlerFactory.d.ts +1 -1
  19. package/build/src/Handlers/HandlerFactory.js +1 -1
  20. package/build/src/Handlers/Helpers.d.ts +5 -3
  21. package/build/src/Handlers/Helpers.js +29 -13
  22. package/build/src/Handlers/PaginateHandler.js +4 -5
  23. package/build/src/Handlers/PatchHandler.js +2 -2
  24. package/build/src/Handlers/RoutesHandler.d.ts +3 -0
  25. package/build/src/Handlers/RoutesHandler.js +16 -0
  26. package/build/src/Handlers/ShowHandler.js +4 -5
  27. package/build/src/Handlers/StoreHandler.js +2 -2
  28. package/build/src/Handlers/UpdateHandler.js +2 -2
  29. package/build/src/Helpers.d.ts +4 -0
  30. package/build/src/Helpers.js +78 -0
  31. package/build/src/Interfaces.d.ts +54 -14
  32. package/build/src/Middlewares/acceptLanguageMiddleware.js +3 -5
  33. package/build/src/Model.d.ts +2 -2
  34. package/build/src/Model.js +3 -4
  35. package/build/src/Resolvers/FileResolver.js +2 -2
  36. package/build/src/Resolvers/GeneralHookResolver.d.ts +4 -2
  37. package/build/src/Resolvers/GeneralHookResolver.js +5 -8
  38. package/build/src/Resolvers/ModelResolver.d.ts +7 -0
  39. package/build/src/Resolvers/ModelResolver.js +99 -19
  40. package/build/src/Resolvers/TransactionResolver.d.ts +4 -2
  41. package/build/src/Resolvers/TransactionResolver.js +5 -4
  42. package/build/src/Resolvers/VersionConfigResolver.d.ts +7 -0
  43. package/build/src/Resolvers/VersionConfigResolver.js +58 -0
  44. package/build/src/Resolvers/VersionResolver.d.ts +7 -0
  45. package/build/src/Resolvers/VersionResolver.js +65 -0
  46. package/build/src/Resolvers/index.d.ts +3 -2
  47. package/build/src/Resolvers/index.js +5 -3
  48. package/build/src/Server.d.ts +3 -2
  49. package/build/src/Server.js +73 -46
  50. package/build/src/Services/APIService.d.ts +16 -0
  51. package/build/src/Services/APIService.js +82 -0
  52. package/build/src/Services/DocumentationService.d.ts +3 -1
  53. package/build/src/Services/DocumentationService.js +6 -0
  54. package/build/src/Services/LimitService.d.ts +5 -0
  55. package/build/src/Services/LimitService.js +116 -0
  56. package/build/src/Services/LogService.d.ts +4 -1
  57. package/build/src/Services/LogService.js +6 -0
  58. package/build/src/Services/ModelService.d.ts +6 -1
  59. package/build/src/Services/ModelService.js +8 -0
  60. package/build/src/Services/QueryService.d.ts +3 -2
  61. package/build/src/Services/QueryService.js +32 -7
  62. package/build/src/Services/SchemaValidatorService.d.ts +7 -0
  63. package/build/src/Services/SchemaValidatorService.js +62 -8
  64. package/build/src/Services/index.d.ts +3 -1
  65. package/build/src/Services/index.js +6 -1
  66. package/build/src/Types.d.ts +2 -0
  67. package/build/src/Types.js +2 -0
  68. package/build/src/constants.d.ts +5 -1
  69. package/build/src/constants.js +43 -2
  70. package/package.json +26 -24
  71. package/CHANGELOG.md +0 -212
  72. package/build/src/Resolvers/FolderResolver.d.ts +0 -5
  73. package/build/src/Resolvers/FolderResolver.js +0 -19
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "axe-api",
3
- "version": "0.22.0",
3
+ "version": "0.30.0-rc10",
4
4
  "description": "AXE API is a simple tool which has been created based on Express and Knex.js to create Rest APIs quickly.",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -13,12 +13,12 @@
13
13
  "author": "Özgür Adem Işıklı <i.ozguradem@gmail.com>",
14
14
  "license": "MIT",
15
15
  "scripts": {
16
- "build": "tsc",
16
+ "build": "rm -rf build && tsc && rm -rf build/dev-kit",
17
17
  "build:watch": "tsc -w",
18
18
  "dev": "ts-node-dev --files --respawn --clear index.ts",
19
19
  "dev-kit": "ts-node-dev --respawn --clear dev-kit.ts",
20
- "dev-kit:install": "sh ./scripts/dev-kit-install.sh",
21
- "dev-kit:remove": "sh ./scripts/dev-kit-remove.sh",
20
+ "dev-kit:install": "node ./scripts/dev-kit-install.js",
21
+ "dev-kit:remove": "node ./scripts/dev-kit-remove.js",
22
22
  "test": "jest --runInBand",
23
23
  "test:dev": "jest --watch",
24
24
  "lint": "eslint src/**",
@@ -29,43 +29,45 @@
29
29
  "test:mysql8": "sh ./scripts/test-mysql8.sh"
30
30
  },
31
31
  "dependencies": {
32
- "@types/express": "^4.17.15",
32
+ "chalk": "^4.1.2",
33
33
  "change-case": "^4.1.2",
34
- "dotenv": "^14.2.0",
35
- "express": "^4.18.2",
36
- "http-status-codes": "^2.2.0",
37
- "knex": "^2.3.0",
38
- "knex-paginate": "^3.0.2",
39
- "knex-schema-inspector": "^2.0.4",
34
+ "dotenv": "^16.0.3",
35
+ "knex": "^2.4.2",
36
+ "knex-paginate": "^3.1.0",
37
+ "knex-schema-inspector": "^3.0.1",
40
38
  "pluralize": "^8.0.0",
41
39
  "validatorjs": "^3.22.1"
42
40
  },
43
41
  "devDependencies": {
44
- "@babel/core": "^7.19.1",
45
- "@babel/preset-env": "^7.19.1",
46
- "@babel/preset-typescript": "^7.18.6",
42
+ "multer": "^1.4.5-lts.1",
43
+ "@types/express": "^4.17.17",
44
+ "express": "^4.18.2",
45
+ "@babel/core": "^7.21.3",
46
+ "@babel/preset-env": "^7.20.2",
47
+ "@babel/preset-typescript": "^7.21.0",
47
48
  "@types/accept-language-parser": "^1.5.3",
49
+ "@types/multer": "^1.4.7",
48
50
  "@types/pluralize": "^0.0.29",
49
51
  "@types/validatorjs": "^3.15.0",
50
- "@typescript-eslint/eslint-plugin": "^5.37.0",
51
- "@typescript-eslint/parser": "^5.37.0",
52
- "babel-jest": "^29.0.3",
52
+ "@typescript-eslint/eslint-plugin": "^5.56.0",
53
+ "@typescript-eslint/parser": "^5.56.0",
54
+ "babel-jest": "^29.5.0",
53
55
  "eslint": "^7.32.0",
54
56
  "eslint-config-standard": "^16.0.3",
55
- "eslint-plugin-import": "^2.25.4",
57
+ "eslint-plugin-import": "^2.27.5",
56
58
  "eslint-plugin-node": "^11.1.0",
57
59
  "eslint-plugin-promise": "^5.1.0",
58
60
  "eslint-plugin-unicorn": "^33.0.1",
59
61
  "eslint-watch": "^7.0.0",
60
- "glob": "^8.0.3",
61
- "jest": "^29.0.3",
62
+ "glob": "^9.3.2",
63
+ "jest": "^29.5.0",
62
64
  "mysql": "^2.18.1",
63
65
  "node-color-log": "^10.0.2",
64
- "nodemon": "^2.0.15",
65
- "pg": "^8.7.1",
66
+ "nodemon": "^2.0.22",
67
+ "pg": "^8.10.0",
66
68
  "set-value": ">=4.1.0",
67
- "sqlite3": "^5.0.2",
69
+ "sqlite3": "^5.1.6",
68
70
  "ts-node": "^10.9.1",
69
- "typescript": "^4.8.3"
71
+ "typescript": "^5.0.2"
70
72
  }
71
73
  }
package/CHANGELOG.md DELETED
@@ -1,212 +0,0 @@
1
- # Release Notes
2
-
3
- ## [0.22.0 (2023-01-29)](https://github.com/axe-api/axe-api/compare/0.22.0...0.21.0)
4
-
5
- ### Features
6
-
7
- - Added Soft-Deleting feature [#41](https://github.com/axe-api/axe-api/issues/41)
8
-
9
- ### Fixed
10
-
11
- - Fixed model relation route URLs [#141](https://github.com/axe-api/axe-api/issues/141)
12
-
13
- ## [0.21.0 (2022-12-28)](https://github.com/axe-api/axe-api/compare/0.21.0...0.20.4)
14
-
15
- ### Features
16
-
17
- - Added `i18n` support. [#44](https://github.com/axe-api/axe-api/issues/44)
18
-
19
- ## [0.20.4 (2022-12-24)](https://github.com/axe-api/axe-api/compare/0.20.4...0.20.3)
20
-
21
- ### Fixed
22
-
23
- - Fixed [#124](https://github.com/axe-api/axe-api/issues/124)
24
- - Throwing errors in the `development` environment has been fixed.
25
- - Unbuilt integration test issue has been fixed.
26
-
27
- ## [0.20.3 (2022-12-24)](https://github.com/axe-api/axe-api/compare/0.20.3...0.20.0)
28
-
29
- ### Fixed
30
-
31
- - NPM publish bugs
32
-
33
- ## [0.20.0 (2022-12-24)](https://github.com/axe-api/axe-api/compare/0.20.0...0.19.2)
34
-
35
- In the whole application, TypeScript becomes the new language except for migration files and it's structure. You can read the documentation about how to migrate from `0.19.2` to `0.20.0`.
36
-
37
- ### Breaking Changes
38
-
39
- #### Naming Changes
40
-
41
- - File extensions: `User.js` to `User.ts`
42
- - `LOG_LEVELS` constant variable has been changed with `LogLevels` enum.
43
- - `HANDLERS` constant variable has been changed with `HandlerTypes` enum.
44
- - `IoC` service has been renamed as `IoCService`.
45
- - Hooks and Event files' names should be singular;
46
- - `UserHooks.js` => `UserHook.ts`
47
- - `UserEvents.js` => `UserEvent.ts`
48
-
49
- #### Interface Changes
50
-
51
- - `validations()` getter should return `IMethodBaseValidations` interface.
52
- - In hook functions, `IHookParameter` interface should be used as the parameter type.
53
- - Init functions (`onBeforeInit`, `onAfterInit`) should be use the `Express` type;
54
- - `const onBeforeInit = async ({ app }) => {` => `const onBeforeInit = async (app: Express) => {`
55
- - `const onAfterInit = async ({ app }) => {` => `const onAfterInit = async (app: Express) => {`
56
- - Application config should be implemented `IApplicationConfig` interface.
57
-
58
- #### Implementation Changes
59
-
60
- - Starting server part has been changed;
61
- - `const server = new Server(appFolder)` => `const server = new Server()`
62
- - `server.listen()` => `server.start(__dirname);`
63
- - `knexfile.js` should not use the `app/Application/Config.js` anymore.
64
-
65
- ## [0.19.2 (2022-01-22)](https://github.com/axe-api/axe-api/compare/0.19.2...0.19.1)
66
-
67
- ### Fixed
68
-
69
- - Fixed the calling `onBeforePaginate` and `onBeforeShow` hooks bug.
70
-
71
- ## [0.19.1 (2022-01-22)](https://github.com/axe-api/axe-api/compare/0.19.1...0.19.0)
72
-
73
- ### Fixed
74
-
75
- - knex.js version update.
76
-
77
- ## [0.19.0 (2021-12-05)](https://github.com/axe-api/axe-api/compare/0.19.0...0.18.1)
78
-
79
- ### Fixed
80
-
81
- - [#110](https://github.com/axe-api/axe-api/issues/110)
82
-
83
- ### Enhancements
84
-
85
- - [#106](https://github.com/axe-api/axe-api/issues/106)
86
-
87
- ## [0.18.1 (2021-12-02)](https://github.com/axe-api/axe-api/compare/0.18.1...0.18.0)
88
-
89
- ### Fixed
90
-
91
- - [#117](https://github.com/axe-api/axe-api/issues/117)
92
-
93
- ## [0.18.0 (2021-11-30)](https://github.com/axe-api/axe-api/compare/0.18.0...0.17.5)
94
-
95
- ### Fixed
96
-
97
- - [#115](https://github.com/axe-api/axe-api/issues/115)
98
- - [#114](https://github.com/axe-api/axe-api/issues/114)
99
-
100
- ### Enhancements
101
-
102
- - [#113](https://github.com/axe-api/axe-api/issues/113)
103
- - [#107](https://github.com/axe-api/axe-api/issues/107)
104
- - [#108](https://github.com/axe-api/axe-api/issues/108)
105
-
106
- ## [0.17.5 (2021-11-27)](https://github.com/axe-api/axe-api/compare/0.17.5...0.17.4)
107
-
108
- ### Fixed
109
-
110
- - [#111](https://github.com/axe-api/axe-api/issues/111)
111
-
112
- ## [0.17.4 (2021-10-28)](https://github.com/axe-api/axe-api/compare/0.17.4...0.17.3)
113
-
114
- ### Fixed
115
-
116
- - [#97](https://github.com/axe-api/axe-api/issues/97)
117
- - [#104](https://github.com/axe-api/axe-api/issues/104)
118
-
119
- ## [0.17.3 (2021-10-28)](https://github.com/axe-api/axe-api/compare/0.17.3...0.17.2)
120
-
121
- ### Fixed
122
-
123
- - [#98](https://github.com/axe-api/axe-api/issues/98)
124
-
125
- ## [0.17.2 (2021-10-17)](https://github.com/axe-api/axe-api/compare/0.17.2...0.17.1)
126
-
127
- ### Fixed
128
-
129
- - Fixed table join on the related table filter.
130
-
131
- ## [0.17.1 (2021-10-17)](https://github.com/axe-api/axe-api/compare/0.17.1...0.17.0)
132
-
133
- ### Fixed
134
-
135
- - Query bug on child models [#93](https://github.com/axe-api/axe-api/issues/93)
136
-
137
- ## [0.17.0 (2021-10-17)](https://github.com/axe-api/axe-api/compare/0.17.0...0.16.0)
138
-
139
- ### Fixed
140
-
141
- - Related query column name check bug has been fixed.
142
-
143
- ### Features
144
-
145
- - Global serializer for HTTP results [#37](https://github.com/axe-api/axe-api/issues/37)
146
-
147
- ## [0.16.0 (2021-10-06)](https://github.com/axe-api/axe-api/compare/0.16.0...0.15.0)
148
-
149
- ### Features
150
-
151
- - Fixes [#89](https://github.com/axe-api/axe-api/issues/89)
152
-
153
- ## [0.15.0 (2021-10-03)](https://github.com/axe-api/axe-api/compare/0.15.0...0.14.1)
154
-
155
- ### Features
156
-
157
- - Fixes [#87](https://github.com/axe-api/axe-api/issues/87)
158
-
159
- ## [0.14.1 (2021-09-20)](https://github.com/axe-api/axe-api/compare/0.14.1...0.14.0)
160
-
161
- ### Fixed
162
-
163
- - Fixes [#83](https://github.com/axe-api/axe-api/issues/83)
164
-
165
- ## [0.14.0 (2021-09-15)](https://github.com/axe-api/axe-api/compare/0.14.0...0.13.3)
166
-
167
- ### Features
168
-
169
- - General hooks definition feature has been added. ([#81](https://github.com/axe-api/axe-api/issues/81))
170
-
171
- ## [0.13.3 (2021-09-15)](https://github.com/axe-api/axe-api/compare/0.13.2...0.13.3)
172
-
173
- ### Fixed
174
-
175
- - Fixed CORS bugs.
176
-
177
- ## [0.13.2 (2021-08-20)](https://github.com/axe-api/axe-api/compare/0.13.1...0.13.2)
178
-
179
- ### Fixed
180
-
181
- - Fixes [#27](https://github.com/axe-api/axe-api/issues/27)
182
- - Fixes [#29](https://github.com/axe-api/axe-api/issues/29)
183
- - Fixes [#75](https://github.com/axe-api/axe-api/issues/75)
184
- - Fixes [#78](https://github.com/axe-api/axe-api/issues/78)
185
-
186
- ## [0.13.1 (2021-08-09)](https://github.com/axe-api/axe-api/compare/0.13.0...0.13.1)
187
-
188
- ### Fixed
189
-
190
- - Fixes [#69](https://github.com/axe-api/axe-api/issues/69)
191
- - Fixes [#70](https://github.com/axe-api/axe-api/issues/70)
192
- - Fixes [#71](https://github.com/axe-api/axe-api/issues/71)
193
- - Fixes [#72](https://github.com/axe-api/axe-api/issues/72)
194
-
195
- ## [0.13.0 (2021-07-25)](https://github.com/axe-api/axe-api/compare/0.12.2...0.13.0)
196
-
197
- ### Features
198
-
199
- - PostgreSQL database analyzer and integration tests have been added.
200
-
201
- ## [0.12.2 (2021-07-24)](https://github.com/axe-api/axe-api/compare/0.12.1...0.12.2)
202
-
203
- ### Fixed
204
-
205
- - Throwing an error if the primary key column isn't in the database table bug has been fixed. (#61)[https://github.com/axe-api/axe-api/issues/61]
206
- - Using numeric column name bug has been fixed. (#24)[https://github.com/axe-api/axe-api/issues/24]
207
-
208
- ## [0.12.1 (2021-07-24)](https://github.com/axe-api/axe-api/compare/0.12.0...0.12.1)
209
-
210
- ### Fixed
211
-
212
- - Fixed security issues.
@@ -1,5 +0,0 @@
1
- import { IFolders } from "../Interfaces";
2
- declare class FolderResolver {
3
- resolve(appFolder: string): IFolders;
4
- }
5
- export default FolderResolver;
@@ -1,19 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const path_1 = __importDefault(require("path"));
7
- class FolderResolver {
8
- resolve(appFolder) {
9
- return {
10
- App: appFolder,
11
- Config: path_1.default.join(appFolder, "app", "Config"),
12
- Events: path_1.default.join(appFolder, "app", "Events"),
13
- Hooks: path_1.default.join(appFolder, "app", "Hooks"),
14
- Middlewares: path_1.default.join(appFolder, "app", "Middlewares"),
15
- Models: path_1.default.join(appFolder, "app", "Models"),
16
- };
17
- }
18
- }
19
- exports.default = FolderResolver;