@fdm-monster/server 1.5.3 → 1.6.0-rc1

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 (299) hide show
  1. package/.env.template +7 -0
  2. package/README.md +3 -2
  3. package/dist/consoles/upload-test.js +52 -0
  4. package/dist/consoles/upload-test.js.map +1 -0
  5. package/dist/constants/authorization.constants.js +0 -1
  6. package/dist/constants/authorization.constants.js.map +1 -1
  7. package/dist/constants/event.constants.js.map +1 -1
  8. package/dist/constants/http-status-codes.constants.js +62 -255
  9. package/dist/constants/http-status-codes.constants.js.map +1 -1
  10. package/dist/constants/server-settings.constants.js +0 -4
  11. package/dist/constants/server-settings.constants.js.map +1 -1
  12. package/dist/constants/service.constants.js +6 -21
  13. package/dist/constants/service.constants.js.map +1 -1
  14. package/dist/container.js +4 -10
  15. package/dist/container.js.map +1 -1
  16. package/dist/container.tokens.js +1 -7
  17. package/dist/container.tokens.js.map +1 -1
  18. package/dist/controllers/auth.controller.js +0 -2
  19. package/dist/controllers/auth.controller.js.map +1 -1
  20. package/dist/controllers/custom-gcode.controller.js +1 -3
  21. package/dist/controllers/custom-gcode.controller.js.map +1 -1
  22. package/dist/controllers/floor.controller.js +0 -5
  23. package/dist/controllers/floor.controller.js.map +1 -1
  24. package/dist/controllers/plugin-firmware-update.controller.js +1 -3
  25. package/dist/controllers/plugin-firmware-update.controller.js.map +1 -1
  26. package/dist/controllers/print-completion.controller.js +1 -3
  27. package/dist/controllers/print-completion.controller.js.map +1 -1
  28. package/dist/controllers/printer-files.controller.js +18 -70
  29. package/dist/controllers/printer-files.controller.js.map +1 -1
  30. package/dist/controllers/printer.controller.js +7 -25
  31. package/dist/controllers/printer.controller.js.map +1 -1
  32. package/dist/controllers/server-private.controller.js +0 -1
  33. package/dist/controllers/server-private.controller.js.map +1 -1
  34. package/dist/controllers/server-public.controller.js +0 -1
  35. package/dist/controllers/server-public.controller.js.map +1 -1
  36. package/dist/controllers/settings.controller.js +0 -2
  37. package/dist/controllers/settings.controller.js.map +1 -1
  38. package/dist/controllers/user.controller.js +1 -10
  39. package/dist/controllers/user.controller.js.map +1 -1
  40. package/dist/controllers/validation/setting.validation.js +0 -1
  41. package/dist/controllers/validation/setting.validation.js.map +1 -1
  42. package/dist/entities/base.entity.js +29 -0
  43. package/dist/entities/base.entity.js.map +1 -0
  44. package/dist/handlers/cache-manager.js +1 -1
  45. package/dist/handlers/cache-manager.js.map +1 -1
  46. package/dist/handlers/event-emitter.js +0 -7
  47. package/dist/handlers/event-emitter.js.map +1 -1
  48. package/dist/handlers/logger.js +1 -1
  49. package/dist/handlers/logger.js.map +1 -1
  50. package/dist/handlers/validators.js +1 -1
  51. package/dist/handlers/validators.js.map +1 -1
  52. package/dist/middleware/authenticate.js +0 -2
  53. package/dist/middleware/authenticate.js.map +1 -1
  54. package/dist/middleware/exception.filter.js +0 -1
  55. package/dist/middleware/exception.filter.js.map +1 -1
  56. package/dist/middleware/global.middleware.js +0 -4
  57. package/dist/middleware/global.middleware.js.map +1 -1
  58. package/dist/models/Auth/User.js +0 -2
  59. package/dist/models/Auth/User.js.map +1 -1
  60. package/dist/models/Printer.js +4 -46
  61. package/dist/models/Printer.js.map +1 -1
  62. package/dist/models/PrinterFile.js +81 -0
  63. package/dist/models/PrinterFile.js.map +1 -0
  64. package/dist/models/Settings.js +0 -1
  65. package/dist/models/Settings.js.map +1 -1
  66. package/dist/models/index.js +4 -0
  67. package/dist/models/index.js.map +1 -1
  68. package/dist/mongo-migrations/20210713120034-printers-settingsapperance-apikey.js +0 -4
  69. package/dist/mongo-migrations/20210713120034-printers-settingsapperance-apikey.js.map +1 -1
  70. package/dist/mongo-migrations/20210907173950-printers-enabled.js +0 -4
  71. package/dist/mongo-migrations/20210907173950-printers-enabled.js.map +1 -1
  72. package/dist/mongo-migrations/20211029110742-user-password-passwordhash.js +0 -4
  73. package/dist/mongo-migrations/20211029110742-user-password-passwordhash.js.map +1 -1
  74. package/dist/mongo-migrations/20231111081809-printer-flatten-name.js +0 -5
  75. package/dist/mongo-migrations/20231111081809-printer-flatten-name.js.map +1 -1
  76. package/dist/mongo-migrations/20231111082521-printer-remove-settingsappearance.js +0 -5
  77. package/dist/mongo-migrations/20231111082521-printer-remove-settingsappearance.js.map +1 -1
  78. package/dist/mongo-migrations/20231202183902-printer-files-simpler.js +41 -0
  79. package/dist/mongo-migrations/20231202183902-printer-files-simpler.js.map +1 -0
  80. package/dist/server.constants.js +1 -19
  81. package/dist/server.constants.js.map +1 -1
  82. package/dist/server.core.js +6 -7
  83. package/dist/server.core.js.map +1 -1
  84. package/dist/server.env.js +4 -16
  85. package/dist/server.env.js.map +1 -1
  86. package/dist/server.host.js +3 -7
  87. package/dist/server.host.js.map +1 -1
  88. package/dist/services/authentication/auth.service.js +2 -20
  89. package/dist/services/authentication/auth.service.js.map +1 -1
  90. package/dist/services/authentication/jwt.service.js +0 -1
  91. package/dist/services/authentication/jwt.service.js.map +1 -1
  92. package/dist/services/authentication/refresh-token.service.js +0 -3
  93. package/dist/services/authentication/refresh-token.service.js.map +1 -1
  94. package/dist/services/authentication/user.service.js +0 -4
  95. package/dist/services/authentication/user.service.js.map +1 -1
  96. package/dist/services/batch-call.service.js +4 -8
  97. package/dist/services/batch-call.service.js.map +1 -1
  98. package/dist/services/camera-stream.service.js +0 -1
  99. package/dist/services/camera-stream.service.js.map +1 -1
  100. package/dist/services/core/client-bundle.service.js +1 -4
  101. package/dist/services/core/client-bundle.service.js.map +1 -1
  102. package/dist/services/core/logs-manager.service.js +1 -2
  103. package/dist/services/core/logs-manager.service.js.map +1 -1
  104. package/dist/services/core/multer.service.js +6 -9
  105. package/dist/services/core/multer.service.js.map +1 -1
  106. package/dist/services/core/server-release.service.js +4 -13
  107. package/dist/services/core/server-release.service.js.map +1 -1
  108. package/dist/services/core/server-update.service.js +0 -2
  109. package/dist/services/core/server-update.service.js.map +1 -1
  110. package/dist/services/core/task-manager.service.js +9 -22
  111. package/dist/services/core/task-manager.service.js.map +1 -1
  112. package/dist/services/core/yaml.service.js +0 -7
  113. package/dist/services/core/yaml.service.js.map +1 -1
  114. package/dist/services/floor.service.js +2 -43
  115. package/dist/services/floor.service.js.map +1 -1
  116. package/dist/services/interfaces/print-completion.dto.js +0 -2
  117. package/dist/services/interfaces/print-completion.dto.js.map +1 -1
  118. package/dist/services/interfaces/print-completion.interface.js +6 -0
  119. package/dist/services/interfaces/{print-completion.service.js.map → print-completion.interface.js.map} +1 -1
  120. package/dist/services/interfaces/printer-file.dto.js +3 -1
  121. package/dist/services/interfaces/printer-file.dto.js.map +1 -1
  122. package/dist/services/interfaces/refresh-token.dto.js +0 -2
  123. package/dist/services/interfaces/refresh-token.dto.js.map +1 -1
  124. package/dist/services/interfaces/settings.dto.js +0 -1
  125. package/dist/services/interfaces/settings.dto.js.map +1 -1
  126. package/dist/services/octoprint/constants/octoprint-service.constants.js +0 -3
  127. package/dist/services/octoprint/constants/octoprint-service.constants.js.map +1 -1
  128. package/dist/services/octoprint/dto/connection-state.dto.js +46 -0
  129. package/dist/services/octoprint/dto/connection-state.dto.js.map +1 -0
  130. package/dist/services/octoprint/dto/octoprint-currentuser.dto.js +6 -0
  131. package/dist/services/octoprint/dto/octoprint-currentuser.dto.js.map +1 -0
  132. package/dist/services/octoprint/dto/octoprint-event.dto.js +41 -0
  133. package/dist/services/octoprint/dto/octoprint-event.dto.js.map +1 -0
  134. package/dist/services/octoprint/dto/octoprint-file.dto.js +84 -0
  135. package/dist/services/octoprint/dto/octoprint-file.dto.js.map +1 -0
  136. package/dist/services/octoprint/dto/octoprint-files.dto.js +17 -0
  137. package/dist/services/octoprint/dto/octoprint-files.dto.js.map +1 -0
  138. package/dist/services/{interfaces/print-completion.service.js → octoprint/dto/octoprint-session.dto.js} +1 -1
  139. package/dist/services/octoprint/dto/octoprint-session.dto.js.map +1 -0
  140. package/dist/services/octoprint/dto/octoprint-settings.dto.js +29 -0
  141. package/dist/services/octoprint/dto/octoprint-settings.dto.js.map +1 -0
  142. package/dist/services/octoprint/dto/octoprint-system-info.dto.js +41 -0
  143. package/dist/services/octoprint/dto/octoprint-system-info.dto.js.map +1 -0
  144. package/dist/services/octoprint/dto/state.dto.js +38 -0
  145. package/dist/services/octoprint/dto/state.dto.js.map +1 -0
  146. package/dist/services/octoprint/dto/websocket-output/connection-message.dto.js +6 -0
  147. package/dist/services/octoprint/dto/websocket-output/connection-message.dto.js.map +1 -0
  148. package/dist/services/octoprint/dto/websocket-output/current-message.dto.js +6 -0
  149. package/dist/services/octoprint/dto/websocket-output/current-message.dto.js.map +1 -0
  150. package/dist/services/octoprint/dto/websocket-output/event-message.dto.js +6 -0
  151. package/dist/services/octoprint/dto/websocket-output/event-message.dto.js.map +1 -0
  152. package/dist/services/octoprint/dto/websocket-output/event.type.js +54 -0
  153. package/dist/services/octoprint/dto/websocket-output/event.type.js.map +1 -0
  154. package/dist/services/octoprint/dto/websocket-output/events/client-authed.dto.js +6 -0
  155. package/dist/services/octoprint/dto/websocket-output/events/client-authed.dto.js.map +1 -0
  156. package/dist/services/octoprint/dto/websocket-output/events/client-closed.dto.js +6 -0
  157. package/dist/services/octoprint/dto/websocket-output/events/client-closed.dto.js.map +1 -0
  158. package/dist/services/octoprint/dto/websocket-output/events/client-opened.dto.js +6 -0
  159. package/dist/services/octoprint/dto/websocket-output/events/client-opened.dto.js.map +1 -0
  160. package/dist/services/octoprint/dto/websocket-output/events/dwelling.dto.js +6 -0
  161. package/dist/services/octoprint/dto/websocket-output/events/dwelling.dto.js.map +1 -0
  162. package/dist/services/octoprint/dto/websocket-output/events/file-added.dto.js +6 -0
  163. package/dist/services/octoprint/dto/websocket-output/events/file-added.dto.js.map +1 -0
  164. package/dist/services/octoprint/dto/websocket-output/events/file-deselected.dto.js +6 -0
  165. package/dist/services/octoprint/dto/websocket-output/events/file-deselected.dto.js.map +1 -0
  166. package/dist/services/octoprint/dto/websocket-output/events/file-removed.dto.js +6 -0
  167. package/dist/services/octoprint/dto/websocket-output/events/file-removed.dto.js.map +1 -0
  168. package/dist/services/octoprint/dto/websocket-output/events/folder-added.dto.js +6 -0
  169. package/dist/services/octoprint/dto/websocket-output/events/folder-added.dto.js.map +1 -0
  170. package/dist/services/octoprint/dto/websocket-output/events/home.dto.js +6 -0
  171. package/dist/services/octoprint/dto/websocket-output/events/home.dto.js.map +1 -0
  172. package/dist/services/octoprint/dto/websocket-output/events/metadata-analysis-finished.dto.js +6 -0
  173. package/dist/services/octoprint/dto/websocket-output/events/metadata-analysis-finished.dto.js.map +1 -0
  174. package/dist/services/octoprint/dto/websocket-output/events/metadata-analysis-started.dto.js +6 -0
  175. package/dist/services/octoprint/dto/websocket-output/events/metadata-analysis-started.dto.js.map +1 -0
  176. package/dist/services/octoprint/dto/websocket-output/events/metadata-statistics-updated.dto.js +6 -0
  177. package/dist/services/octoprint/dto/websocket-output/events/metadata-statistics-updated.dto.js.map +1 -0
  178. package/dist/services/octoprint/dto/websocket-output/events/position-update.dto.js +6 -0
  179. package/dist/services/octoprint/dto/websocket-output/events/position-update.dto.js.map +1 -0
  180. package/dist/services/octoprint/dto/websocket-output/events/print-cancelled.dto.js +6 -0
  181. package/dist/services/octoprint/dto/websocket-output/events/print-cancelled.dto.js.map +1 -0
  182. package/dist/services/octoprint/dto/websocket-output/events/print-cancelling.dto.js +6 -0
  183. package/dist/services/octoprint/dto/websocket-output/events/print-cancelling.dto.js.map +1 -0
  184. package/dist/services/octoprint/dto/websocket-output/events/print-done.dto.js +6 -0
  185. package/dist/services/octoprint/dto/websocket-output/events/print-done.dto.js.map +1 -0
  186. package/dist/services/octoprint/dto/websocket-output/events/print-failed.dto.js +6 -0
  187. package/dist/services/octoprint/dto/websocket-output/events/print-failed.dto.js.map +1 -0
  188. package/dist/services/octoprint/dto/websocket-output/events/print-paused.dto.js +6 -0
  189. package/dist/services/octoprint/dto/websocket-output/events/print-paused.dto.js.map +1 -0
  190. package/dist/services/octoprint/dto/websocket-output/events/print-resumed.dto.js +6 -0
  191. package/dist/services/octoprint/dto/websocket-output/events/print-resumed.dto.js.map +1 -0
  192. package/dist/services/octoprint/dto/websocket-output/events/print-started.dto.js +6 -0
  193. package/dist/services/octoprint/dto/websocket-output/events/print-started.dto.js.map +1 -0
  194. package/dist/services/octoprint/dto/websocket-output/events/printer-state-changed.dto.js +6 -0
  195. package/dist/services/octoprint/dto/websocket-output/events/printer-state-changed.dto.js.map +1 -0
  196. package/dist/services/octoprint/dto/websocket-output/events/transfer-done.dto.js +6 -0
  197. package/dist/services/octoprint/dto/websocket-output/events/transfer-done.dto.js.map +1 -0
  198. package/dist/services/octoprint/dto/websocket-output/events/transfer-started.dto.js +6 -0
  199. package/dist/services/octoprint/dto/websocket-output/events/transfer-started.dto.js.map +1 -0
  200. package/dist/services/octoprint/dto/websocket-output/events/updated-files.dto.js +6 -0
  201. package/dist/services/octoprint/dto/websocket-output/events/updated-files.dto.js.map +1 -0
  202. package/dist/services/octoprint/dto/websocket-output/events/upload.dto.js +6 -0
  203. package/dist/services/octoprint/dto/websocket-output/events/upload.dto.js.map +1 -0
  204. package/dist/services/octoprint/dto/websocket-output/events/user-logged-in.dto.js +6 -0
  205. package/dist/services/octoprint/dto/websocket-output/events/user-logged-in.dto.js.map +1 -0
  206. package/dist/services/octoprint/dto/websocket-output/events/z-change.dto.js +6 -0
  207. package/dist/services/octoprint/dto/websocket-output/events/z-change.dto.js.map +1 -0
  208. package/dist/services/octoprint/dto/websocket-output/history-message.dto.js +6 -0
  209. package/dist/services/octoprint/dto/websocket-output/history-message.dto.js.map +1 -0
  210. package/dist/services/octoprint/dto/websocket-output/plugin-message.dto.js +6 -0
  211. package/dist/services/octoprint/dto/websocket-output/plugin-message.dto.js.map +1 -0
  212. package/dist/services/octoprint/dto/websocket-output/timelapse-message.dto.js +6 -0
  213. package/dist/services/octoprint/dto/websocket-output/timelapse-message.dto.js.map +1 -0
  214. package/dist/services/octoprint/octoprint-api.routes.js +15 -17
  215. package/dist/services/octoprint/octoprint-api.routes.js.map +1 -1
  216. package/dist/services/octoprint/octoprint-api.service.js +189 -158
  217. package/dist/services/octoprint/octoprint-api.service.js.map +1 -1
  218. package/dist/services/octoprint/octoprint-sockio.adapter.js +50 -85
  219. package/dist/services/octoprint/octoprint-sockio.adapter.js.map +1 -1
  220. package/dist/services/octoprint/plugin-base.service.js +0 -1
  221. package/dist/services/octoprint/plugin-base.service.js.map +1 -1
  222. package/dist/services/octoprint/plugin-firmware-update.service.js +0 -3
  223. package/dist/services/octoprint/plugin-firmware-update.service.js.map +1 -1
  224. package/dist/services/octoprint/utils/api.utils.js +0 -35
  225. package/dist/services/octoprint/utils/api.utils.js.map +1 -1
  226. package/dist/services/orm/base.interface.js +6 -0
  227. package/dist/services/orm/base.interface.js.map +1 -0
  228. package/dist/services/orm/base.service.js +69 -0
  229. package/dist/services/orm/base.service.js.map +1 -0
  230. package/dist/services/print-completion.service.js +0 -1
  231. package/dist/services/print-completion.service.js.map +1 -1
  232. package/dist/services/print-completion.shared.js +0 -1
  233. package/dist/services/print-completion.shared.js.map +1 -1
  234. package/dist/services/printer-files.service.js +70 -53
  235. package/dist/services/printer-files.service.js.map +1 -1
  236. package/dist/services/printer.service.js +2 -15
  237. package/dist/services/printer.service.js.map +1 -1
  238. package/dist/services/settings.service.js +2 -8
  239. package/dist/services/settings.service.js.map +1 -1
  240. package/dist/services/validators/floor-service.validation.js +3 -3
  241. package/dist/services/validators/floor-service.validation.js.map +1 -1
  242. package/dist/services/validators/yaml-service.validation.js +0 -3
  243. package/dist/services/validators/yaml-service.validation.js.map +1 -1
  244. package/dist/shared/dtos/printer-login.dto.js +58 -0
  245. package/dist/shared/dtos/printer-login.dto.js.map +1 -0
  246. package/dist/shared/websocket.adapter.js +59 -0
  247. package/dist/shared/websocket.adapter.js.map +1 -0
  248. package/dist/state/file-upload-tracker.cache.js +0 -1
  249. package/dist/state/file-upload-tracker.cache.js.map +1 -1
  250. package/dist/state/file.cache.js +19 -42
  251. package/dist/state/file.cache.js.map +1 -1
  252. package/dist/state/floor.store.js +0 -1
  253. package/dist/state/floor.store.js.map +1 -1
  254. package/dist/state/printer-events.cache.js +1 -3
  255. package/dist/state/printer-events.cache.js.map +1 -1
  256. package/dist/state/{files.store.js → printer-files.store.js} +26 -43
  257. package/dist/state/printer-files.store.js.map +1 -0
  258. package/dist/state/printer-socket.store.js +7 -32
  259. package/dist/state/printer-socket.store.js.map +1 -1
  260. package/dist/state/printer.cache.js +0 -1
  261. package/dist/state/printer.cache.js.map +1 -1
  262. package/dist/state/settings.store.js +6 -3
  263. package/dist/state/settings.store.js.map +1 -1
  264. package/dist/state/socket-io.gateway.js +0 -2
  265. package/dist/state/socket-io.gateway.js.map +1 -1
  266. package/dist/state/test-printer-socket.store.js +1 -7
  267. package/dist/state/test-printer-socket.store.js.map +1 -1
  268. package/dist/task.presets.js +0 -11
  269. package/dist/task.presets.js.map +1 -1
  270. package/dist/tasks/boot.task.js +6 -10
  271. package/dist/tasks/boot.task.js.map +1 -1
  272. package/dist/tasks/print-completion.socketio.task.js +13 -22
  273. package/dist/tasks/print-completion.socketio.task.js.map +1 -1
  274. package/dist/tasks/printer-file-clean.task.js +12 -20
  275. package/dist/tasks/printer-file-clean.task.js.map +1 -1
  276. package/dist/tasks/printer-websocket-restore.task.js +1 -5
  277. package/dist/tasks/printer-websocket-restore.task.js.map +1 -1
  278. package/dist/tasks/printer-websocket.task.js +5 -15
  279. package/dist/tasks/printer-websocket.task.js.map +1 -1
  280. package/dist/tasks/socketio.task.js +0 -1
  281. package/dist/tasks/socketio.task.js.map +1 -1
  282. package/dist/tasks.js +0 -2
  283. package/dist/tasks.js.map +1 -1
  284. package/dist/types/express/index.d.js +0 -1
  285. package/dist/types/express/index.d.js.map +1 -1
  286. package/dist/utils/env.utils.js +1 -14
  287. package/dist/utils/env.utils.js.map +1 -1
  288. package/dist/utils/is-docker.js +1 -1
  289. package/dist/utils/is-docker.js.map +1 -1
  290. package/dist/utils/normalize-url.js +0 -35
  291. package/dist/utils/normalize-url.js.map +1 -1
  292. package/dist/utils/semver.utils.js +0 -1
  293. package/dist/utils/semver.utils.js.map +1 -1
  294. package/package.json +53 -43
  295. package/dist/state/files.store.js.map +0 -1
  296. package/dist/utils/find-predicate.utils.js +0 -18
  297. package/dist/utils/find-predicate.utils.js.map +0 -1
  298. package/dist/utils/websocket.adapter.js +0 -105
  299. package/dist/utils/websocket.adapter.js.map +0 -1
@@ -35,11 +35,14 @@ const PrinterSchema = new _mongoose.Schema({
35
35
  type: String,
36
36
  required: false
37
37
  },
38
+ assignee: {
39
+ type: String,
40
+ required: false
41
+ },
38
42
  name: {
39
43
  type: String,
40
44
  required: true
41
45
  },
42
- // Auto-generated below
43
46
  currentUser: {
44
47
  type: String,
45
48
  required: false
@@ -48,51 +51,6 @@ const PrinterSchema = new _mongoose.Schema({
48
51
  type: Number,
49
52
  required: false
50
53
  },
51
- // Deprecated, Will become many to many
52
- lastPrintedFile: {
53
- type: {
54
- fileName: {
55
- type: String,
56
- required: true
57
- },
58
- editTimestamp: {
59
- type: Number,
60
- required: true
61
- },
62
- parsedColor: {
63
- type: String,
64
- required: false
65
- },
66
- parsedVisualizationRAL: {
67
- type: Number,
68
- required: false
69
- },
70
- parsedAmount: {
71
- type: Number,
72
- required: false
73
- },
74
- parsedMaterial: {
75
- type: String,
76
- required: false
77
- },
78
- parsedOrderCode: {
79
- type: String,
80
- required: false
81
- }
82
- },
83
- required: false
84
- },
85
- // Deprecated in v1.5.0
86
- fileList: {
87
- type: Object,
88
- default: {
89
- files: [],
90
- folders: [],
91
- free: 0,
92
- total: 0
93
- },
94
- required: true
95
- },
96
54
  feedRate: {
97
55
  type: Number,
98
56
  required: false
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/models/Printer.ts"],"names":["Printer","PrinterSchema","Schema","apiKey","type","String","required","printerURL","enabled","Boolean","default","disabledReason","name","currentUser","dateAdded","Number","lastPrintedFile","fileName","editTimestamp","parsedColor","parsedVisualizationRAL","parsedAmount","parsedMaterial","parsedOrderCode","fileList","Object","files","folders","free","total","feedRate","flowRate","model"],"mappings":";;;;;;;;;;;IAoHaA,OAAO;eAAPA;;IAtFAC,aAAa;eAAbA;;;0BA9BiB;AA8BvB,MAAMA,gBAAgB,IAAIC,gBAAM,CAAW;IAChDC,QAAQ;QACNC,MAAMC;QACNC,UAAU;IACZ;IACAC,YAAY;QACVH,MAAMC;QACNC,UAAU;IACZ;IACAE,SAAS;QACPJ,MAAMK;QACNH,UAAU;QACVI,SAAS;IACX;IACAC,gBAAgB;QACdP,MAAMC;QACNC,UAAU;IACZ;IACAM,MAAM;QACJR,MAAMC;QACNC,UAAU;IACZ;IACA,uBAAuB;IACvBO,aAAa;QACXT,MAAMC;QACNC,UAAU;IACZ;IACAQ,WAAW;QACTV,MAAMW;QACNT,UAAU;IACZ;IACA,uCAAuC;IACvCU,iBAAiB;QACfZ,MAAM;YACJa,UAAU;gBACRb,MAAMC;gBACNC,UAAU;YACZ;YACAY,eAAe;gBACbd,MAAMW;gBACNT,UAAU;YACZ;YACAa,aAAa;gBACXf,MAAMC;gBACNC,UAAU;YACZ;YACAc,wBAAwB;gBACtBhB,MAAMW;gBACNT,UAAU;YACZ;YACAe,cAAc;gBACZjB,MAAMW;gBACNT,UAAU;YACZ;YACAgB,gBAAgB;gBACdlB,MAAMC;gBACNC,UAAU;YACZ;YACAiB,iBAAiB;gBACfnB,MAAMC;gBACNC,UAAU;YACZ;QACF;QACAA,UAAU;IACZ;IACA,uBAAuB;IACvBkB,UAAU;QACRpB,MAAMqB;QACNf,SAAS;YACPgB,OAAO,EAAE;YACTC,SAAS,EAAE;YACXC,MAAM;YACNC,OAAO;QACT;QACAvB,UAAU;IACZ;IACAwB,UAAU;QACR1B,MAAMW;QACNT,UAAU;IACZ;IACAyB,UAAU;QACR3B,MAAMW;QACNT,UAAU;IACZ;AACF;AAEO,MAAMN,UAAUgC,IAAAA,eAAK,EAAC,WAAW/B"}
1
+ {"version":3,"sources":["../../src/models/Printer.ts"],"names":["Printer","PrinterSchema","Schema","apiKey","type","String","required","printerURL","enabled","Boolean","default","disabledReason","assignee","name","currentUser","dateAdded","Number","feedRate","flowRate","model"],"mappings":";;;;;;;;;;;IA6DaA,OAAO;eAAPA;;IA7CAC,aAAa;eAAbA;;;0BAhBiB;AAgBvB,MAAMA,gBAAgB,IAAIC,gBAAM,CAAW;IAChDC,QAAQ;QACNC,MAAMC;QACNC,UAAU;IACZ;IACAC,YAAY;QACVH,MAAMC;QACNC,UAAU;IACZ;IACAE,SAAS;QACPJ,MAAMK;QACNH,UAAU;QACVI,SAAS;IACX;IACAC,gBAAgB;QACdP,MAAMC;QACNC,UAAU;IACZ;IACAM,UAAU;QACRR,MAAMC;QACNC,UAAU;IACZ;IACAO,MAAM;QACJT,MAAMC;QACNC,UAAU;IACZ;IAEAQ,aAAa;QACXV,MAAMC;QACNC,UAAU;IACZ;IACAS,WAAW;QACTX,MAAMY;QACNV,UAAU;IACZ;IACAW,UAAU;QACRb,MAAMY;QACNV,UAAU;IACZ;IACAY,UAAU;QACRd,MAAMY;QACNV,UAAU;IACZ;AACF;AAEO,MAAMN,UAAUmB,IAAAA,eAAK,EAAC,WAAWlB"}
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
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
+ PrinterFile: function() {
13
+ return PrinterFile;
14
+ },
15
+ PrinterFileSchema: function() {
16
+ return PrinterFileSchema;
17
+ }
18
+ });
19
+ const _mongoose = require("mongoose");
20
+ const PrinterFileSchema = new _mongoose.Schema({
21
+ printerId: {
22
+ type: _mongoose.Schema.Types.ObjectId,
23
+ required: true
24
+ },
25
+ name: {
26
+ type: String,
27
+ required: true
28
+ },
29
+ date: {
30
+ type: Number,
31
+ required: true
32
+ },
33
+ display: {
34
+ type: String,
35
+ required: true
36
+ },
37
+ gcodeAnalysis: {
38
+ type: Object,
39
+ default: null,
40
+ required: false
41
+ },
42
+ hash: {
43
+ type: String,
44
+ required: true
45
+ },
46
+ origin: {
47
+ type: String,
48
+ required: true
49
+ },
50
+ path: {
51
+ type: String,
52
+ required: true
53
+ },
54
+ prints: {
55
+ type: Object,
56
+ required: false
57
+ },
58
+ refs: {
59
+ type: Object,
60
+ required: false
61
+ },
62
+ size: {
63
+ type: Number,
64
+ required: false
65
+ },
66
+ statistics: {
67
+ type: Object,
68
+ required: false
69
+ },
70
+ type: {
71
+ type: String,
72
+ required: false
73
+ },
74
+ typePath: {
75
+ type: Array(String),
76
+ required: false
77
+ }
78
+ });
79
+ const PrinterFile = (0, _mongoose.model)("PrinterFile", PrinterFileSchema);
80
+
81
+ //# sourceMappingURL=PrinterFile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/models/PrinterFile.ts"],"names":["PrinterFile","PrinterFileSchema","Schema","printerId","type","Types","ObjectId","required","name","String","date","Number","display","gcodeAnalysis","Object","default","hash","origin","path","prints","refs","size","statistics","typePath","Array","model"],"mappings":";;;;;;;;;;;IAgFaA,WAAW;eAAXA;;IA5DAC,iBAAiB;eAAjBA;;;0BApBiB;AAoBvB,MAAMA,oBAAoB,IAAIC,gBAAM,CAAe;IACxDC,WAAW;QACTC,MAAMF,gBAAM,CAACG,KAAK,CAACC,QAAQ;QAC3BC,UAAU;IACZ;IACAC,MAAM;QACJJ,MAAMK;QACNF,UAAU;IACZ;IACAG,MAAM;QACJN,MAAMO;QACNJ,UAAU;IACZ;IACAK,SAAS;QACPR,MAAMK;QACNF,UAAU;IACZ;IACAM,eAAe;QACbT,MAAMU;QACNC,SAAS;QACTR,UAAU;IACZ;IACAS,MAAM;QACJZ,MAAMK;QACNF,UAAU;IACZ;IACAU,QAAQ;QACNb,MAAMK;QACNF,UAAU;IACZ;IACAW,MAAM;QACJd,MAAMK;QACNF,UAAU;IACZ;IACAY,QAAQ;QACNf,MAAMU;QACNP,UAAU;IACZ;IACAa,MAAM;QACJhB,MAAMU;QACNP,UAAU;IACZ;IACAc,MAAM;QACJjB,MAAMO;QACNJ,UAAU;IACZ;IACAe,YAAY;QACVlB,MAAMU;QACNP,UAAU;IACZ;IACAH,MAAM;QACJA,MAAMK;QACNF,UAAU;IACZ;IACAgB,UAAU;QACRnB,MAAMoB,MAAMf;QACZF,UAAU;IACZ;AACF;AAEO,MAAMP,cAAcyB,IAAAA,eAAK,EAAC,eAAexB"}
@@ -126,7 +126,6 @@ const SettingsSchema = new _mongoose.Schema({
126
126
  default: false,
127
127
  required: true
128
128
  },
129
- // TODO: Feature not fully tested/implemented yet
130
129
  whitelistEnabled: {
131
130
  type: Boolean,
132
131
  default: false,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/models/Settings.ts"],"names":["Settings","SettingsSchema","Schema","wizardSettingKey","wizardCompleted","type","Boolean","default","required","wizardCompletedAt","Date","wizardVersion","Number","fileCleanSettingKey","autoRemoveOldFilesBeforeUpload","autoRemoveOldFilesAtBoot","autoRemoveOldFilesCriteriumDays","credentialSettingsKey","jwtSecret","String","minlength","trim","jwtExpiresIn","refreshTokenAttempts","refreshTokenExpiry","createdAt","now","updatedAt","serverSettingsKey","sentryDiagnosticsEnabled","debugSettings","debugSocketIoEvents","debugSocketReconnect","debugSocketRetries","debugSocketSetup","debugSocketMessages","debugSocketIoBandwidth","loginRequired","registration","whitelistEnabled","whitelistedIpAddresses","frontendSettingKey","gridCols","gridRows","largeTiles","timeoutSettingKey","apiTimeout","model"],"mappings":";;;;+BA8NaA;;;eAAAA;;;0BA9NiB;yCAQvB;AA4DP,MAAMC,iBAAiB,IAAIC,gBAAM,CAAY;IAC3C,CAACC,yCAAgB,CAAC,EAAE;QAClBC,iBAAiB;YACfC,MAAMC;YACNC,SAAS;YACTC,UAAU;QACZ;QACAC,mBAAmB;YACjBJ,MAAMK;YACNH,SAAS;YACTC,UAAU;QACZ;QACAG,eAAe;YACbN,MAAMO;YACNL,SAAS;YACTC,UAAU;QACZ;IACF;IACA,CAACK,4CAAmB,CAAC,EAAE;QACrBC,gCAAgC;YAC9BT,MAAMC;YACNC,SAAS;YACTC,UAAU;QACZ;QACAO,0BAA0B;YACxBV,MAAMC;YACNC,SAAS;YACTC,UAAU;QACZ;QACAQ,iCAAiC;YAC/BX,MAAMO;YACNL,SAAS;YACTC,UAAU;QACZ;IACF;IACA,CAACS,8CAAqB,CAAC,EAAE;QACvBZ,MAAM;YACJa,WAAW;gBACTb,MAAMc;gBACNC,WAAW;gBACXC,MAAM;gBACNb,UAAU;YACZ;YACAc,cAAc;gBACZjB,MAAMO;gBACNJ,UAAU;YACZ;YACAe,sBAAsB;gBACpBlB,MAAMO;gBACNJ,UAAU;YACZ;YACAgB,oBAAoB;gBAClBnB,MAAMO;gBACNJ,UAAU;YACZ;YACAiB,WAAW;gBACTpB,MAAMK;gBACNH,SAASG,KAAKgB,GAAG;gBACjBlB,UAAU;YACZ;YACAmB,WAAW;gBACTtB,MAAMK;gBACNH,SAASG,KAAKgB,GAAG;gBACjBlB,UAAU;YACZ;QACF;QACAA,UAAU;IACZ;IACA,CAACoB,0CAAiB,CAAC,EAAE;QACnBC,0BAA0B;YACxBxB,MAAMC;YACNC,SAAS;YACTC,UAAU;QACZ;QACAsB,eAAe;YACbC,qBAAqB;gBACnB1B,MAAMC;gBACNC,SAAS;gBACTC,UAAU;YACZ;YACAwB,sBAAsB;gBACpB3B,MAAMC;gBACNC,SAAS;gBACTC,UAAU;YACZ;YACAyB,oBAAoB;gBAClB5B,MAAMC;gBACNC,SAAS;gBACTC,UAAU;YACZ;YACA0B,kBAAkB;gBAChB7B,MAAMC;gBACNC,SAAS;gBACTC,UAAU;YACZ;YACA2B,qBAAqB;gBACnB9B,MAAMC;gBACNC,SAAS;gBACTC,UAAU;YACZ;YACA4B,wBAAwB;gBACtB/B,MAAMC;gBACNC,SAAS;gBACTC,UAAU;YACZ;QACF;QACA6B,eAAe;YACbhC,MAAMC;YACNC,SAAS;YACTC,UAAU;QACZ;QACA8B,cAAc;YACZjC,MAAMC;YACNC,SAAS;YACTC,UAAU;QACZ;QACA,iDAAiD;QACjD+B,kBAAkB;YAChBlC,MAAMC;YACNC,SAAS;YACTC,UAAU;QACZ;QACAgC,wBAAwB;YACtB;gBACEnC,MAAMc;YACR;SACD;IACH;IACA,CAACsB,2CAAkB,CAAC,EAAE;QACpBC,UAAU;YACRrC,MAAMO;YACNL,SAAS;YACTC,UAAU;QACZ;QACAmC,UAAU;YACRtC,MAAMO;YACNL,SAAS;YACTC,UAAU;QACZ;QACAoC,YAAY;YACVvC,MAAMC;YACNC,SAAS;YACTC,UAAU;QACZ;IACF;IACA,CAACqC,0CAAiB,CAAC,EAAE;QACnBC,YAAY;YACVzC,MAAMO;YACNL,SAAS;YACTC,UAAU;QACZ;IACF;AACF;AAEO,MAAMR,WAAW+C,IAAAA,eAAK,EAAC,kBAAkB9C"}
1
+ {"version":3,"sources":["../../src/models/Settings.ts"],"names":["Settings","SettingsSchema","Schema","wizardSettingKey","wizardCompleted","type","Boolean","default","required","wizardCompletedAt","Date","wizardVersion","Number","fileCleanSettingKey","autoRemoveOldFilesBeforeUpload","autoRemoveOldFilesAtBoot","autoRemoveOldFilesCriteriumDays","credentialSettingsKey","jwtSecret","String","minlength","trim","jwtExpiresIn","refreshTokenAttempts","refreshTokenExpiry","createdAt","now","updatedAt","serverSettingsKey","sentryDiagnosticsEnabled","debugSettings","debugSocketIoEvents","debugSocketReconnect","debugSocketRetries","debugSocketSetup","debugSocketMessages","debugSocketIoBandwidth","loginRequired","registration","whitelistEnabled","whitelistedIpAddresses","frontendSettingKey","gridCols","gridRows","largeTiles","timeoutSettingKey","apiTimeout","model"],"mappings":";;;;+BA8NaA;;;eAAAA;;;0BA9NiB;yCAQvB;AA4DP,MAAMC,iBAAiB,IAAIC,gBAAM,CAAY;IAC3C,CAACC,yCAAgB,CAAC,EAAE;QAClBC,iBAAiB;YACfC,MAAMC;YACNC,SAAS;YACTC,UAAU;QACZ;QACAC,mBAAmB;YACjBJ,MAAMK;YACNH,SAAS;YACTC,UAAU;QACZ;QACAG,eAAe;YACbN,MAAMO;YACNL,SAAS;YACTC,UAAU;QACZ;IACF;IACA,CAACK,4CAAmB,CAAC,EAAE;QACrBC,gCAAgC;YAC9BT,MAAMC;YACNC,SAAS;YACTC,UAAU;QACZ;QACAO,0BAA0B;YACxBV,MAAMC;YACNC,SAAS;YACTC,UAAU;QACZ;QACAQ,iCAAiC;YAC/BX,MAAMO;YACNL,SAAS;YACTC,UAAU;QACZ;IACF;IACA,CAACS,8CAAqB,CAAC,EAAE;QACvBZ,MAAM;YACJa,WAAW;gBACTb,MAAMc;gBACNC,WAAW;gBACXC,MAAM;gBACNb,UAAU;YACZ;YACAc,cAAc;gBACZjB,MAAMO;gBACNJ,UAAU;YACZ;YACAe,sBAAsB;gBACpBlB,MAAMO;gBACNJ,UAAU;YACZ;YACAgB,oBAAoB;gBAClBnB,MAAMO;gBACNJ,UAAU;YACZ;YACAiB,WAAW;gBACTpB,MAAMK;gBACNH,SAASG,KAAKgB,GAAG;gBACjBlB,UAAU;YACZ;YACAmB,WAAW;gBACTtB,MAAMK;gBACNH,SAASG,KAAKgB,GAAG;gBACjBlB,UAAU;YACZ;QACF;QACAA,UAAU;IACZ;IACA,CAACoB,0CAAiB,CAAC,EAAE;QACnBC,0BAA0B;YACxBxB,MAAMC;YACNC,SAAS;YACTC,UAAU;QACZ;QACAsB,eAAe;YACbC,qBAAqB;gBACnB1B,MAAMC;gBACNC,SAAS;gBACTC,UAAU;YACZ;YACAwB,sBAAsB;gBACpB3B,MAAMC;gBACNC,SAAS;gBACTC,UAAU;YACZ;YACAyB,oBAAoB;gBAClB5B,MAAMC;gBACNC,SAAS;gBACTC,UAAU;YACZ;YACA0B,kBAAkB;gBAChB7B,MAAMC;gBACNC,SAAS;gBACTC,UAAU;YACZ;YACA2B,qBAAqB;gBACnB9B,MAAMC;gBACNC,SAAS;gBACTC,UAAU;YACZ;YACA4B,wBAAwB;gBACtB/B,MAAMC;gBACNC,SAAS;gBACTC,UAAU;YACZ;QACF;QACA6B,eAAe;YACbhC,MAAMC;YACNC,SAAS;YACTC,UAAU;QACZ;QACA8B,cAAc;YACZjC,MAAMC;YACNC,SAAS;YACTC,UAAU;QACZ;QAEA+B,kBAAkB;YAChBlC,MAAMC;YACNC,SAAS;YACTC,UAAU;QACZ;QACAgC,wBAAwB;YACtB;gBACEnC,MAAMc;YACR;SACD;IACH;IACA,CAACsB,2CAAkB,CAAC,EAAE;QACpBC,UAAU;YACRrC,MAAMO;YACNL,SAAS;YACTC,UAAU;QACZ;QACAmC,UAAU;YACRtC,MAAMO;YACNL,SAAS;YACTC,UAAU;QACZ;QACAoC,YAAY;YACVvC,MAAMC;YACNC,SAAS;YACTC,UAAU;QACZ;IACF;IACA,CAACqC,0CAAiB,CAAC,EAAE;QACnBC,YAAY;YACVzC,MAAMO;YACNL,SAAS;YACTC,UAAU;QACZ;IACF;AACF;AAEO,MAAMR,WAAW+C,IAAAA,eAAK,EAAC,kBAAkB9C"}
@@ -27,6 +27,9 @@ _export(exports, {
27
27
  Printer: function() {
28
28
  return _Printer.Printer;
29
29
  },
30
+ PrinterFile: function() {
31
+ return _PrinterFile.PrinterFile;
32
+ },
30
33
  RefreshToken: function() {
31
34
  return _RefreshToken.RefreshToken;
32
35
  },
@@ -50,5 +53,6 @@ const _PrintCompletion = require("./PrintCompletion");
50
53
  const _RefreshToken = require("./Auth/RefreshToken");
51
54
  const _CameraStream = require("./CameraStream");
52
55
  const _CustomGcode = require("./CustomGcode");
56
+ const _PrinterFile = require("./PrinterFile");
53
57
 
54
58
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/models/index.ts"],"names":["CameraStream","CustomGcode","Floor","Permission","PrintCompletion","Printer","RefreshToken","Role","Settings","User"],"mappings":";;;;;;;;;;;IAWuGA,YAAY;eAAZA,0BAAY;;IAAzEC,WAAW;eAAXA,wBAAW;;IAAnCC,KAAK;eAALA,YAAK;;IAAsDC,UAAU;eAAVA,sBAAU;;IAA9DC,eAAe;eAAfA,gCAAe;;IAA/BC,OAAO;eAAPA,gBAAO;;IAAyEC,YAAY;eAAZA,0BAAY;;IAA9BC,IAAI;eAAJA,UAAI;;IAApBC,QAAQ;eAARA,kBAAQ;;IAAEC,IAAI;eAAJA,UAAI;;;yBAX7C;uBACF;0BACG;sBACJ;sBACA;4BACM;iCACK;8BACH;8BACA;6BACD"}
1
+ {"version":3,"sources":["../../src/models/index.ts"],"names":["CameraStream","CustomGcode","Floor","Permission","PrintCompletion","Printer","PrinterFile","RefreshToken","Role","Settings","User"],"mappings":";;;;;;;;;;;IAuBEA,YAAY;eAAZA,0BAAY;;IANZC,WAAW;eAAXA,wBAAW;;IAFXC,KAAK;eAALA,YAAK;;IAMLC,UAAU;eAAVA,sBAAU;;IALVC,eAAe;eAAfA,gCAAe;;IAHfC,OAAO;eAAPA,gBAAO;;IACPC,WAAW;eAAXA,wBAAW;;IAQXC,YAAY;eAAZA,0BAAY;;IAFZC,IAAI;eAAJA,UAAI;;IAFJC,QAAQ;eAARA,kBAAQ;;IACRC,IAAI;eAAJA,UAAI;;;yBAnBkB;uBACF;0BACG;sBACJ;sBACA;4BACM;iCACK;8BACH;8BACA;6BACD;6BACA"}
@@ -3,9 +3,7 @@ module.exports = {
3
3
  async up (db, client) {
4
4
  const session = client.startSession();
5
5
  try {
6
- // Safety first
7
6
  await session.withTransaction(async ()=>{
8
- // Do the migration
9
7
  const dbCollection = db.collection("printers");
10
8
  await dbCollection.updateMany({}, {
11
9
  $rename: {
@@ -25,9 +23,7 @@ module.exports = {
25
23
  async down (db, client) {
26
24
  const session = client.startSession();
27
25
  try {
28
- // Safety first
29
26
  await session.withTransaction(async ()=>{
30
- // Do the inverse migration
31
27
  const dbCollection = db.collection("printers");
32
28
  await dbCollection.updateMany({}, {
33
29
  $rename: {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/mongo-migrations/20210713120034-printers-settingsapperance-apikey.ts"],"names":["module","exports","up","db","client","session","startSession","withTransaction","dbCollection","collection","updateMany","$rename","settingsApperance","apikey","endSession","down","settingsAppearance","apiKey"],"mappings":";AAAAA,OAAOC,OAAO,GAAG;IACf,MAAMC,IAAGC,EAAE,EAAEC,MAAM;QACjB,MAAMC,UAAUD,OAAOE,YAAY;QACnC,IAAI;YACF,eAAe;YACf,MAAMD,QAAQE,eAAe,CAAC;gBAC5B,mBAAmB;gBACnB,MAAMC,eAAeL,GAAGM,UAAU,CAAC;gBACnC,MAAMD,aAAaE,UAAU,CAAC,CAAC,GAAG;oBAAEC,SAAS;wBAAEC,mBAAmB;oBAAqB;gBAAE;gBACzF,MAAMJ,aAAaE,UAAU,CAAC,CAAC,GAAG;oBAAEC,SAAS;wBAAEE,QAAQ;oBAAS;gBAAE;YACpE;QACF,SAAU;YACR,MAAMR,QAAQS,UAAU;QAC1B;IACF;IAEA,MAAMC,MAAKZ,EAAE,EAAEC,MAAM;QACnB,MAAMC,UAAUD,OAAOE,YAAY;QACnC,IAAI;YACF,eAAe;YACf,MAAMD,QAAQE,eAAe,CAAC;gBAC5B,2BAA2B;gBAC3B,MAAMC,eAAeL,GAAGM,UAAU,CAAC;gBACnC,MAAMD,aAAaE,UAAU,CAAC,CAAC,GAAG;oBAAEC,SAAS;wBAAEK,oBAAoB;oBAAoB;gBAAE;gBACzF,MAAMR,aAAaE,UAAU,CAAC,CAAC,GAAG;oBAAEC,SAAS;wBAAEM,QAAQ;oBAAS;gBAAE;YACpE;QACF,SAAU;YACR,MAAMZ,QAAQS,UAAU;QAC1B;IACF;AACF"}
1
+ {"version":3,"sources":["../../src/mongo-migrations/20210713120034-printers-settingsapperance-apikey.ts"],"names":["module","exports","up","db","client","session","startSession","withTransaction","dbCollection","collection","updateMany","$rename","settingsApperance","apikey","endSession","down","settingsAppearance","apiKey"],"mappings":";AAAAA,OAAOC,OAAO,GAAG;IACf,MAAMC,IAAGC,EAAE,EAAEC,MAAM;QACjB,MAAMC,UAAUD,OAAOE,YAAY;QACnC,IAAI;YAEF,MAAMD,QAAQE,eAAe,CAAC;gBAE5B,MAAMC,eAAeL,GAAGM,UAAU,CAAC;gBACnC,MAAMD,aAAaE,UAAU,CAAC,CAAC,GAAG;oBAAEC,SAAS;wBAAEC,mBAAmB;oBAAqB;gBAAE;gBACzF,MAAMJ,aAAaE,UAAU,CAAC,CAAC,GAAG;oBAAEC,SAAS;wBAAEE,QAAQ;oBAAS;gBAAE;YACpE;QACF,SAAU;YACR,MAAMR,QAAQS,UAAU;QAC1B;IACF;IAEA,MAAMC,MAAKZ,EAAE,EAAEC,MAAM;QACnB,MAAMC,UAAUD,OAAOE,YAAY;QACnC,IAAI;YAEF,MAAMD,QAAQE,eAAe,CAAC;gBAE5B,MAAMC,eAAeL,GAAGM,UAAU,CAAC;gBACnC,MAAMD,aAAaE,UAAU,CAAC,CAAC,GAAG;oBAAEC,SAAS;wBAAEK,oBAAoB;oBAAoB;gBAAE;gBACzF,MAAMR,aAAaE,UAAU,CAAC,CAAC,GAAG;oBAAEC,SAAS;wBAAEM,QAAQ;oBAAS;gBAAE;YACpE;QACF,SAAU;YACR,MAAMZ,QAAQS,UAAU;QAC1B;IACF;AACF"}
@@ -3,9 +3,7 @@ module.exports = {
3
3
  async up (db, client) {
4
4
  const session = client.startSession();
5
5
  try {
6
- // Safety first
7
6
  await session.withTransaction(async ()=>{
8
- // Do the migration
9
7
  const dbCollection = db.collection("printers");
10
8
  await dbCollection.updateMany({}, {
11
9
  $set: {
@@ -20,9 +18,7 @@ module.exports = {
20
18
  async down (db, client) {
21
19
  const session = client.startSession();
22
20
  try {
23
- // Safety first
24
21
  await session.withTransaction(async ()=>{
25
- // Do the migration (destructive!)
26
22
  const dbCollection = db.collection("printers");
27
23
  await dbCollection.updateMany({}, {
28
24
  unset: {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/mongo-migrations/20210907173950-printers-enabled.ts"],"names":["module","exports","up","db","client","session","startSession","withTransaction","dbCollection","collection","updateMany","$set","enabled","endSession","down","unset"],"mappings":";AAAAA,OAAOC,OAAO,GAAG;IACf,MAAMC,IAAGC,EAAE,EAAEC,MAAM;QACjB,MAAMC,UAAUD,OAAOE,YAAY;QACnC,IAAI;YACF,eAAe;YACf,MAAMD,QAAQE,eAAe,CAAC;gBAC5B,mBAAmB;gBACnB,MAAMC,eAAeL,GAAGM,UAAU,CAAC;gBACnC,MAAMD,aAAaE,UAAU,CAAC,CAAC,GAAG;oBAAEC,MAAM;wBAAEC,SAAS;oBAAK;gBAAE;YAC9D;QACF,SAAU;YACR,MAAMP,QAAQQ,UAAU;QAC1B;IACF;IAEA,MAAMC,MAAKX,EAAE,EAAEC,MAAM;QACnB,MAAMC,UAAUD,OAAOE,YAAY;QACnC,IAAI;YACF,eAAe;YACf,MAAMD,QAAQE,eAAe,CAAC;gBAC5B,kCAAkC;gBAClC,MAAMC,eAAeL,GAAGM,UAAU,CAAC;gBACnC,MAAMD,aAAaE,UAAU,CAAC,CAAC,GAAG;oBAAEK,OAAO;wBAAEH,SAAS;oBAAG;gBAAE;YAC7D;QACF,SAAU;YACR,MAAMP,QAAQQ,UAAU;QAC1B;IACF;AACF"}
1
+ {"version":3,"sources":["../../src/mongo-migrations/20210907173950-printers-enabled.ts"],"names":["module","exports","up","db","client","session","startSession","withTransaction","dbCollection","collection","updateMany","$set","enabled","endSession","down","unset"],"mappings":";AAAAA,OAAOC,OAAO,GAAG;IACf,MAAMC,IAAGC,EAAE,EAAEC,MAAM;QACjB,MAAMC,UAAUD,OAAOE,YAAY;QACnC,IAAI;YAEF,MAAMD,QAAQE,eAAe,CAAC;gBAE5B,MAAMC,eAAeL,GAAGM,UAAU,CAAC;gBACnC,MAAMD,aAAaE,UAAU,CAAC,CAAC,GAAG;oBAAEC,MAAM;wBAAEC,SAAS;oBAAK;gBAAE;YAC9D;QACF,SAAU;YACR,MAAMP,QAAQQ,UAAU;QAC1B;IACF;IAEA,MAAMC,MAAKX,EAAE,EAAEC,MAAM;QACnB,MAAMC,UAAUD,OAAOE,YAAY;QACnC,IAAI;YAEF,MAAMD,QAAQE,eAAe,CAAC;gBAE5B,MAAMC,eAAeL,GAAGM,UAAU,CAAC;gBACnC,MAAMD,aAAaE,UAAU,CAAC,CAAC,GAAG;oBAAEK,OAAO;wBAAEH,SAAS;oBAAG;gBAAE;YAC7D;QACF,SAAU;YACR,MAAMP,QAAQQ,UAAU;QAC1B;IACF;AACF"}
@@ -3,9 +3,7 @@ module.exports = {
3
3
  async up (db, client) {
4
4
  const session = client.startSession();
5
5
  try {
6
- // Safety first
7
6
  await session.withTransaction(async ()=>{
8
- // Do the migration
9
7
  const dbCollection = db.collection("users");
10
8
  await dbCollection.updateMany({}, {
11
9
  $rename: {
@@ -20,9 +18,7 @@ module.exports = {
20
18
  async down (db, client) {
21
19
  const session = client.startSession();
22
20
  try {
23
- // Safety first
24
21
  await session.withTransaction(async ()=>{
25
- // Do the migration
26
22
  const dbCollection = db.collection("users");
27
23
  await dbCollection.updateMany({}, {
28
24
  $rename: {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/mongo-migrations/20211029110742-user-password-passwordhash.ts"],"names":["module","exports","up","db","client","session","startSession","withTransaction","dbCollection","collection","updateMany","$rename","password","endSession","down","passwordHash"],"mappings":";AAAAA,OAAOC,OAAO,GAAG;IACf,MAAMC,IAAGC,EAAE,EAAEC,MAAM;QACjB,MAAMC,UAAUD,OAAOE,YAAY;QACnC,IAAI;YACF,eAAe;YACf,MAAMD,QAAQE,eAAe,CAAC;gBAC5B,mBAAmB;gBACnB,MAAMC,eAAeL,GAAGM,UAAU,CAAC;gBACnC,MAAMD,aAAaE,UAAU,CAAC,CAAC,GAAG;oBAAEC,SAAS;wBAAEC,UAAU;oBAAe;gBAAE;YAC5E;QACF,SAAU;YACR,MAAMP,QAAQQ,UAAU;QAC1B;IACF;IAEA,MAAMC,MAAKX,EAAE,EAAEC,MAAM;QACnB,MAAMC,UAAUD,OAAOE,YAAY;QACnC,IAAI;YACF,eAAe;YACf,MAAMD,QAAQE,eAAe,CAAC;gBAC5B,mBAAmB;gBACnB,MAAMC,eAAeL,GAAGM,UAAU,CAAC;gBACnC,MAAMD,aAAaE,UAAU,CAAC,CAAC,GAAG;oBAAEC,SAAS;wBAAEI,cAAc;oBAAW;gBAAE;YAC5E;QACF,SAAU;YACR,MAAMV,QAAQQ,UAAU;QAC1B;IACF;AACF"}
1
+ {"version":3,"sources":["../../src/mongo-migrations/20211029110742-user-password-passwordhash.ts"],"names":["module","exports","up","db","client","session","startSession","withTransaction","dbCollection","collection","updateMany","$rename","password","endSession","down","passwordHash"],"mappings":";AAAAA,OAAOC,OAAO,GAAG;IACf,MAAMC,IAAGC,EAAE,EAAEC,MAAM;QACjB,MAAMC,UAAUD,OAAOE,YAAY;QACnC,IAAI;YAEF,MAAMD,QAAQE,eAAe,CAAC;gBAE5B,MAAMC,eAAeL,GAAGM,UAAU,CAAC;gBACnC,MAAMD,aAAaE,UAAU,CAAC,CAAC,GAAG;oBAAEC,SAAS;wBAAEC,UAAU;oBAAe;gBAAE;YAC5E;QACF,SAAU;YACR,MAAMP,QAAQQ,UAAU;QAC1B;IACF;IAEA,MAAMC,MAAKX,EAAE,EAAEC,MAAM;QACnB,MAAMC,UAAUD,OAAOE,YAAY;QACnC,IAAI;YAEF,MAAMD,QAAQE,eAAe,CAAC;gBAE5B,MAAMC,eAAeL,GAAGM,UAAU,CAAC;gBACnC,MAAMD,aAAaE,UAAU,CAAC,CAAC,GAAG;oBAAEC,SAAS;wBAAEI,cAAc;oBAAW;gBAAE;YAC5E;QACF,SAAU;YACR,MAAMV,QAAQQ,UAAU;QAC1B;IACF;AACF"}
@@ -14,16 +14,11 @@ module.exports = {
14
14
  } finally{
15
15
  await session.endSession();
16
16
  }
17
- // See https://github.com/seppevs/migrate-mongo/#creating-a-new-migration-script
18
- // Example:
19
- // await db.collection('albums').updateOne({artist: 'The Beatles'}, {$set: {blacklisted: true}});
20
17
  },
21
18
  async down (db, client) {
22
19
  const session = client.startSession();
23
20
  try {
24
- // Safety first
25
21
  await session.withTransaction(async ()=>{
26
- // Do the inverse migration
27
22
  const dbCollection = db.collection("printers");
28
23
  await dbCollection.updateMany({}, {
29
24
  $rename: {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/mongo-migrations/20231111081809-printer-flatten-name.ts"],"names":["module","exports","up","db","client","session","startSession","withTransaction","dbCollection","collection","updateMany","$rename","endSession","down","name"],"mappings":";AAAAA,OAAOC,OAAO,GAAG;IACf,MAAMC,IAAGC,EAAE,EAAEC,MAAM;QACjB,MAAMC,UAAUD,OAAOE,YAAY;QACnC,IAAI;YACF,MAAMD,QAAQE,eAAe,CAAC;gBAC5B,MAAMC,eAAeL,GAAGM,UAAU,CAAC;gBACnC,MAAMD,aAAaE,UAAU,CAAC,CAAC,GAAG;oBAAEC,SAAS;wBAAE,2BAA2B;oBAAO;gBAAE;YACrF;QACF,SAAU;YACR,MAAMN,QAAQO,UAAU;QAC1B;IACA,gFAAgF;IAChF,WAAW;IACX,iGAAiG;IACnG;IAEA,MAAMC,MAAKV,EAAE,EAAEC,MAAM;QACnB,MAAMC,UAAUD,OAAOE,YAAY;QACnC,IAAI;YACF,eAAe;YACf,MAAMD,QAAQE,eAAe,CAAC;gBAC5B,2BAA2B;gBAC3B,MAAMC,eAAeL,GAAGM,UAAU,CAAC;gBACnC,MAAMD,aAAaE,UAAU,CAAC,CAAC,GAAG;oBAAEC,SAAS;wBAAEG,MAAM;oBAA0B;gBAAE;YACnF;QACF,SAAU;YACR,MAAMT,QAAQO,UAAU;QAC1B;IACF;AACF"}
1
+ {"version":3,"sources":["../../src/mongo-migrations/20231111081809-printer-flatten-name.ts"],"names":["module","exports","up","db","client","session","startSession","withTransaction","dbCollection","collection","updateMany","$rename","endSession","down","name"],"mappings":";AAAAA,OAAOC,OAAO,GAAG;IACf,MAAMC,IAAGC,EAAE,EAAEC,MAAM;QACjB,MAAMC,UAAUD,OAAOE,YAAY;QACnC,IAAI;YACF,MAAMD,QAAQE,eAAe,CAAC;gBAC5B,MAAMC,eAAeL,GAAGM,UAAU,CAAC;gBACnC,MAAMD,aAAaE,UAAU,CAAC,CAAC,GAAG;oBAAEC,SAAS;wBAAE,2BAA2B;oBAAO;gBAAE;YACrF;QACF,SAAU;YACR,MAAMN,QAAQO,UAAU;QAC1B;IAIF;IAEA,MAAMC,MAAKV,EAAE,EAAEC,MAAM;QACnB,MAAMC,UAAUD,OAAOE,YAAY;QACnC,IAAI;YAEF,MAAMD,QAAQE,eAAe,CAAC;gBAE5B,MAAMC,eAAeL,GAAGM,UAAU,CAAC;gBACnC,MAAMD,aAAaE,UAAU,CAAC,CAAC,GAAG;oBAAEC,SAAS;wBAAEG,MAAM;oBAA0B;gBAAE;YACnF;QACF,SAAU;YACR,MAAMT,QAAQO,UAAU;QAC1B;IACF;AACF"}
@@ -17,16 +17,11 @@ module.exports = {
17
17
  } finally{
18
18
  await session.endSession();
19
19
  }
20
- // See https://github.com/seppevs/migrate-mongo/#creating-a-new-migration-script
21
- // Example:
22
- // await db.collection('albums').updateOne({artist: 'The Beatles'}, {$set: {blacklisted: true}});
23
20
  },
24
21
  async down (db, client) {
25
22
  const session = client.startSession();
26
23
  try {
27
- // Safety first
28
24
  await session.withTransaction(async ()=>{
29
- // Do the inverse migration
30
25
  const dbCollection = db.collection("printers");
31
26
  await dbCollection.updateMany({}, {
32
27
  $set: {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/mongo-migrations/20231111082521-printer-remove-settingsappearance.ts"],"names":["module","exports","up","db","client","session","startSession","withTransaction","dbCollection","collection","updateMany","$unset","settingsAppearance","e","console","log","endSession","down","$set"],"mappings":";AAAAA,OAAOC,OAAO,GAAG;IACf,MAAMC,IAAGC,EAAE,EAAEC,MAAM;QACjB,MAAMC,UAAUD,OAAOE,YAAY;QACnC,IAAI;YACF,MAAMD,QAAQE,eAAe,CAAC;gBAC5B,MAAMC,eAAeL,GAAGM,UAAU,CAAC;gBACnC,MAAMD,aAAaE,UAAU,CAAC,CAAC,GAAG;oBAAEC,QAAQ;wBAAEC,oBAAoB;oBAAE;gBAAE;YACxE;QACF,EAAE,OAAOC,GAAG;YACVC,QAAQC,GAAG,CAAC,gCAAgCF;YAC5C,MAAMA;QACR,SAAU;YACR,MAAMR,QAAQW,UAAU;QAC1B;IACA,gFAAgF;IAChF,WAAW;IACX,iGAAiG;IACnG;IAEA,MAAMC,MAAKd,EAAE,EAAEC,MAAM;QACnB,MAAMC,UAAUD,OAAOE,YAAY;QACnC,IAAI;YACF,eAAe;YACf,MAAMD,QAAQE,eAAe,CAAC;gBAC5B,2BAA2B;gBAC3B,MAAMC,eAAeL,GAAGM,UAAU,CAAC;gBACnC,MAAMD,aAAaE,UAAU,CAAC,CAAC,GAAG;oBAAEQ,MAAM;wBAAEN,oBAAoB,CAAC;oBAAE;gBAAE;YACvE;QACF,EAAE,OAAOC,GAAG;YACVC,QAAQC,GAAG,CAAC,kCAAkCF;YAC9C,MAAMA;QACR,SAAU;YACR,MAAMR,QAAQW,UAAU;QAC1B;IACF;AACF"}
1
+ {"version":3,"sources":["../../src/mongo-migrations/20231111082521-printer-remove-settingsappearance.ts"],"names":["module","exports","up","db","client","session","startSession","withTransaction","dbCollection","collection","updateMany","$unset","settingsAppearance","e","console","log","endSession","down","$set"],"mappings":";AAAAA,OAAOC,OAAO,GAAG;IACf,MAAMC,IAAGC,EAAE,EAAEC,MAAM;QACjB,MAAMC,UAAUD,OAAOE,YAAY;QACnC,IAAI;YACF,MAAMD,QAAQE,eAAe,CAAC;gBAC5B,MAAMC,eAAeL,GAAGM,UAAU,CAAC;gBACnC,MAAMD,aAAaE,UAAU,CAAC,CAAC,GAAG;oBAAEC,QAAQ;wBAAEC,oBAAoB;oBAAE;gBAAE;YACxE;QACF,EAAE,OAAOC,GAAG;YACVC,QAAQC,GAAG,CAAC,gCAAgCF;YAC5C,MAAMA;QACR,SAAU;YACR,MAAMR,QAAQW,UAAU;QAC1B;IAIF;IAEA,MAAMC,MAAKd,EAAE,EAAEC,MAAM;QACnB,MAAMC,UAAUD,OAAOE,YAAY;QACnC,IAAI;YAEF,MAAMD,QAAQE,eAAe,CAAC;gBAE5B,MAAMC,eAAeL,GAAGM,UAAU,CAAC;gBACnC,MAAMD,aAAaE,UAAU,CAAC,CAAC,GAAG;oBAAEQ,MAAM;wBAAEN,oBAAoB,CAAC;oBAAE;gBAAE;YACvE;QACF,EAAE,OAAOC,GAAG;YACVC,QAAQC,GAAG,CAAC,kCAAkCF;YAC9C,MAAMA;QACR,SAAU;YACR,MAAMR,QAAQW,UAAU;QAC1B;IACF;AACF"}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ module.exports = {
3
+ async up (db, client) {
4
+ const session = client.startSession();
5
+ try {
6
+ await session.withTransaction(async ()=>{
7
+ const dbCollection = db.collection("printers");
8
+ await dbCollection.updateMany({}, {
9
+ $set: {
10
+ fileList: []
11
+ }
12
+ });
13
+ });
14
+ } catch (e) {
15
+ console.log("Error executing up migration", e);
16
+ throw e;
17
+ } finally{
18
+ await session.endSession();
19
+ }
20
+ },
21
+ async down (db, client) {
22
+ const session = client.startSession();
23
+ try {
24
+ await session.withTransaction(async ()=>{
25
+ const dbCollection = db.collection("printers");
26
+ await dbCollection.updateMany({}, {
27
+ $set: {
28
+ fileList: {}
29
+ }
30
+ });
31
+ });
32
+ } catch (e) {
33
+ console.log("Error executing down migration", e);
34
+ throw e;
35
+ } finally{
36
+ await session.endSession();
37
+ }
38
+ }
39
+ };
40
+
41
+ //# sourceMappingURL=20231202183902-printer-files-simpler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/mongo-migrations/20231202183902-printer-files-simpler.ts"],"names":["module","exports","up","db","client","session","startSession","withTransaction","dbCollection","collection","updateMany","$set","fileList","e","console","log","endSession","down"],"mappings":";AAAAA,OAAOC,OAAO,GAAG;IACf,MAAMC,IAAGC,EAAE,EAAEC,MAAM;QACjB,MAAMC,UAAUD,OAAOE,YAAY;QACnC,IAAI;YACF,MAAMD,QAAQE,eAAe,CAAC;gBAC5B,MAAMC,eAAeL,GAAGM,UAAU,CAAC;gBACnC,MAAMD,aAAaE,UAAU,CAAC,CAAC,GAAG;oBAAEC,MAAM;wBAAEC,UAAU,EAAE;oBAAC;gBAAE;YAC7D;QACF,EAAE,OAAOC,GAAG;YACVC,QAAQC,GAAG,CAAC,gCAAgCF;YAC5C,MAAMA;QACR,SAAU;YACR,MAAMR,QAAQW,UAAU;QAC1B;IACF;IAEA,MAAMC,MAAKd,EAAE,EAAEC,MAAM;QACnB,MAAMC,UAAUD,OAAOE,YAAY;QACnC,IAAI;YAEF,MAAMD,QAAQE,eAAe,CAAC;gBAE5B,MAAMC,eAAeL,GAAGM,UAAU,CAAC;gBACnC,MAAMD,aAAaE,UAAU,CAAC,CAAC,GAAG;oBAAEC,MAAM;wBAAEC,UAAU,CAAC;oBAAE;gBAAE;YAC7D;QACF,EAAE,OAAOC,GAAG;YACVC,QAAQC,GAAG,CAAC,kCAAkCF;YAC9C,MAAMA;QACR,SAAU;YACR,MAAMR,QAAQW,UAAU;QAC1B;IACF;AACF"}
@@ -18,40 +18,27 @@ const AppConstants = {
18
18
  DATABASE_FILE: "DATABASE_FILE",
19
19
  pm2ServiceName: "FDM",
20
20
  logAppName: "fdm-monster",
21
- // @Deprecated: old storage path
22
21
  defaultFileStorageFolder: "./media",
23
22
  defaultLogsFolder: "./media/logs",
24
23
  defaultLogZipsFolder: "./media/log-zips",
25
- // New place for all downloads, files etc
26
24
  defaultClientBundleStorage: "./media/client-dist",
27
25
  defaultClientBundleZipsStorage: "./media/client-dist-zips",
28
26
  defaultServerPort: 4000,
29
27
  defaultMongoStringUnauthenticated: "mongodb://127.0.0.1:27017/fdm-monster",
30
28
  apiRoute: "/api",
31
29
  enableClientDistAutoUpdateKey: "ENABLE_CLIENT_DIST_AUTO_UPDATE",
32
- // This whitelist feature is experimental and may be removed or altered in the future
33
30
  ENABLE_EXPERIMENTAL_WHITELIST_SETTINGS: "ENABLE_EXPERIMENTAL_WHITELIST_SETTINGS",
34
- // Boolean string (true/false), persisted always
35
31
  OVERRIDE_LOGIN_REQUIRED: "OVERRIDE_LOGIN_REQUIRED",
36
- // Boolean string (true/false), persisted always
37
32
  OVERRIDE_REGISTRATION_ENABLED: "OVERRIDE_REGISTRATION_ENABLED",
38
- // Number
39
33
  DEFAULT_USERNAME_MINLEN: 3,
40
- // Number
41
34
  DEFAULT_PASSWORD_MINLEN: 8,
42
- // String, persisted always
43
35
  OVERRIDE_JWT_SECRET: "OVERRIDE_JWT_SECRET",
44
- // Number, Seconds, persisted always
45
36
  OVERRIDE_JWT_EXPIRES_IN: "OVERRIDE_JWT_EXPIRES_IN",
46
37
  DEFAULT_JWT_EXPIRES_IN: 60 * 60,
47
- // Number
48
38
  DEFAULT_REFRESH_TOKEN_ATTEMPTS: -1,
49
- // Number, Milli-seconds
50
39
  DEFAULT_REFRESH_TOKEN_EXPIRY: 60 * 60 * 24 * 14,
51
- // String, not persisted
52
40
  OVERRIDE_JWT_ISSUER: "OVERRIDE_JWT_ISSUER",
53
41
  DEFAULT_JWT_ISSUER: "fdm-monster-server",
54
- // String, not persisted
55
42
  OVERRIDE_JWT_AUDIENCE: "OVERRIDE_JWT_AUDIENCE",
56
43
  DEFAULT_JWT_AUDIENCE: "fdm-monster-client",
57
44
  OVERRIDE_IS_DEMO_MODE: "OVERRIDE_IS_DEMO_MODE",
@@ -75,19 +62,16 @@ const AppConstants = {
75
62
  clientRepoName: "fdm-monster-client",
76
63
  serverRepoName: "fdm-monster",
77
64
  orgName: "fdm-monster",
78
- // Wizard version changes will trigger a re-run of the wizard
79
65
  currentWizardVersion: 1,
80
- defaultClientMinimum: "1.4.2",
66
+ defaultClientMinimum: "1.5.0-rc3",
81
67
  influxUrl: "INFLUX_URL",
82
68
  influxToken: "INFLUX_TOKEN",
83
69
  influxOrg: "INFLUX_ORG",
84
70
  influxBucket: "INFLUX_BUCKET",
85
- // Websocket values
86
71
  defaultWebsocketHandshakeTimeout: 3000,
87
72
  defaultSocketThrottleRate: 1,
88
73
  debugSocketStatesKey: "DEBUG_SOCKET_STATES",
89
74
  defaultDebugSocketStates: "false",
90
- // Future experimental feature
91
75
  enableMqttAutoDiscoveryToken: "ENABLE_MQTT_AUTODISCOVERY",
92
76
  enableMqttAutoDiscoveryDefault: "false",
93
77
  mqttUrlToken: "MQTT_HOST",
@@ -95,9 +79,7 @@ const AppConstants = {
95
79
  mqttPortDefault: 1883,
96
80
  mqttUsernameToken: "MQTT_USERNAME",
97
81
  mqttPasswordToken: "MQTT_PASSWORD",
98
- // MonsterPi
99
82
  monsterPiFilePath: "/etc/monsterpi_version",
100
- // Sentry
101
83
  sentryCustomDsnToken: "SENTRY_CUSTOM_DSN",
102
84
  sentryCustomDsnDefault: "https://164b8028a8a745bba3dbcab991b84ae7@o4503975545733120.ingest.sentry.io/4505101598261248",
103
85
  debugRoutesKey: "DEBUG_ROUTES",
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/server.constants.ts"],"names":["AppConstants","NON_NPM_MODE_KEY","NODE_ENV_KEY","VERSION_KEY","SERVER_PORT_KEY","MONGO_KEY","DATABASE_PATH","DATABASE_FILE","pm2ServiceName","logAppName","defaultFileStorageFolder","defaultLogsFolder","defaultLogZipsFolder","defaultClientBundleStorage","defaultClientBundleZipsStorage","defaultServerPort","defaultMongoStringUnauthenticated","apiRoute","enableClientDistAutoUpdateKey","ENABLE_EXPERIMENTAL_WHITELIST_SETTINGS","OVERRIDE_LOGIN_REQUIRED","OVERRIDE_REGISTRATION_ENABLED","DEFAULT_USERNAME_MINLEN","DEFAULT_PASSWORD_MINLEN","OVERRIDE_JWT_SECRET","OVERRIDE_JWT_EXPIRES_IN","DEFAULT_JWT_EXPIRES_IN","DEFAULT_REFRESH_TOKEN_ATTEMPTS","DEFAULT_REFRESH_TOKEN_EXPIRY","OVERRIDE_JWT_ISSUER","DEFAULT_JWT_ISSUER","OVERRIDE_JWT_AUDIENCE","DEFAULT_JWT_AUDIENCE","OVERRIDE_IS_DEMO_MODE","OVERRIDE_DEMO_USERNAME","DEFAULT_DEMO_USERNAME","OVERRIDE_DEMO_PASSWORD","DEFAULT_DEMO_PASSWORD","OVERRIDE_DEMO_ROLE","DEFAULT_DEMO_ROLE","defaultDevelopmentEnv","defaultTestEnv","defaultProductionEnv","knownEnvNames","GITHUB_PAT","serverPackageName","clientPackageName","clientRepoName","serverRepoName","orgName","currentWizardVersion","defaultClientMinimum","influxUrl","influxToken","influxOrg","influxBucket","defaultWebsocketHandshakeTimeout","defaultSocketThrottleRate","debugSocketStatesKey","defaultDebugSocketStates","enableMqttAutoDiscoveryToken","enableMqttAutoDiscoveryDefault","mqttUrlToken","mqttPortToken","mqttPortDefault","mqttUsernameToken","mqttPasswordToken","monsterPiFilePath","sentryCustomDsnToken","sentryCustomDsnDefault","debugRoutesKey","enableExperimentalTypeormKey","enableExperimentalTypeormDefault"],"mappings":";;;;+BAAaA;;;eAAAA;;;AAAN,MAAMA,eAAe;IAC1BC,kBAAkB;IAClBC,cAAc;IACdC,aAAa;IACbC,iBAAiB;IACjBC,WAAW;IACXC,eAAe;IACfC,eAAe;IAEfC,gBAAgB;IAChBC,YAAY;IAEZ,gCAAgC;IAChCC,0BAA0B;IAC1BC,mBAAmB;IACnBC,sBAAsB;IACtB,yCAAyC;IACzCC,4BAA4B;IAC5BC,gCAAgC;IAChCC,mBAAmB;IACnBC,mCAAmC;IACnCC,UAAU;IACVC,+BAA+B;IAE/B,qFAAqF;IACrFC,wCAAwC;IACxC,gDAAgD;IAChDC,yBAAyB;IACzB,gDAAgD;IAChDC,+BAA+B;IAC/B,SAAS;IACTC,yBAAyB;IACzB,SAAS;IACTC,yBAAyB;IACzB,2BAA2B;IAC3BC,qBAAqB;IACrB,oCAAoC;IACpCC,yBAAyB;IACzBC,wBAAwB,KAAK;IAC7B,SAAS;IACTC,gCAAgC,CAAC;IACjC,wBAAwB;IACxBC,8BAA8B,KAAK,KAAK,KAAK;IAC7C,wBAAwB;IACxBC,qBAAqB;IACrBC,oBAAoB;IACpB,wBAAwB;IACxBC,uBAAuB;IACvBC,sBAAsB;IAEtBC,uBAAuB;IACvBC,wBAAwB;IACxBC,uBAAuB;IACvBC,wBAAwB;IACxBC,uBAAuB;IACvBC,oBAAoB;IACpBC,mBAAmB;IAEnBC,uBAAuB;IACvBC,gBAAgB;IAChBC,sBAAsB;IACtBC,eAAe;QAAC;QAAe;QAAc;KAAO;IACpDC,YAAY;IACZC,mBAAmB;IACnBC,mBAAmB;IACnBC,gBAAgB;IAChBC,gBAAgB;IAChBC,SAAS;IACT,6DAA6D;IAC7DC,sBAAsB;IACtBC,sBAAsB;IAEtBC,WAAW;IACXC,aAAa;IACbC,WAAW;IACXC,cAAc;IAEd,mBAAmB;IACnBC,kCAAkC;IAClCC,2BAA2B;IAC3BC,sBAAsB;IACtBC,0BAA0B;IAE1B,8BAA8B;IAC9BC,8BAA8B;IAC9BC,gCAAgC;IAChCC,cAAc;IACdC,eAAe;IACfC,iBAAiB;IACjBC,mBAAmB;IACnBC,mBAAmB;IAEnB,YAAY;IACZC,mBAAmB;IAEnB,SAAS;IACTC,sBAAsB;IACtBC,wBAAwB;IAExBC,gBAAgB;IAEhBC,8BAA8B;IAC9BC,kCAAkC;AACpC"}
1
+ {"version":3,"sources":["../src/server.constants.ts"],"names":["AppConstants","NON_NPM_MODE_KEY","NODE_ENV_KEY","VERSION_KEY","SERVER_PORT_KEY","MONGO_KEY","DATABASE_PATH","DATABASE_FILE","pm2ServiceName","logAppName","defaultFileStorageFolder","defaultLogsFolder","defaultLogZipsFolder","defaultClientBundleStorage","defaultClientBundleZipsStorage","defaultServerPort","defaultMongoStringUnauthenticated","apiRoute","enableClientDistAutoUpdateKey","ENABLE_EXPERIMENTAL_WHITELIST_SETTINGS","OVERRIDE_LOGIN_REQUIRED","OVERRIDE_REGISTRATION_ENABLED","DEFAULT_USERNAME_MINLEN","DEFAULT_PASSWORD_MINLEN","OVERRIDE_JWT_SECRET","OVERRIDE_JWT_EXPIRES_IN","DEFAULT_JWT_EXPIRES_IN","DEFAULT_REFRESH_TOKEN_ATTEMPTS","DEFAULT_REFRESH_TOKEN_EXPIRY","OVERRIDE_JWT_ISSUER","DEFAULT_JWT_ISSUER","OVERRIDE_JWT_AUDIENCE","DEFAULT_JWT_AUDIENCE","OVERRIDE_IS_DEMO_MODE","OVERRIDE_DEMO_USERNAME","DEFAULT_DEMO_USERNAME","OVERRIDE_DEMO_PASSWORD","DEFAULT_DEMO_PASSWORD","OVERRIDE_DEMO_ROLE","DEFAULT_DEMO_ROLE","defaultDevelopmentEnv","defaultTestEnv","defaultProductionEnv","knownEnvNames","GITHUB_PAT","serverPackageName","clientPackageName","clientRepoName","serverRepoName","orgName","currentWizardVersion","defaultClientMinimum","influxUrl","influxToken","influxOrg","influxBucket","defaultWebsocketHandshakeTimeout","defaultSocketThrottleRate","debugSocketStatesKey","defaultDebugSocketStates","enableMqttAutoDiscoveryToken","enableMqttAutoDiscoveryDefault","mqttUrlToken","mqttPortToken","mqttPortDefault","mqttUsernameToken","mqttPasswordToken","monsterPiFilePath","sentryCustomDsnToken","sentryCustomDsnDefault","debugRoutesKey","enableExperimentalTypeormKey","enableExperimentalTypeormDefault"],"mappings":";;;;+BAAaA;;;eAAAA;;;AAAN,MAAMA,eAAe;IAC1BC,kBAAkB;IAClBC,cAAc;IACdC,aAAa;IACbC,iBAAiB;IACjBC,WAAW;IACXC,eAAe;IACfC,eAAe;IAEfC,gBAAgB;IAChBC,YAAY;IAGZC,0BAA0B;IAC1BC,mBAAmB;IACnBC,sBAAsB;IAEtBC,4BAA4B;IAC5BC,gCAAgC;IAChCC,mBAAmB;IACnBC,mCAAmC;IACnCC,UAAU;IACVC,+BAA+B;IAG/BC,wCAAwC;IAExCC,yBAAyB;IAEzBC,+BAA+B;IAE/BC,yBAAyB;IAEzBC,yBAAyB;IAEzBC,qBAAqB;IAErBC,yBAAyB;IACzBC,wBAAwB,KAAK;IAE7BC,gCAAgC,CAAC;IAEjCC,8BAA8B,KAAK,KAAK,KAAK;IAE7CC,qBAAqB;IACrBC,oBAAoB;IAEpBC,uBAAuB;IACvBC,sBAAsB;IAEtBC,uBAAuB;IACvBC,wBAAwB;IACxBC,uBAAuB;IACvBC,wBAAwB;IACxBC,uBAAuB;IACvBC,oBAAoB;IACpBC,mBAAmB;IAEnBC,uBAAuB;IACvBC,gBAAgB;IAChBC,sBAAsB;IACtBC,eAAe;QAAC;QAAe;QAAc;KAAO;IACpDC,YAAY;IACZC,mBAAmB;IACnBC,mBAAmB;IACnBC,gBAAgB;IAChBC,gBAAgB;IAChBC,SAAS;IAETC,sBAAsB;IACtBC,sBAAsB;IAEtBC,WAAW;IACXC,aAAa;IACbC,WAAW;IACXC,cAAc;IAGdC,kCAAkC;IAClCC,2BAA2B;IAC3BC,sBAAsB;IACtBC,0BAA0B;IAG1BC,8BAA8B;IAC9BC,gCAAgC;IAChCC,cAAc;IACdC,eAAe;IACfC,iBAAiB;IACjBC,mBAAmB;IACnBC,mBAAmB;IAGnBC,mBAAmB;IAGnBC,sBAAsB;IACtBC,wBAAwB;IAExBC,gBAAgB;IAEhBC,8BAA8B;IAC9BC,kCAAkC;AACpC"}
@@ -8,11 +8,11 @@ Object.defineProperty(exports, "setupServer", {
8
8
  return setupServer;
9
9
  }
10
10
  });
11
- const _express = /*#__PURE__*/ _interop_require_wildcard(require("express"));
12
- const _cookieparser = /*#__PURE__*/ _interop_require_default(require("cookie-parser"));
13
- const _passport = /*#__PURE__*/ _interop_require_default(require("passport"));
14
- const _cors = /*#__PURE__*/ _interop_require_default(require("cors"));
15
- const _helmet = /*#__PURE__*/ _interop_require_default(require("helmet"));
11
+ const _express = _interop_require_wildcard(require("express"));
12
+ const _cookieparser = _interop_require_default(require("cookie-parser"));
13
+ const _passport = _interop_require_default(require("passport"));
14
+ const _cors = _interop_require_default(require("cors"));
15
+ const _helmet = _interop_require_default(require("helmet"));
16
16
  const _awilixexpress = require("awilix-express");
17
17
  const _container = require("./container");
18
18
  const _database = require("./middleware/database");
@@ -82,8 +82,7 @@ async function setupServer() {
82
82
  "anonymous"
83
83
  ], {
84
84
  session: false
85
- })).use((0, _awilixexpress.scopePerRequest)(container)).use(_database.interceptDatabaseError)// Global guards
86
- .use(_globalmiddleware.validateWhitelistedIp).use(_globalmiddleware.validateWizardCompleted).use(_globalmiddleware.interceptRoles);
85
+ })).use((0, _awilixexpress.scopePerRequest)(container)).use(_database.interceptDatabaseError).use(_globalmiddleware.validateWhitelistedIp).use(_globalmiddleware.validateWizardCompleted).use(_globalmiddleware.interceptRoles);
87
86
  return {
88
87
  httpServer,
89
88
  container
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/server.core.ts"],"names":["setupServer","httpServer","express","container","configureContainer","initializePassportStrategies","passport","use","cors","origin","methods","helmet","contentSecurityPolicy","json","limit","cookieParser","urlencoded","extended","initialize","authenticate","session","scopePerRequest","interceptDatabaseError","validateWhitelistedIp","validateWizardCompleted","interceptRoles"],"mappings":";;;;+BAWsBA;;;eAAAA;;;iEAXoB;qEACjB;iEACJ;6DACJ;+DACE;+BACa;2BACG;0BACI;kCACwC;2BAClC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtC,eAAeA;IACpB,MAAMC,aAAaC,IAAAA,gBAAO;IAC1B,MAAMC,YAAYC,IAAAA,6BAAkB;IACpCC,IAAAA,uCAA4B,EAACC,iBAAQ,EAAEH;IAEvCF,WACGM,GAAG,CACFC,IAAAA,aAAI,EAAC;QACHC,QAAQ;QACRC,SAAS;IACX,IAEDH,GAAG,CACFI,IAAAA,eAAM,EAAC;QACLC,uBAAuB;IACzB,IAEDL,GAAG,CAACM,IAAAA,aAAI,EAAC;QAAEC,OAAO;IAAO,IACzBP,GAAG,CAACQ,IAAAA,qBAAY,KAChBR,GAAG,CAACS,IAAAA,mBAAU,EAAC;QAAEC,UAAU;IAAM,IACjCV,GAAG,CAACD,iBAAQ,CAACY,UAAU,IACvBX,GAAG,CAACD,iBAAQ,CAACa,YAAY,CAAC;QAAC;QAAO;KAAY,EAAE;QAAEC,SAAS;IAAM,IACjEb,GAAG,CAACc,IAAAA,8BAAe,EAAClB,YACpBI,GAAG,CAACe,gCAAsB,CAC3B,gBAAgB;KACff,GAAG,CAACgB,uCAAqB,EACzBhB,GAAG,CAACiB,yCAAuB,EAC3BjB,GAAG,CAACkB,gCAAc;IAErB,OAAO;QACLxB;QACAE;IACF;AACF"}
1
+ {"version":3,"sources":["../src/server.core.ts"],"names":["setupServer","httpServer","express","container","configureContainer","initializePassportStrategies","passport","use","cors","origin","methods","helmet","contentSecurityPolicy","json","limit","cookieParser","urlencoded","extended","initialize","authenticate","session","scopePerRequest","interceptDatabaseError","validateWhitelistedIp","validateWizardCompleted","interceptRoles"],"mappings":";;;;+BAWsBA;;;eAAAA;;;mDAXoB;uDACjB;mDACJ;+CACJ;iDACE;+BACa;2BACG;0BACI;kCACwC;2BAClC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtC,eAAeA;IACpB,MAAMC,aAAaC,IAAAA,gBAAO;IAC1B,MAAMC,YAAYC,IAAAA,6BAAkB;IACpCC,IAAAA,uCAA4B,EAACC,iBAAQ,EAAEH;IAEvCF,WACGM,GAAG,CACFC,IAAAA,aAAI,EAAC;QACHC,QAAQ;QACRC,SAAS;IACX,IAEDH,GAAG,CACFI,IAAAA,eAAM,EAAC;QACLC,uBAAuB;IACzB,IAEDL,GAAG,CAACM,IAAAA,aAAI,EAAC;QAAEC,OAAO;IAAO,IACzBP,GAAG,CAACQ,IAAAA,qBAAY,KAChBR,GAAG,CAACS,IAAAA,mBAAU,EAAC;QAAEC,UAAU;IAAM,IACjCV,GAAG,CAACD,iBAAQ,CAACY,UAAU,IACvBX,GAAG,CAACD,iBAAQ,CAACa,YAAY,CAAC;QAAC;QAAO;KAAY,EAAE;QAAEC,SAAS;IAAM,IACjEb,GAAG,CAACc,IAAAA,8BAAe,EAAClB,YACpBI,GAAG,CAACe,gCAAsB,EAE1Bf,GAAG,CAACgB,uCAAqB,EACzBhB,GAAG,CAACiB,yCAAuB,EAC3BjB,GAAG,CAACkB,gCAAc;IAErB,OAAO;QACLxB;QACAE;IACF;AACF"}
@@ -37,7 +37,7 @@ _export(exports, {
37
37
  const _migratemongo = require("migrate-mongo");
38
38
  const _path = require("path");
39
39
  const _child_process = require("child_process");
40
- const _node = /*#__PURE__*/ _interop_require_wildcard(require("@sentry/node"));
40
+ const _node = _interop_require_wildcard(require("@sentry/node"));
41
41
  const _dotenv = require("dotenv");
42
42
  const _serverconstants = require("./server.constants");
43
43
  const _logger = require("./handlers/logger");
@@ -86,7 +86,6 @@ function _interop_require_wildcard(obj, nodeInterop) {
86
86
  return newObj;
87
87
  }
88
88
  const logger = new _logger.LoggerService("FDM-Environment", false);
89
- // Constants and definition
90
89
  const instructionsReferralURL = "https://docs.fdm-monster.net";
91
90
  const packageJsonPath = (0, _path.join)((0, _fsutils.superRootPath)(), "./package.json");
92
91
  const dotEnvPath = (0, _path.join)((0, _fsutils.superRootPath)(), "./.env");
@@ -96,10 +95,7 @@ function isEnvTest() {
96
95
  function isEnvProd() {
97
96
  return process.env[_serverconstants.AppConstants.NODE_ENV_KEY] === _serverconstants.AppConstants.defaultProductionEnv;
98
97
  }
99
- /**
100
- * Set and write the environment name to file, if applicable
101
-
102
- */ function ensureNodeEnvSet() {
98
+ function ensureNodeEnvSet() {
103
99
  const environment = process.env[_serverconstants.AppConstants.NODE_ENV_KEY];
104
100
  if (!environment || !_serverconstants.AppConstants.knownEnvNames.includes(environment)) {
105
101
  const newEnvName = _serverconstants.AppConstants.defaultProductionEnv;
@@ -109,9 +105,7 @@ function isEnvProd() {
109
105
  logger.log(`✓ NODE_ENV variable correctly set (${environment})!`);
110
106
  }
111
107
  }
112
- /**
113
- * Ensures that `process.env[AppConstants.VERSION_KEY]` is never undefined
114
- */ function ensureEnvNpmVersionSet() {
108
+ function ensureEnvNpmVersionSet() {
115
109
  const packageJsonVersion = require(packageJsonPath).version;
116
110
  if (!process.env[_serverconstants.AppConstants.VERSION_KEY]) {
117
111
  process.env[_serverconstants.AppConstants.VERSION_KEY] = packageJsonVersion;
@@ -133,15 +127,12 @@ function setupPackageJsonVersionOrThrow() {
133
127
  const result = (0, _envutils.verifyPackageJsonRequirements)((0, _fsutils.superRootPath)());
134
128
  if (!result) {
135
129
  if ((0, _envutils.isPm2)()) {
136
- // TODO test this works under docker as well
137
130
  removePm2Service("didnt pass startup validation (package.json)");
138
131
  }
139
132
  throw new Error(`Aborting server.`);
140
133
  }
141
134
  }
142
- /**
143
- * Print out instructions URL
144
- */ function printInstructionsURL() {
135
+ function printInstructionsURL() {
145
136
  logger.log(`Please make sure to read ${instructionsReferralURL} for more information.`);
146
137
  }
147
138
  function fetchMongoDBConnectionString() {
@@ -155,7 +146,6 @@ function fetchMongoDBConnectionString() {
155
146
  function fetchServerPort() {
156
147
  let port = process.env[_serverconstants.AppConstants.SERVER_PORT_KEY];
157
148
  if (Number.isNaN(parseInt(port))) {
158
- // Update config immediately
159
149
  process.env[_serverconstants.AppConstants.SERVER_PORT_KEY] = _serverconstants.AppConstants.defaultServerPort.toString();
160
150
  port = process.env[_serverconstants.AppConstants.SERVER_PORT_KEY];
161
151
  }
@@ -181,7 +171,6 @@ function setupSentry() {
181
171
  process.on("unhandledRejection", (e)=>{
182
172
  const message = `Unhandled rejection error - ${(0, _errorutils.errorSummary)(e)}`;
183
173
  logger.error(message);
184
- // The server must not crash
185
174
  _node.captureException(e);
186
175
  });
187
176
  }
@@ -195,7 +184,6 @@ function ensurePortSet() {
195
184
  }
196
185
  function setupEnvConfig(skipDotEnv = false) {
197
186
  if (!skipDotEnv) {
198
- // This needs to be CWD of app.js, so be careful not to move this call.
199
187
  (0, _dotenv.config)({
200
188
  path: dotEnvPath
201
189
  });