@fdm-monster/server 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.
Binary file
package/README.md CHANGED
@@ -76,7 +76,7 @@ Please join the discord, but stay professional and proactive!
76
76
  These are the people involved in the project. Find the meaning of the emoji keys [here](https://allcontributors.org/docs/en/emoji-key).
77
77
 
78
78
  <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
79
- [![All Contributors](https://img.shields.io/badge/all_contributors-17-orange.svg?style=flat-square)](#contributors-)
79
+ [![All Contributors](https://img.shields.io/badge/all_contributors-18-orange.svg?style=flat-square)](#contributors-)
80
80
  <!-- ALL-CONTRIBUTORS-BADGE:END -->
81
81
 
82
82
  <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
@@ -106,6 +106,7 @@ These are the people involved in the project. Find the meaning of the emoji keys
106
106
  <td align="center" valign="top" width="14.28%"><a href="https://techinterview.guide"><img src="https://avatars.githubusercontent.com/u/168030?v=4?s=80" width="80px;" alt="w. ian douglas"/><br /><sub><b>w. ian douglas</b></sub></a><br /><a href="#ideas-iandouglas" title="Ideas, Planning, & Feedback">🤔</a></td>
107
107
  <td align="center" valign="top" width="14.28%"><a href="http://insanityautomation.com/"><img src="https://avatars.githubusercontent.com/u/38436470?v=4?s=80" width="80px;" alt="InsanityAutomation"/><br /><sub><b>InsanityAutomation</b></sub></a><br /><a href="#ideas-InsanityAutomation" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/fdm-monster/fdm-monster/issues?q=author%3AInsanityAutomation" title="Bug reports">🐛</a></td>
108
108
  <td align="center" valign="top" width="14.28%"><a href="https://github.com/LyfeOnEdge"><img src="https://avatars.githubusercontent.com/u/26140376?v=4?s=80" width="80px;" alt="Andrew (LyfeOnEdge) (ArcticGentoo)"/><br /><sub><b>Andrew (LyfeOnEdge) (ArcticGentoo)</b></sub></a><br /><a href="#ideas-LyfeOnEdge" title="Ideas, Planning, & Feedback">🤔</a></td>
109
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/callanova"><img src="https://avatars.githubusercontent.com/u/175639705?v=4?s=80" width="80px;" alt="callanova"/><br /><sub><b>callanova</b></sub></a><br /><a href="https://github.com/fdm-monster/fdm-monster/issues?q=author%3Acallanova" title="Bug reports">🐛</a></td>
109
110
  </tr>
110
111
  </tbody>
111
112
  </table>
package/RELEASE_NOTES.MD CHANGED
@@ -1,11 +1,19 @@
1
1
  # Develop
2
2
 
3
+ # FDM Monster 11/11/2024 1.7.3
4
+
5
+ ## Fixes:
6
+
7
+ - BaseService: catch null or undefined id before querying database
8
+ - Add set user roles API to avoid users staying in limbo with GUEST role after verification.
9
+ - User API apply consistent string number coercion in user API to avoid unexpected ID comparison
10
+
3
11
  # FDM Monster 11/11/2024 1.7.2
4
12
 
5
13
  ## Fixes:
6
14
 
7
15
  - API & Service validators: adjust max length of apiKey property validation to 43 to allow new `secrets` based OctoPrint api keys
8
-
16
+
9
17
  # FDM Monster 04/11/2024 1.7.1
10
18
 
11
19
  ## Changes:
@@ -2,21 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- function _export(target, all) {
6
- for(var name in all)Object.defineProperty(target, name, {
7
- enumerable: true,
8
- get: all[name]
9
- });
10
- }
11
- _export(exports, {
12
- UserController: function() {
5
+ Object.defineProperty(exports, "UserController", {
6
+ enumerable: true,
7
+ get: function() {
13
8
  return UserController;
14
- },
15
- default: function() {
16
- return _default;
17
9
  }
18
10
  });
19
- const _awilixexpress = require("awilix-express");
11
+ const _express = require("express");
20
12
  const _serverconstants = require("../server.constants");
21
13
  const _authenticate = require("../middleware/authenticate");
22
14
  const _authorizationconstants = require("../constants/authorization.constants");
@@ -25,6 +17,16 @@ const _genericvalidation = require("./validation/generic.validation");
25
17
  const _runtimeexceptions = require("../exceptions/runtime.exceptions");
26
18
  const _demomiddleware = require("../middleware/demo.middleware");
27
19
  const _errorutils = require("../utils/error.utils");
20
+ const _awilixexpress = require("awilix-express");
21
+ function _ts_decorate(decorators, target, key, desc) {
22
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
23
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
24
+ else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
25
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
26
+ }
27
+ function _ts_metadata(k, v) {
28
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
29
+ }
28
30
  class UserController {
29
31
  userService;
30
32
  roleService;
@@ -42,6 +44,14 @@ class UserController {
42
44
  this.isTypeormMode = isTypeormMode;
43
45
  this.logger = loggerFactory(UserController.name);
44
46
  }
47
+ async list(req, res) {
48
+ const users = await this.userService.listUsers();
49
+ res.send(users.map((u)=>this.userService.toDto(u)));
50
+ }
51
+ async listRoles(req, res) {
52
+ const roleDtos = this.roleService.roles.map((r)=>this.roleService.toDto(r));
53
+ res.send(roleDtos);
54
+ }
45
55
  async profile(req, res) {
46
56
  if (!req.user?.id) {
47
57
  res.send({});
@@ -50,21 +60,16 @@ class UserController {
50
60
  const user = await this.userService.getUser(req.user?.id);
51
61
  res.send(this.userService.toDto(user));
52
62
  }
53
- async list(req, res) {
54
- const users = await this.userService.listUsers();
55
- res.send(users.map((u)=>this.userService.toDto(u)));
56
- }
57
- async listRoles(req, res) {
58
- const roleDtos = this.roleService.roles.map((r)=>this.roleService.toDto(r));
59
- res.send(roleDtos);
63
+ async get(req, res) {
64
+ const { id } = await (0, _validators.validateInput)(req.params, (0, _genericvalidation.idRulesV2)(this.isTypeormMode));
65
+ const user = await this.userService.getUser(id);
66
+ res.send(this.userService.toDto(user));
60
67
  }
61
68
  async delete(req, res) {
62
69
  const { id } = await (0, _validators.validateInput)(req.params, (0, _genericvalidation.idRulesV2)(this.isTypeormMode));
63
70
  const ownUserId = req.user?.id;
64
- if (ownUserId) {
65
- if (ownUserId === id) {
66
- throw new _runtimeexceptions.ForbiddenError("Not allowed to delete own account");
67
- }
71
+ if (ownUserId == id) {
72
+ throw new _runtimeexceptions.ForbiddenError("Not allowed to delete own account");
68
73
  }
69
74
  const isRootUser = await this.userService.isUserRootUser(id);
70
75
  if (isRootUser) {
@@ -84,14 +89,9 @@ class UserController {
84
89
  }
85
90
  res.send();
86
91
  }
87
- async get(req, res) {
88
- const { id } = await (0, _validators.validateInput)(req.params, (0, _genericvalidation.idRulesV2)(this.isTypeormMode));
89
- const user = await this.userService.getUser(id);
90
- res.send(this.userService.toDto(user));
91
- }
92
92
  async changeUsername(req, res) {
93
93
  const { id } = await (0, _validators.validateInput)(req.params, (0, _genericvalidation.idRulesV2)(this.isTypeormMode));
94
- if (req.user?.id !== id && await this.settingsStore.getLoginRequired()) {
94
+ if (req.user?.id != id && await this.settingsStore.getLoginRequired()) {
95
95
  throw new _runtimeexceptions.ForbiddenError("Not allowed to change username of other users");
96
96
  }
97
97
  const { username } = await (0, _validators.validateInput)(req.body, {
@@ -102,7 +102,7 @@ class UserController {
102
102
  }
103
103
  async changePassword(req, res) {
104
104
  const { id } = await (0, _validators.validateInput)(req.params, (0, _genericvalidation.idRulesV2)(this.isTypeormMode));
105
- if (req.user?.id !== id && await this.settingsStore.getLoginRequired()) {
105
+ if (req.user?.id != id && await this.settingsStore.getLoginRequired()) {
106
106
  throw new _runtimeexceptions.ForbiddenError("Not allowed to change password of other users");
107
107
  }
108
108
  const { oldPassword, newPassword } = await (0, _validators.validateInput)(req.body, {
@@ -112,13 +112,34 @@ class UserController {
112
112
  await this.userService.updatePasswordById(id, oldPassword, newPassword);
113
113
  res.send();
114
114
  }
115
+ async setUserRoles(req, res) {
116
+ const { id: currentUserId } = await (0, _validators.validateInput)(req.params, (0, _genericvalidation.idRulesV2)(this.isTypeormMode));
117
+ const ownUserId = req.user?.id;
118
+ const ownUser = await this.userService.getUser(ownUserId);
119
+ const ownUserRoles = ownUser.roles;
120
+ const adminRole = await this.roleService.getSynchronizedRoleByName(_authorizationconstants.ROLES.ADMIN);
121
+ if (ownUserId == currentUserId && !ownUserRoles.includes(adminRole.id) && !ownUser.isRootUser) {
122
+ throw new _runtimeexceptions.ForbiddenError("Only an ADMIN or OWNER user is allowed to change its own roles");
123
+ }
124
+ const { roleIds } = await (0, _validators.validateInput)(req.body, {
125
+ roleIds: "array",
126
+ "roleIds.*": "alphaNumeric"
127
+ });
128
+ if (ownUserId == currentUserId && !roleIds.includes(adminRole.id)) {
129
+ if (ownUser.isRootUser) {
130
+ throw new _runtimeexceptions.BadRequestException("It does not make sense to remove ADMIN role from an OWNER user.");
131
+ } else {
132
+ throw new _runtimeexceptions.BadRequestException("An ADMIN user cannot remove its ADMIN role.");
133
+ }
134
+ }
135
+ await this.userService.setUserRoleIds(currentUserId, roleIds);
136
+ res.send();
137
+ }
115
138
  async setVerified(req, res) {
116
139
  const { id } = await (0, _validators.validateInput)(req.params, (0, _genericvalidation.idRulesV2)(this.isTypeormMode));
117
140
  const ownUserId = req.user?.id;
118
- if (ownUserId) {
119
- if (ownUserId === id) {
120
- throw new _runtimeexceptions.ForbiddenError("Not allowed to change own verified status");
121
- }
141
+ if (ownUserId == id) {
142
+ throw new _runtimeexceptions.ForbiddenError("Not allowed to change own verified status");
122
143
  }
123
144
  const isRootUser = await this.userService.isUserRootUser(id);
124
145
  if (isRootUser) {
@@ -152,38 +173,152 @@ class UserController {
152
173
  }
153
174
  }
154
175
  }
155
- const _default = (0, _awilixexpress.createController)(UserController).prefix(_serverconstants.AppConstants.apiRoute + "/user").before([
156
- (0, _authenticate.authenticate)()
157
- ]).get("/", "list", {
158
- before: [
176
+ _ts_decorate([
177
+ (0, _awilixexpress.GET)(),
178
+ (0, _awilixexpress.route)("/"),
179
+ (0, _awilixexpress.before)([
159
180
  (0, _authenticate.authorizeRoles)([
160
181
  _authorizationconstants.ROLES.ADMIN
161
182
  ])
162
- ]
163
- }).get("/roles", "listRoles", {}).get("/profile", "profile").get("/:id", "get", {
164
- before: [
183
+ ]),
184
+ _ts_metadata("design:type", Function),
185
+ _ts_metadata("design:paramtypes", [
186
+ typeof _express.Request === "undefined" ? Object : _express.Request,
187
+ typeof _express.Response === "undefined" ? Object : _express.Response
188
+ ]),
189
+ _ts_metadata("design:returntype", Promise)
190
+ ], UserController.prototype, "list", null);
191
+ _ts_decorate([
192
+ (0, _awilixexpress.GET)(),
193
+ (0, _awilixexpress.route)("/roles"),
194
+ _ts_metadata("design:type", Function),
195
+ _ts_metadata("design:paramtypes", [
196
+ typeof _express.Request === "undefined" ? Object : _express.Request,
197
+ typeof _express.Response === "undefined" ? Object : _express.Response
198
+ ]),
199
+ _ts_metadata("design:returntype", Promise)
200
+ ], UserController.prototype, "listRoles", null);
201
+ _ts_decorate([
202
+ (0, _awilixexpress.GET)(),
203
+ (0, _awilixexpress.route)("/profile"),
204
+ _ts_metadata("design:type", Function),
205
+ _ts_metadata("design:paramtypes", [
206
+ typeof _express.Request === "undefined" ? Object : _express.Request,
207
+ typeof _express.Response === "undefined" ? Object : _express.Response
208
+ ]),
209
+ _ts_metadata("design:returntype", Promise)
210
+ ], UserController.prototype, "profile", null);
211
+ _ts_decorate([
212
+ (0, _awilixexpress.GET)(),
213
+ (0, _awilixexpress.route)("/:id"),
214
+ (0, _awilixexpress.before)([
165
215
  (0, _authenticate.authorizeRoles)([
166
216
  _authorizationconstants.ROLES.ADMIN
167
217
  ])
168
- ]
169
- }).delete("/:id", "delete", {
170
- before: [
218
+ ]),
219
+ _ts_metadata("design:type", Function),
220
+ _ts_metadata("design:paramtypes", [
221
+ typeof _express.Request === "undefined" ? Object : _express.Request,
222
+ typeof _express.Response === "undefined" ? Object : _express.Response
223
+ ]),
224
+ _ts_metadata("design:returntype", Promise)
225
+ ], UserController.prototype, "get", null);
226
+ _ts_decorate([
227
+ (0, _awilixexpress.DELETE)(),
228
+ (0, _awilixexpress.route)("/:id"),
229
+ (0, _awilixexpress.before)([
171
230
  (0, _authenticate.authorizeRoles)([
172
231
  _authorizationconstants.ROLES.ADMIN
173
232
  ]),
174
233
  _demomiddleware.demoUserNotAllowed
175
- ]
176
- }).post("/:id/set-root-user", "setRootUser", {
177
- before: [
234
+ ]),
235
+ _ts_metadata("design:type", Function),
236
+ _ts_metadata("design:paramtypes", [
237
+ typeof _express.Request === "undefined" ? Object : _express.Request,
238
+ typeof _express.Response === "undefined" ? Object : _express.Response
239
+ ]),
240
+ _ts_metadata("design:returntype", Promise)
241
+ ], UserController.prototype, "delete", null);
242
+ _ts_decorate([
243
+ (0, _awilixexpress.POST)(),
244
+ (0, _awilixexpress.route)("/:id/change-username"),
245
+ (0, _awilixexpress.before)([
246
+ _demomiddleware.demoUserNotAllowed
247
+ ]),
248
+ _ts_metadata("design:type", Function),
249
+ _ts_metadata("design:paramtypes", [
250
+ typeof _express.Request === "undefined" ? Object : _express.Request,
251
+ typeof _express.Response === "undefined" ? Object : _express.Response
252
+ ]),
253
+ _ts_metadata("design:returntype", Promise)
254
+ ], UserController.prototype, "changeUsername", null);
255
+ _ts_decorate([
256
+ (0, _awilixexpress.POST)(),
257
+ (0, _awilixexpress.route)("/:id/change-password"),
258
+ (0, _awilixexpress.before)([
178
259
  _demomiddleware.demoUserNotAllowed
179
- ]
180
- }).post("/:id/set-verified", "setVerified", {
181
- before: [
260
+ ]),
261
+ _ts_metadata("design:type", Function),
262
+ _ts_metadata("design:paramtypes", [
263
+ typeof _express.Request === "undefined" ? Object : _express.Request,
264
+ typeof _express.Response === "undefined" ? Object : _express.Response
265
+ ]),
266
+ _ts_metadata("design:returntype", Promise)
267
+ ], UserController.prototype, "changePassword", null);
268
+ _ts_decorate([
269
+ (0, _awilixexpress.POST)(),
270
+ (0, _awilixexpress.route)("/:id/set-user-roles"),
271
+ (0, _awilixexpress.before)([
182
272
  (0, _authenticate.authorizeRoles)([
183
273
  _authorizationconstants.ROLES.ADMIN
184
274
  ]),
185
275
  _demomiddleware.demoUserNotAllowed
186
- ]
187
- }).post("/:id/change-username", "changeUsername", _demomiddleware.demoUserNotAllowedInterceptor).post("/:id/change-password", "changePassword", _demomiddleware.demoUserNotAllowedInterceptor);
276
+ ]),
277
+ _ts_metadata("design:type", Function),
278
+ _ts_metadata("design:paramtypes", [
279
+ typeof _express.Request === "undefined" ? Object : _express.Request,
280
+ typeof _express.Response === "undefined" ? Object : _express.Response
281
+ ]),
282
+ _ts_metadata("design:returntype", Promise)
283
+ ], UserController.prototype, "setUserRoles", null);
284
+ _ts_decorate([
285
+ (0, _awilixexpress.POST)(),
286
+ (0, _awilixexpress.route)("/:id/set-verified"),
287
+ (0, _awilixexpress.before)([
288
+ (0, _authenticate.authorizeRoles)([
289
+ _authorizationconstants.ROLES.ADMIN
290
+ ]),
291
+ _demomiddleware.demoUserNotAllowed
292
+ ]),
293
+ _ts_metadata("design:type", Function),
294
+ _ts_metadata("design:paramtypes", [
295
+ typeof _express.Request === "undefined" ? Object : _express.Request,
296
+ typeof _express.Response === "undefined" ? Object : _express.Response
297
+ ]),
298
+ _ts_metadata("design:returntype", Promise)
299
+ ], UserController.prototype, "setVerified", null);
300
+ _ts_decorate([
301
+ (0, _awilixexpress.POST)(),
302
+ (0, _awilixexpress.route)("/:id/set-root-user"),
303
+ (0, _awilixexpress.before)([
304
+ _demomiddleware.demoUserNotAllowed
305
+ ]),
306
+ _ts_metadata("design:type", Function),
307
+ _ts_metadata("design:paramtypes", [
308
+ typeof _express.Request === "undefined" ? Object : _express.Request,
309
+ typeof _express.Response === "undefined" ? Object : _express.Response
310
+ ]),
311
+ _ts_metadata("design:returntype", Promise)
312
+ ], UserController.prototype, "setRootUser", null);
313
+ UserController = _ts_decorate([
314
+ (0, _awilixexpress.route)(_serverconstants.AppConstants.apiRoute + "/user"),
315
+ (0, _awilixexpress.before)([
316
+ (0, _authenticate.authenticate)()
317
+ ]),
318
+ _ts_metadata("design:type", Function),
319
+ _ts_metadata("design:paramtypes", [
320
+ Object
321
+ ])
322
+ ], UserController);
188
323
 
189
324
  //# sourceMappingURL=user.controller.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/controllers/user.controller.ts"],"names":["UserController","userService","roleService","configService","authService","settingsStore","logger","isTypeormMode","constructor","loggerFactory","name","profile","req","res","user","id","send","getUser","toDto","list","users","listUsers","map","u","listRoles","roleDtos","roles","r","delete","validateInput","params","idRulesV2","ownUserId","ForbiddenError","isRootUser","isUserRootUser","isDemoMode","demoUserId","getDemoUserId","throwIfDemoMode","deleteUser","logoutUserId","e","error","errorSummary","get","changeUsername","getLoginRequired","username","body","updateUsernameById","changePassword","oldPassword","newPassword","updatePasswordById","setVerified","isVerified","setVerifiedById","setRootUser","userId","setIsRootUserById","createController","prefix","AppConstants","apiRoute","before","authenticate","authorizeRoles","ROLES","ADMIN","demoUserNotAllowed","post","demoUserNotAllowedInterceptor"],"mappings":";;;;;;;;;;;IAkBaA,cAAc;eAAdA;;IAoLb,OAsBiF;eAtBjF;;;+BAtMiC;iCACJ;8BACgB;wCACvB;4BACQ;mCACJ;mCACK;gCAImC;4BAKrC;AAGtB,MAAMA;IACXC,YAA0B;IAC1BC,YAA0B;IAC1BC,cAA8B;IAC9BC,YAA0B;IAC1BC,cAA6B;IAC7BC,OAAsB;IACtBC,cAAuB;IAEvBC,YAAY,EACVP,WAAW,EACXE,aAAa,EACbD,WAAW,EACXG,aAAa,EACbD,WAAW,EACXK,aAAa,EACbF,aAAa,EASd,CAAE;QACD,IAAI,CAACN,WAAW,GAAGA;QACnB,IAAI,CAACE,aAAa,GAAGA;QACrB,IAAI,CAACD,WAAW,GAAGA;QACnB,IAAI,CAACE,WAAW,GAAGA;QACnB,IAAI,CAACC,aAAa,GAAGA;QACrB,IAAI,CAACE,aAAa,GAAGA;QACrB,IAAI,CAACD,MAAM,GAAGG,cAAcT,eAAeU,IAAI;IACjD;IAEA,MAAMC,QAAQC,GAAY,EAAEC,GAAa,EAAE;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YAACC,6BAAK,CAACC,KAAK;SAAC;QAAGC,kCAAkB;KAAC;AAC7D,GACCC,IAAI,CAAC,wBAAwB,kBAAkBC,6CAA6B,EAC5ED,IAAI,CAAC,wBAAwB,kBAAkBC,6CAA6B"}
1
+ {"version":3,"sources":["../../src/controllers/user.controller.ts"],"names":["UserController","userService","roleService","configService","authService","settingsStore","logger","isTypeormMode","constructor","loggerFactory","name","list","req","res","users","listUsers","send","map","u","toDto","listRoles","roleDtos","roles","r","profile","user","id","getUser","get","validateInput","params","idRulesV2","delete","ownUserId","ForbiddenError","isRootUser","isUserRootUser","isDemoMode","demoUserId","getDemoUserId","throwIfDemoMode","deleteUser","logoutUserId","e","error","errorSummary","changeUsername","getLoginRequired","username","body","updateUsernameById","changePassword","oldPassword","newPassword","updatePasswordById","setUserRoles","currentUserId","ownUser","ownUserRoles","adminRole","getSynchronizedRoleByName","ROLES","ADMIN","includes","roleIds","BadRequestException","setUserRoleIds","setVerified","isVerified","setVerifiedById","setRootUser","userId","setIsRootUserById","authorizeRoles","demoUserNotAllowed","AppConstants","apiRoute","authenticate"],"mappings":";;;;+BAqBaA;;;eAAAA;;;yBApBqB;iCACL;8BACgB;wCACvB;4BACQ;mCACJ;mCAC0B;gCAGjB;4BAKN;+BAEoB;;;;;;;;;;AAI1C,MAAMA;IACXC,YAA0B;IAC1BC,YAA0B;IAC1BC,cAA8B;IAC9BC,YAA0B;IAC1BC,cAA6B;IAC7BC,OAAsB;IACtBC,cAAuB;IAEvBC,YAAY,EACVP,WAAW,EACXE,aAAa,EACbD,WAAW,EACXG,aAAa,EACbD,WAAW,EACXK,aAAa,EACbF,aAAa,EASd,CAAE;QACD,IAAI,CAACN,WAAW,GAAGA;QACnB,IAAI,CAACE,aAAa,GAAGA;QACrB,IAAI,CAACD,WAAW,GAAGA;QACnB,IAAI,CAACE,WAAW,GAAGA;QACnB,IAAI,CAACC,aAAa,GAAGA;QACrB,IAAI,CAACE,aAAa,GAAGA;QACrB,IAAI,CAACD,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G,MAAMN,IAAAA,yBAAa,EAACjB,IAAIqC,IAAI,EAAE;YACnDd,YAAY;QACd;QACA,MAAM,IAAI,CAAClC,WAAW,CAACuE,iBAAiB,CAAC9C,IAAIS;QAC7CtB,IAAIG,IAAI;IACV;IAEAwB,kBAAkB;QAChB,MAAMH,aAAa,IAAI,CAAClC,aAAa,CAACkC,UAAU;QAChD,IAAIA,YAAY;YACd,MAAM,IAAIH,iCAAc,CAAC;QAC3B;IACF;AACF;;;;;QAzLWuC,IAAAA,4BAAc,EAAC;YAACZ,6BAAK,CAACC,KAAK;SAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA2B5BW,IAAAA,4BAAc,EAAC;YAACZ,6BAAK,CAACC,KAAK;SAAC;;;;;;;;;;;;;QAS5BW,IAAAA,4BAAc,EAAC;YAACZ,6BAAK,CAACC,KAAK;SAAC;QAAGY,kCAAkB;;;;;;;;;;;;;QAkCjDA,kCAAkB;;;;;;;;;;;;;QAiBlBA,kCAAkB;;;;;;;;;;;;;QAkBlBD,IAAAA,4BAAc,EAAC;YAACZ,6BAAK,CAACC,KAAK;SAAC;QAAGY,kCAAkB;;;;;;;;;;;;;QAgCjDD,IAAAA,4BAAc,EAAC;YAACZ,6BAAK,CAACC,KAAK;SAAC;QAAGY,kCAAkB;;;;;;;;;;;;;QAwBjDA,kCAAkB;;;;;;;;;;8BAxMtBC,6BAAY,CAACC,QAAQ,GAAG;;QACtBC,IAAAA,0BAAY"}
@@ -66,7 +66,7 @@ const AppConstants = {
66
66
  githubUrl: "https://github.com/fdm-monster/fdm-monster",
67
67
  orgName: "fdm-monster",
68
68
  currentWizardVersion: 1,
69
- defaultClientMinimum: "1.6.8",
69
+ defaultClientMinimum: "1.6.10",
70
70
  influxUrl: "INFLUX_URL",
71
71
  influxToken: "INFLUX_TOKEN",
72
72
  influxOrg: "INFLUX_ORG",
@@ -22,6 +22,9 @@ function BaseService(entity, dto, createDTO, updateDto) {
22
22
  }
23
23
  async get(id, throwIfNotFound = true, options) {
24
24
  try {
25
+ if (id === null || id === undefined) {
26
+ throw new _typeorm.EntityNotFoundError(entity, "Id was not provided");
27
+ }
25
28
  return this.repository.findOneOrFail({
26
29
  ...options,
27
30
  where: {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/services/orm/base.service.ts"],"names":["BaseService","entity","dto","createDTO","updateDto","BaseServiceHost","typeormService","repository","constructor","getDataSource","getRepository","get","id","throwIfNotFound","options","findOneOrFail","where","e","EntityNotFoundError","NotFoundException","undefined","list","find","listPaged","page","DEFAULT_PAGE","take","pageSize","skip","update","validate","Object","assign","create","save","delete","deleteMany","ids","emitEvent"],"mappings":";;;;+BAkBgBA;;;eAAAA;;;yBAPT;gCACkB;mCAGS;+BACQ;AAEnC,SAASA,YAKdC,MAAuB,EAAEC,GAAc,EAAEC,SAA2B,EAAEC,SAA2B;IACjG,MAAeC;QACbC,eAA+B;QAC/BC,WAA0B;QAE1BC,YAAY,EAAEF,cAAc,EAAsC,CAAE;YAClE,IAAI,CAACA,cAAc,GAAGA;YACtB,IAAI,CAACC,UAAU,GAAGD,eAAeG,aAAa,GAAGC,aAAa,CAACT;QACjE;QAIA,MAAMU,IAAIC,EAAgB,EAAEC,kBAAkB,IAAI,EAAEC,OAA2B,EAAE;YAC/E,IAAI;gBACF,OAAO,IAAI,CAACP,UAAU,CAACQ,aAAa,CAAC;oBAAE,GAAGD,OAAO;oBAAEE,OAAO;wBAAEJ;oBAAG;gBAAE;YACnE,EAAE,OAAOK,GAAG;gBACV,IAAIJ,mBAAmBI,aAAaC,4BAAmB,EAAE;oBACvD,MAAM,IAAIC,oCAAiB,CAAC,CAAC,WAAW,EAAElB,OAAO,mCAAmC,CAAC;gBACvF;gBACA,OAAOmB;YACT;QACF;QAEA,MAAMC,KAAKP,OAA4B,EAAE;YACvC,OAAO,IAAI,CAACP,UAAU,CAACe,IAAI,CAACR;QAC9B;QAEA,MAAMS,UAAUC,OAAoBC,2BAAY,EAAEX,OAA4B,EAAE;YAC9E,OAAO,IAAI,CAACP,UAAU,CAACe,IAAI,CAAC;gBAAEI,MAAMF,KAAKG,QAAQ;gBAAEC,MAAMJ,KAAKG,QAAQ,GAAGH,KAAKA,IAAI;gBAAE,GAAGV,OAAO;YAAC;QACjG;QAEA,MAAMe,OAAOjB,EAAgB,EAAER,SAAoB,EAAE;YACnD,MAAMH,SAAS,MAAM,IAAI,CAACU,GAAG,CAACC;YAC9B,MAAMkB,IAAAA,wBAAQ,EAAC1B;YACf,MAAM0B,IAAAA,wBAAQ,EAACC,OAAOC,MAAM,CAAC/B,QAAQG;YACrC,MAAM,IAAI,CAACG,UAAU,CAACsB,MAAM,CAAC5B,OAAOW,EAAE,EAAER;YACxC,OAAO,MAAM,IAAI,CAACO,GAAG,CAACC;QACxB;QAEA,MAAMqB,OAAO/B,GAAc,EAAE;YAE3B,IAAIA,IAAIU,EAAE,EAAE;gBACV,OAAOV,IAAIU,EAAE;YACf;YACA,MAAMkB,IAAAA,wBAAQ,EAAC5B;YACf,MAAMD,SAAS,IAAI,CAACM,UAAU,CAAC0B,MAAM,CAAC/B;YACtC,MAAM4B,IAAAA,wBAAQ,EAAC7B;YAEf,OAAO,MAAM,IAAI,CAACM,UAAU,CAAC2B,IAAI,CAACjC;QACpC;QAEA,MAAMkC,OAAOvB,EAAgB,EAAEC,kBAAkB,IAAI,EAAE;YACrD,MAAMZ,SAAS,MAAM,IAAI,CAACU,GAAG,CAACC,IAAIC;YAClC,OAAO,MAAM,IAAI,CAACN,UAAU,CAAC4B,MAAM,CAAClC,OAAOW,EAAE;QAC/C;QAEA,MAAMwB,WAAWC,GAAmB,EAAEC,YAAY,IAAI,EAAyB;YAC7E,OAAO,MAAM,IAAI,CAAC/B,UAAU,CAAC4B,MAAM,CAACE;QACtC;IACF;IAEA,OAAOhC;AACT"}
1
+ {"version":3,"sources":["../../../src/services/orm/base.service.ts"],"names":["BaseService","entity","dto","createDTO","updateDto","BaseServiceHost","typeormService","repository","constructor","getDataSource","getRepository","get","id","throwIfNotFound","options","undefined","EntityNotFoundError","findOneOrFail","where","e","NotFoundException","list","find","listPaged","page","DEFAULT_PAGE","take","pageSize","skip","update","validate","Object","assign","create","save","delete","deleteMany","ids","emitEvent"],"mappings":";;;;+BAkBgBA;;;eAAAA;;;yBAPT;gCACkB;mCAGS;+BACQ;AAEnC,SAASA,YAKdC,MAAuB,EAAEC,GAAc,EAAEC,SAA2B,EAAEC,SAA2B;IACjG,MAAeC;QACbC,eAA+B;QAC/BC,WAA0B;QAE1BC,YAAY,EAAEF,cAAc,EAAsC,CAAE;YAClE,IAAI,CAACA,cAAc,GAAGA;YACtB,IAAI,CAACC,UAAU,GAAGD,eAAeG,aAAa,GAAGC,aAAa,CAACT;QACjE;QAIA,MAAMU,IAAIC,EAAgB,EAAEC,kBAAkB,IAAI,EAAEC,OAA2B,EAAE;YAC/E,IAAI;gBACF,IAAIF,OAAO,QAAQA,OAAOG,WAAW;oBACnC,MAAM,IAAIC,4BAAmB,CAACf,QAAQ;gBACxC;gBACA,OAAO,IAAI,CAACM,UAAU,CAACU,aAAa,CAAC;oBAAE,GAAGH,OAAO;oBAAEI,OAAO;wBAAEN;oBAAG;gBAAE;YACnE,EAAE,OAAOO,GAAG;gBACV,IAAIN,mBAAmBM,aAAaH,4BAAmB,EAAE;oBACvD,MAAM,IAAII,oCAAiB,CAAC,CAAC,WAAW,EAAEnB,OAAO,mCAAmC,CAAC;gBACvF;gBACA,OAAOc;YACT;QACF;QAEA,MAAMM,KAAKP,OAA4B,EAAE;YACvC,OAAO,IAAI,CAACP,UAAU,CAACe,IAAI,CAACR;QAC9B;QAEA,MAAMS,UAAUC,OAAoBC,2BAAY,EAAEX,OAA4B,EAAE;YAC9E,OAAO,IAAI,CAACP,UAAU,CAACe,IAAI,CAAC;gBAAEI,MAAMF,KAAKG,QAAQ;gBAAEC,MAAMJ,KAAKG,QAAQ,GAAGH,KAAKA,IAAI;gBAAE,GAAGV,OAAO;YAAC;QACjG;QAEA,MAAMe,OAAOjB,EAAgB,EAAER,SAAoB,EAAE;YACnD,MAAMH,SAAS,MAAM,IAAI,CAACU,GAAG,CAACC;YAC9B,MAAMkB,IAAAA,wBAAQ,EAAC1B;YACf,MAAM0B,IAAAA,wBAAQ,EAACC,OAAOC,MAAM,CAAC/B,QAAQG;YACrC,MAAM,IAAI,CAACG,UAAU,CAACsB,MAAM,CAAC5B,OAAOW,EAAE,EAAER;YACxC,OAAO,MAAM,IAAI,CAACO,GAAG,CAACC;QACxB;QAEA,MAAMqB,OAAO/B,GAAc,EAAE;YAE3B,IAAIA,IAAIU,EAAE,EAAE;gBACV,OAAOV,IAAIU,EAAE;YACf;YACA,MAAMkB,IAAAA,wBAAQ,EAAC5B;YACf,MAAMD,SAAS,IAAI,CAACM,UAAU,CAAC0B,MAAM,CAAC/B;YACtC,MAAM4B,IAAAA,wBAAQ,EAAC7B;YAEf,OAAO,MAAM,IAAI,CAACM,UAAU,CAAC2B,IAAI,CAACjC;QACpC;QAEA,MAAMkC,OAAOvB,EAAgB,EAAEC,kBAAkB,IAAI,EAAE;YACrD,MAAMZ,SAAS,MAAM,IAAI,CAACU,GAAG,CAACC,IAAIC;YAClC,OAAO,MAAM,IAAI,CAACN,UAAU,CAAC4B,MAAM,CAAClC,OAAOW,EAAE;QAC/C;QAEA,MAAMwB,WAAWC,GAAmB,EAAEC,YAAY,IAAI,EAAyB;YAC7E,OAAO,MAAM,IAAI,CAAC/B,UAAU,CAAC4B,MAAM,CAACE;QACtC;IACF;IAEA,OAAOhC;AACT"}
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  },
7
7
  "author": "David Zwart",
8
8
  "license": "AGPL-3.0-or-later",
9
- "version": "1.7.2",
9
+ "version": "1.7.3",
10
10
  "bin": {
11
11
  "fdm-monster": "dist/index.js",
12
12
  "fdmm": "dist/index.js"
@@ -53,8 +53,8 @@
53
53
  "vue"
54
54
  ],
55
55
  "dependencies": {
56
- "@fdm-monster/client": "1.6.8",
57
- "@fdm-monster/client-next": "0.0.5",
56
+ "@fdm-monster/client": "1.6.10",
57
+ "@fdm-monster/client-next": "0.0.7",
58
58
  "@influxdata/influxdb-client": "1.35.0",
59
59
  "@octokit/plugin-throttling": "8.2.0",
60
60
  "@sentry/node": "8.37.1",
@@ -96,7 +96,7 @@
96
96
  "toad-scheduler": "3.0.1",
97
97
  "typeorm": "0.3.20",
98
98
  "uuid": "11.0.3",
99
- "winston": "3.16.0",
99
+ "winston": "3.17.0",
100
100
  "ws": "8.18.0"
101
101
  },
102
102
  "devDependencies": {