90dc-core 1.19.4 → 1.19.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (299) hide show
  1. package/dist/index.js +43 -0
  2. package/dist/index.js.map +1 -0
  3. package/dist/lib/Errors/AppError.js +104 -0
  4. package/dist/lib/Errors/AppError.js.map +1 -0
  5. package/dist/lib/Errors/Errors.js +42 -0
  6. package/dist/lib/Errors/Errors.js.map +1 -0
  7. package/dist/lib/classes/Database.js +154 -0
  8. package/dist/lib/classes/Database.js.map +1 -0
  9. package/dist/lib/classes/Redis.js +63 -0
  10. package/dist/lib/classes/Redis.js.map +1 -0
  11. package/dist/lib/clients/EmailClient.js +188 -0
  12. package/dist/lib/clients/EmailClient.js.map +1 -0
  13. package/dist/lib/clients/FirebasePushNotificationClient.js +688 -0
  14. package/dist/lib/clients/FirebasePushNotificationClient.js.map +1 -0
  15. package/dist/lib/clients/ImagesClient.d.ts +2 -1
  16. package/dist/lib/clients/ImagesClient.d.ts.map +1 -1
  17. package/dist/lib/clients/ImagesClient.js +436 -0
  18. package/dist/lib/clients/ImagesClient.js.map +1 -0
  19. package/dist/lib/clients/MailingClient.js +84 -0
  20. package/dist/lib/clients/MailingClient.js.map +1 -0
  21. package/dist/lib/clients/PushNotificationClient.js +478 -0
  22. package/dist/lib/clients/PushNotificationClient.js.map +1 -0
  23. package/dist/lib/clients/types/email.types.js +3 -0
  24. package/dist/lib/clients/types/email.types.js.map +1 -0
  25. package/dist/lib/clients/types/images.types.js +3 -0
  26. package/dist/lib/clients/types/images.types.js.map +1 -0
  27. package/dist/lib/clients/types/mailing.types.js +3 -0
  28. package/dist/lib/clients/types/mailing.types.js.map +1 -0
  29. package/dist/lib/config/ConfigValidator.js +162 -0
  30. package/dist/lib/config/ConfigValidator.js.map +1 -0
  31. package/dist/lib/controllers/BaseController.js +64 -0
  32. package/dist/lib/controllers/BaseController.js.map +1 -0
  33. package/dist/lib/db/migrations/20260330000000-create-user-progress-photos.js +60 -0
  34. package/dist/lib/db/migrations/20260330000000-create-user-progress-photos.js.map +1 -0
  35. package/dist/lib/dbmodels/coaching/Answer.js +51 -0
  36. package/dist/lib/dbmodels/coaching/Answer.js.map +1 -0
  37. package/dist/lib/dbmodels/coaching/ClientNote.js +75 -0
  38. package/dist/lib/dbmodels/coaching/ClientNote.js.map +1 -0
  39. package/dist/lib/dbmodels/coaching/ClientTag.js +45 -0
  40. package/dist/lib/dbmodels/coaching/ClientTag.js.map +1 -0
  41. package/dist/lib/dbmodels/coaching/Question.js +60 -0
  42. package/dist/lib/dbmodels/coaching/Question.js.map +1 -0
  43. package/dist/lib/dbmodels/coaching/Questionnaire.js +39 -0
  44. package/dist/lib/dbmodels/coaching/Questionnaire.js.map +1 -0
  45. package/dist/lib/dbmodels/coaching/QuestionnaireResponse.js +42 -0
  46. package/dist/lib/dbmodels/coaching/QuestionnaireResponse.js.map +1 -0
  47. package/dist/lib/dbmodels/coaching/WeeklyCheckIn.js +69 -0
  48. package/dist/lib/dbmodels/coaching/WeeklyCheckIn.js.map +1 -0
  49. package/dist/lib/dbmodels/coaching/WeightRecord.js +49 -0
  50. package/dist/lib/dbmodels/coaching/WeightRecord.js.map +1 -0
  51. package/dist/lib/dbmodels/diet/DietDay.js +50 -0
  52. package/dist/lib/dbmodels/diet/DietDay.js.map +1 -0
  53. package/dist/lib/dbmodels/diet/DietMeal.js +74 -0
  54. package/dist/lib/dbmodels/diet/DietMeal.js.map +1 -0
  55. package/dist/lib/dbmodels/diet/DietMealCompletion.js +69 -0
  56. package/dist/lib/dbmodels/diet/DietMealCompletion.js.map +1 -0
  57. package/dist/lib/dbmodels/diet/DietMealRecipe.js +67 -0
  58. package/dist/lib/dbmodels/diet/DietMealRecipe.js.map +1 -0
  59. package/dist/lib/dbmodels/diet/DietMealRecipeIngredient.js +46 -0
  60. package/dist/lib/dbmodels/diet/DietMealRecipeIngredient.js.map +1 -0
  61. package/dist/lib/dbmodels/diet/DietProgram.js +98 -0
  62. package/dist/lib/dbmodels/diet/DietProgram.js.map +1 -0
  63. package/dist/lib/dbmodels/diet/Ingredient.js +88 -0
  64. package/dist/lib/dbmodels/diet/Ingredient.js.map +1 -0
  65. package/dist/lib/dbmodels/diet/IngredientTag.js +64 -0
  66. package/dist/lib/dbmodels/diet/IngredientTag.js.map +1 -0
  67. package/dist/lib/dbmodels/diet/IngredientTags.js +29 -0
  68. package/dist/lib/dbmodels/diet/IngredientTags.js.map +1 -0
  69. package/dist/lib/dbmodels/diet/Recipe.js +173 -0
  70. package/dist/lib/dbmodels/diet/Recipe.js.map +1 -0
  71. package/dist/lib/dbmodels/diet/RecipeIngredient.js +78 -0
  72. package/dist/lib/dbmodels/diet/RecipeIngredient.js.map +1 -0
  73. package/dist/lib/dbmodels/diet/RecipeTag.js +44 -0
  74. package/dist/lib/dbmodels/diet/RecipeTag.js.map +1 -0
  75. package/dist/lib/dbmodels/diet/RecipeTags.js +24 -0
  76. package/dist/lib/dbmodels/diet/RecipeTags.js.map +1 -0
  77. package/dist/lib/dbmodels/diet/ShoppingList.js +69 -0
  78. package/dist/lib/dbmodels/diet/ShoppingList.js.map +1 -0
  79. package/dist/lib/dbmodels/diet/ShoppingListItem.js +66 -0
  80. package/dist/lib/dbmodels/diet/ShoppingListItem.js.map +1 -0
  81. package/dist/lib/dbmodels/diet/TranslatedRecipe.js +122 -0
  82. package/dist/lib/dbmodels/diet/TranslatedRecipe.js.map +1 -0
  83. package/dist/lib/dbmodels/diet/TranslatedRecipeTag.js +47 -0
  84. package/dist/lib/dbmodels/diet/TranslatedRecipeTag.js.map +1 -0
  85. package/dist/lib/dbmodels/diet/TranslatedRecipeTags.js +24 -0
  86. package/dist/lib/dbmodels/diet/TranslatedRecipeTags.js.map +1 -0
  87. package/dist/lib/dbmodels/diet/UserDietPreferences.js +85 -0
  88. package/dist/lib/dbmodels/diet/UserDietPreferences.js.map +1 -0
  89. package/dist/lib/dbmodels/gamification/Badge.js +62 -0
  90. package/dist/lib/dbmodels/gamification/Badge.js.map +1 -0
  91. package/dist/lib/dbmodels/gamification/StreaksLog.js +37 -0
  92. package/dist/lib/dbmodels/gamification/StreaksLog.js.map +1 -0
  93. package/dist/lib/dbmodels/gamification/TranslatedBadge.js +45 -0
  94. package/dist/lib/dbmodels/gamification/TranslatedBadge.js.map +1 -0
  95. package/dist/lib/dbmodels/gamification/xpAndLeaderboards/UserRankHistory.js +48 -0
  96. package/dist/lib/dbmodels/gamification/xpAndLeaderboards/UserRankHistory.js.map +1 -0
  97. package/dist/lib/dbmodels/gamification/xpAndLeaderboards/XpEvent.js +53 -0
  98. package/dist/lib/dbmodels/gamification/xpAndLeaderboards/XpEvent.js.map +1 -0
  99. package/dist/lib/dbmodels/gamification/xpAndLeaderboards/XpTransaction.js +68 -0
  100. package/dist/lib/dbmodels/gamification/xpAndLeaderboards/XpTransaction.js.map +1 -0
  101. package/dist/lib/dbmodels/index.js +288 -0
  102. package/dist/lib/dbmodels/index.js.map +1 -0
  103. package/dist/lib/dbmodels/nonconsprogram/NonConsumableProgram.d.ts +32 -0
  104. package/dist/lib/dbmodels/nonconsprogram/NonConsumableProgram.d.ts.map +1 -0
  105. package/dist/lib/dbmodels/nonconsprogram/NonConsumableProgram.js +155 -0
  106. package/dist/lib/dbmodels/nonconsprogram/NonConsumableProgram.js.map +1 -0
  107. package/dist/lib/dbmodels/nonconsprogram/NonConsumableProgramWebContent.d.ts +22 -0
  108. package/dist/lib/dbmodels/nonconsprogram/NonConsumableProgramWebContent.d.ts.map +1 -0
  109. package/dist/lib/dbmodels/nonconsprogram/NonConsumableProgramWebContent.js +108 -0
  110. package/dist/lib/dbmodels/nonconsprogram/NonConsumableProgramWebContent.js.map +1 -0
  111. package/dist/lib/dbmodels/nonconsprogram/TranslatedConsumableProgram.d.ts +20 -0
  112. package/dist/lib/dbmodels/nonconsprogram/TranslatedConsumableProgram.d.ts.map +1 -0
  113. package/dist/lib/dbmodels/nonconsprogram/TranslatedConsumableProgram.js +97 -0
  114. package/dist/lib/dbmodels/nonconsprogram/TranslatedConsumableProgram.js.map +1 -0
  115. package/dist/lib/dbmodels/nonconsprogram/TranslatedNonConsumableProgramWebContent.d.ts +22 -0
  116. package/dist/lib/dbmodels/nonconsprogram/TranslatedNonConsumableProgramWebContent.d.ts.map +1 -0
  117. package/dist/lib/dbmodels/nonconsprogram/TranslatedNonConsumableProgramWebContent.js +115 -0
  118. package/dist/lib/dbmodels/nonconsprogram/TranslatedNonConsumableProgramWebContent.js.map +1 -0
  119. package/dist/lib/dbmodels/nonconsprogram/UserNonConsumableProgram.d.ts +7 -0
  120. package/dist/lib/dbmodels/nonconsprogram/UserNonConsumableProgram.d.ts.map +1 -0
  121. package/dist/lib/dbmodels/nonconsprogram/UserNonConsumableProgram.js +41 -0
  122. package/dist/lib/dbmodels/nonconsprogram/UserNonConsumableProgram.js.map +1 -0
  123. package/dist/lib/dbmodels/notifications/NotificationModels.js +38 -0
  124. package/dist/lib/dbmodels/notifications/NotificationModels.js.map +1 -0
  125. package/dist/lib/dbmodels/notifications/TranslatedNotification.js +45 -0
  126. package/dist/lib/dbmodels/notifications/TranslatedNotification.js.map +1 -0
  127. package/dist/lib/dbmodels/program/Challenge.d.ts +13 -0
  128. package/dist/lib/dbmodels/program/Challenge.d.ts.map +1 -0
  129. package/dist/lib/dbmodels/program/Challenge.js +63 -0
  130. package/dist/lib/dbmodels/program/Challenge.js.map +1 -0
  131. package/dist/lib/dbmodels/program/ChallengeBlueprint.js +75 -0
  132. package/dist/lib/dbmodels/program/ChallengeBlueprint.js.map +1 -0
  133. package/dist/lib/dbmodels/program/CircularProgramDraft.js +82 -0
  134. package/dist/lib/dbmodels/program/CircularProgramDraft.js.map +1 -0
  135. package/dist/lib/dbmodels/program/CoachExerciseNote.js +61 -0
  136. package/dist/lib/dbmodels/program/CoachExerciseNote.js.map +1 -0
  137. package/dist/lib/dbmodels/program/CustomProgramBlueprint.js +84 -0
  138. package/dist/lib/dbmodels/program/CustomProgramBlueprint.js.map +1 -0
  139. package/dist/lib/dbmodels/program/CustomStrengthTest.js +55 -0
  140. package/dist/lib/dbmodels/program/CustomStrengthTest.js.map +1 -0
  141. package/dist/lib/dbmodels/program/CustomStrengthTestExercises.js +69 -0
  142. package/dist/lib/dbmodels/program/CustomStrengthTestExercises.js.map +1 -0
  143. package/dist/lib/dbmodels/program/CustomWorkoutBlueprint.js +58 -0
  144. package/dist/lib/dbmodels/program/CustomWorkoutBlueprint.js.map +1 -0
  145. package/dist/lib/dbmodels/program/Exercise.d.ts +23 -0
  146. package/dist/lib/dbmodels/program/Exercise.d.ts.map +1 -0
  147. package/dist/lib/dbmodels/program/Exercise.js +101 -0
  148. package/dist/lib/dbmodels/program/Exercise.js.map +1 -0
  149. package/dist/lib/dbmodels/program/ExerciseModels.d.ts +28 -0
  150. package/dist/lib/dbmodels/program/ExerciseModels.d.ts.map +1 -0
  151. package/dist/lib/dbmodels/program/ExerciseModels.js +149 -0
  152. package/dist/lib/dbmodels/program/ExerciseModels.js.map +1 -0
  153. package/dist/lib/dbmodels/program/Program.d.ts +15 -0
  154. package/dist/lib/dbmodels/program/Program.d.ts.map +1 -0
  155. package/dist/lib/dbmodels/program/Program.js +76 -0
  156. package/dist/lib/dbmodels/program/Program.js.map +1 -0
  157. package/dist/lib/dbmodels/program/ProgressEntry.d.ts +26 -0
  158. package/dist/lib/dbmodels/program/ProgressEntry.d.ts.map +1 -0
  159. package/dist/lib/dbmodels/program/ProgressEntry.js +77 -0
  160. package/dist/lib/dbmodels/program/ProgressEntry.js.map +1 -0
  161. package/dist/lib/dbmodels/program/RestDay.js +33 -0
  162. package/dist/lib/dbmodels/program/RestDay.js.map +1 -0
  163. package/dist/lib/dbmodels/program/StrengthTest.d.ts +10 -0
  164. package/dist/lib/dbmodels/program/StrengthTest.d.ts.map +1 -0
  165. package/dist/lib/dbmodels/program/StrengthTest.js +39 -0
  166. package/dist/lib/dbmodels/program/StrengthTest.js.map +1 -0
  167. package/dist/lib/dbmodels/program/StrengthTestExercise.d.ts +15 -0
  168. package/dist/lib/dbmodels/program/StrengthTestExercise.d.ts.map +1 -0
  169. package/dist/lib/dbmodels/program/StrengthTestExercise.js +72 -0
  170. package/dist/lib/dbmodels/program/StrengthTestExercise.js.map +1 -0
  171. package/dist/lib/dbmodels/program/StrengthTestSession.js +73 -0
  172. package/dist/lib/dbmodels/program/StrengthTestSession.js.map +1 -0
  173. package/dist/lib/dbmodels/program/Superset.d.ts +13 -0
  174. package/dist/lib/dbmodels/program/Superset.d.ts.map +1 -0
  175. package/dist/lib/dbmodels/program/Superset.js +46 -0
  176. package/dist/lib/dbmodels/program/Superset.js.map +1 -0
  177. package/dist/lib/dbmodels/program/ThirtyDayChallenge.js +70 -0
  178. package/dist/lib/dbmodels/program/ThirtyDayChallenge.js.map +1 -0
  179. package/dist/lib/dbmodels/program/ThirtyDayChallengeStrengthTest.js +55 -0
  180. package/dist/lib/dbmodels/program/ThirtyDayChallengeStrengthTest.js.map +1 -0
  181. package/dist/lib/dbmodels/program/TranslatedChallenge.d.ts +15 -0
  182. package/dist/lib/dbmodels/program/TranslatedChallenge.d.ts.map +1 -0
  183. package/dist/lib/dbmodels/program/TranslatedChallenge.js +69 -0
  184. package/dist/lib/dbmodels/program/TranslatedChallenge.js.map +1 -0
  185. package/dist/lib/dbmodels/program/TranslatedExerciseModel.d.ts +25 -0
  186. package/dist/lib/dbmodels/program/TranslatedExerciseModel.d.ts.map +1 -0
  187. package/dist/lib/dbmodels/program/TranslatedExerciseModel.js +123 -0
  188. package/dist/lib/dbmodels/program/TranslatedExerciseModel.js.map +1 -0
  189. package/dist/lib/dbmodels/program/TranslatedStrengthTest.d.ts +12 -0
  190. package/dist/lib/dbmodels/program/TranslatedStrengthTest.d.ts.map +1 -0
  191. package/dist/lib/dbmodels/program/TranslatedStrengthTest.js +45 -0
  192. package/dist/lib/dbmodels/program/TranslatedStrengthTest.js.map +1 -0
  193. package/dist/lib/dbmodels/program/TranslatedStrengthTestExercise.d.ts +16 -0
  194. package/dist/lib/dbmodels/program/TranslatedStrengthTestExercise.d.ts.map +1 -0
  195. package/dist/lib/dbmodels/program/TranslatedStrengthTestExercise.js +78 -0
  196. package/dist/lib/dbmodels/program/TranslatedStrengthTestExercise.js.map +1 -0
  197. package/dist/lib/dbmodels/program/UserChallenge.d.ts +10 -0
  198. package/dist/lib/dbmodels/program/UserChallenge.d.ts.map +1 -0
  199. package/dist/lib/dbmodels/program/UserChallenge.js +47 -0
  200. package/dist/lib/dbmodels/program/UserChallenge.js.map +1 -0
  201. package/dist/lib/dbmodels/program/UserExerciseNote.js +61 -0
  202. package/dist/lib/dbmodels/program/UserExerciseNote.js.map +1 -0
  203. package/dist/lib/dbmodels/program/UserStrengthTests.d.ts +11 -0
  204. package/dist/lib/dbmodels/program/UserStrengthTests.d.ts.map +1 -0
  205. package/dist/lib/dbmodels/program/UserStrengthTests.js +54 -0
  206. package/dist/lib/dbmodels/program/UserStrengthTests.js.map +1 -0
  207. package/dist/lib/dbmodels/program/Workout.d.ts +14 -0
  208. package/dist/lib/dbmodels/program/Workout.d.ts.map +1 -0
  209. package/dist/lib/dbmodels/program/Workout.js +66 -0
  210. package/dist/lib/dbmodels/program/Workout.js.map +1 -0
  211. package/dist/lib/dbmodels/program/WorkoutCompletion.js +65 -0
  212. package/dist/lib/dbmodels/program/WorkoutCompletion.js.map +1 -0
  213. package/dist/lib/dbmodels/program/WorkoutSession.js +93 -0
  214. package/dist/lib/dbmodels/program/WorkoutSession.js.map +1 -0
  215. package/dist/lib/dbmodels/subscription/Subscription.d.ts +19 -0
  216. package/dist/lib/dbmodels/subscription/Subscription.d.ts.map +1 -0
  217. package/dist/lib/dbmodels/subscription/Subscription.js +91 -0
  218. package/dist/lib/dbmodels/subscription/Subscription.js.map +1 -0
  219. package/dist/lib/dbmodels/subscription/SubscriptionEvent.js +79 -0
  220. package/dist/lib/dbmodels/subscription/SubscriptionEvent.js.map +1 -0
  221. package/dist/lib/dbmodels/subscription/SubscriptionLog.d.ts +9 -0
  222. package/dist/lib/dbmodels/subscription/SubscriptionLog.d.ts.map +1 -0
  223. package/dist/lib/dbmodels/subscription/SubscriptionLog.js +42 -0
  224. package/dist/lib/dbmodels/subscription/SubscriptionLog.js.map +1 -0
  225. package/dist/lib/dbmodels/subscription/SubscriptionRefund.js +92 -0
  226. package/dist/lib/dbmodels/subscription/SubscriptionRefund.js.map +1 -0
  227. package/dist/lib/dbmodels/user/DeviceTokens.js +34 -0
  228. package/dist/lib/dbmodels/user/DeviceTokens.js.map +1 -0
  229. package/dist/lib/dbmodels/user/PersistedUser.d.ts +43 -0
  230. package/dist/lib/dbmodels/user/PersistedUser.d.ts.map +1 -0
  231. package/dist/lib/dbmodels/user/PersistedUser.js +237 -0
  232. package/dist/lib/dbmodels/user/PersistedUser.js.map +1 -0
  233. package/dist/lib/dbmodels/user/UserAddons.js +26 -0
  234. package/dist/lib/dbmodels/user/UserAddons.js.map +1 -0
  235. package/dist/lib/dbmodels/user/UserBadges.js +63 -0
  236. package/dist/lib/dbmodels/user/UserBadges.js.map +1 -0
  237. package/dist/lib/dbmodels/user/UserCoach.js +40 -0
  238. package/dist/lib/dbmodels/user/UserCoach.js.map +1 -0
  239. package/dist/lib/dbmodels/user/UserDiscount.js +24 -0
  240. package/dist/lib/dbmodels/user/UserDiscount.js.map +1 -0
  241. package/dist/lib/dbmodels/user/UserOptions.js +34 -0
  242. package/dist/lib/dbmodels/user/UserOptions.js.map +1 -0
  243. package/dist/lib/dbmodels/user/UserProgressPhoto.js +59 -0
  244. package/dist/lib/dbmodels/user/UserProgressPhoto.js.map +1 -0
  245. package/dist/lib/dbmodels/user/UserStreaks.js +64 -0
  246. package/dist/lib/dbmodels/user/UserStreaks.js.map +1 -0
  247. package/dist/lib/dbmodels/user/UsersFriends.js +46 -0
  248. package/dist/lib/dbmodels/user/UsersFriends.js.map +1 -0
  249. package/dist/lib/enums/ProgramEnums.d.ts +18 -0
  250. package/dist/lib/enums/ProgramEnums.d.ts.map +1 -0
  251. package/dist/lib/enums/ProgramEnums.js +22 -0
  252. package/dist/lib/enums/ProgramEnums.js.map +1 -0
  253. package/dist/lib/enums/ProgramTemplates.js +738 -0
  254. package/dist/lib/enums/ProgramTemplates.js.map +1 -0
  255. package/dist/lib/middlewares/ErrorMiddleware.js +141 -0
  256. package/dist/lib/middlewares/ErrorMiddleware.js.map +1 -0
  257. package/dist/lib/middlewares/ValidationMiddleware.js +24 -0
  258. package/dist/lib/middlewares/ValidationMiddleware.js.map +1 -0
  259. package/dist/lib/models/BlueprintInterfaces.js +3 -0
  260. package/dist/lib/models/BlueprintInterfaces.js.map +1 -0
  261. package/dist/lib/models/ExerciseInterfaces.d.ts +68 -0
  262. package/dist/lib/models/ExerciseInterfaces.d.ts.map +1 -0
  263. package/dist/lib/models/ExerciseInterfaces.js +3 -0
  264. package/dist/lib/models/ExerciseInterfaces.js.map +1 -0
  265. package/dist/lib/models/NotificationInterfaces.js +11 -0
  266. package/dist/lib/models/NotificationInterfaces.js.map +1 -0
  267. package/dist/lib/models/ProgramInterfaces.js +3 -0
  268. package/dist/lib/models/ProgramInterfaces.js.map +1 -0
  269. package/dist/lib/models/UserInterfaces.js +3 -0
  270. package/dist/lib/models/UserInterfaces.js.map +1 -0
  271. package/dist/lib/models/WorkoutInterfaces.js +3 -0
  272. package/dist/lib/models/WorkoutInterfaces.js.map +1 -0
  273. package/dist/lib/scripts/cli.js +82 -0
  274. package/dist/lib/scripts/cli.js.map +1 -0
  275. package/dist/lib/scripts/populate-exercise-thumbnails.js +64 -0
  276. package/dist/lib/scripts/populate-exercise-thumbnails.js.map +1 -0
  277. package/dist/lib/scripts/setup-database.js +43 -0
  278. package/dist/lib/scripts/setup-database.js.map +1 -0
  279. package/dist/lib/scripts/verify-indexes.js +94 -0
  280. package/dist/lib/scripts/verify-indexes.js.map +1 -0
  281. package/dist/lib/testing/testFixtures.js +520 -0
  282. package/dist/lib/testing/testFixtures.js.map +1 -0
  283. package/dist/lib/testing/testHelpers.js +149 -0
  284. package/dist/lib/testing/testHelpers.js.map +1 -0
  285. package/dist/lib/utils/AuthenticationUtil.js +481 -0
  286. package/dist/lib/utils/AuthenticationUtil.js.map +1 -0
  287. package/dist/lib/utils/Logger.js +242 -0
  288. package/dist/lib/utils/Logger.js.map +1 -0
  289. package/dist/lib/utils/NotificationClient.js +371 -0
  290. package/dist/lib/utils/NotificationClient.js.map +1 -0
  291. package/dist/lib/utils/NotificationsUtil.js +95 -0
  292. package/dist/lib/utils/NotificationsUtil.js.map +1 -0
  293. package/dist/lib/utils/SecretManager.js +107 -0
  294. package/dist/lib/utils/SecretManager.js.map +1 -0
  295. package/dist/lib/utils/SentryUtil.js +140 -0
  296. package/dist/lib/utils/SentryUtil.js.map +1 -0
  297. package/dist/lib/utils/imageValidation.js +31 -0
  298. package/dist/lib/utils/imageValidation.js.map +1 -0
  299. package/package.json +1 -1
@@ -0,0 +1,98 @@
1
+ function _ts_decorate(decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ 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;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ }
7
+ import { Column, DataType, Default, ForeignKey, HasMany, Model, PrimaryKey, Table } from "sequelize-typescript";
8
+ import { PersistedUser } from "../user/PersistedUser.js";
9
+ import { DietDay } from "./DietDay.js";
10
+ import { ShoppingList } from "./ShoppingList.js";
11
+ export class DietProgram extends Model {
12
+ }
13
+ _ts_decorate([
14
+ PrimaryKey,
15
+ Default(DataType.UUIDV4),
16
+ Column(DataType.UUID)
17
+ ], DietProgram.prototype, "uuid", void 0);
18
+ _ts_decorate([
19
+ ForeignKey(()=>PersistedUser),
20
+ Column(DataType.UUID)
21
+ ], DietProgram.prototype, "userUuid", void 0);
22
+ _ts_decorate([
23
+ Column({
24
+ type: DataType.DATE,
25
+ allowNull: false
26
+ })
27
+ ], DietProgram.prototype, "startDate", void 0);
28
+ _ts_decorate([
29
+ Column({
30
+ type: DataType.STRING,
31
+ allowNull: true
32
+ })
33
+ ], DietProgram.prototype, "title", void 0);
34
+ _ts_decorate([
35
+ Column({
36
+ type: DataType.INTEGER,
37
+ allowNull: true
38
+ })
39
+ ], DietProgram.prototype, "dailyCalories", void 0);
40
+ _ts_decorate([
41
+ Column({
42
+ type: DataType.FLOAT,
43
+ allowNull: true
44
+ })
45
+ ], DietProgram.prototype, "dailyProtein", void 0);
46
+ _ts_decorate([
47
+ Column({
48
+ type: DataType.FLOAT,
49
+ allowNull: true
50
+ })
51
+ ], DietProgram.prototype, "dailyCarbs", void 0);
52
+ _ts_decorate([
53
+ Column({
54
+ type: DataType.FLOAT,
55
+ allowNull: true
56
+ })
57
+ ], DietProgram.prototype, "dailyFats", void 0);
58
+ _ts_decorate([
59
+ Column({
60
+ type: DataType.INTEGER,
61
+ allowNull: true
62
+ })
63
+ ], DietProgram.prototype, "numberOfDays", void 0);
64
+ _ts_decorate([
65
+ Column({
66
+ type: DataType.ENUM('pending', 'completed', 'failed'),
67
+ allowNull: false,
68
+ defaultValue: 'pending'
69
+ })
70
+ ], DietProgram.prototype, "status", void 0);
71
+ _ts_decorate([
72
+ HasMany(()=>DietDay, {
73
+ foreignKey: "dietProgramUuid",
74
+ onDelete: "CASCADE"
75
+ })
76
+ ], DietProgram.prototype, "days", void 0);
77
+ _ts_decorate([
78
+ HasMany(()=>ShoppingList, {
79
+ foreignKey: "dietProgramUuid",
80
+ onDelete: "CASCADE"
81
+ })
82
+ ], DietProgram.prototype, "shoppingLists", void 0);
83
+ DietProgram = _ts_decorate([
84
+ Table({
85
+ timestamps: true,
86
+ indexes: [
87
+ {
88
+ unique: true,
89
+ fields: [
90
+ "userUuid"
91
+ ],
92
+ name: "unique_user_diet_program"
93
+ }
94
+ ]
95
+ })
96
+ ], DietProgram);
97
+
98
+ //# sourceMappingURL=DietProgram.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/lib/dbmodels/diet/DietProgram.ts"],"sourcesContent":["import {\n Column,\n DataType,\n Default,\n ForeignKey,\n HasMany,\n Model,\n PrimaryKey,\n Table,\n} from \"sequelize-typescript\";\nimport { PersistedUser } from \"../user/PersistedUser.js\";\nimport { DietDay } from \"./DietDay.js\";\nimport { ShoppingList } from \"./ShoppingList.js\";\n\n@Table({\n timestamps: true,\n indexes: [\n {\n unique: true,\n fields: [\"userUuid\"],\n name: \"unique_user_diet_program\",\n },\n ],\n})\nexport class DietProgram extends Model<DietProgram> {\n @PrimaryKey\n @Default(DataType.UUIDV4)\n @Column(DataType.UUID)\n declare uuid: string;\n\n @ForeignKey(() => PersistedUser)\n @Column(DataType.UUID)\n declare userUuid: string;\n\n @Column({ type: DataType.DATE, allowNull: false })\n declare startDate: Date;\n\n @Column({ type: DataType.STRING, allowNull: true })\n declare title: string;\n\n @Column({ type: DataType.INTEGER, allowNull: true })\n declare dailyCalories: number | null;\n\n @Column({ type: DataType.FLOAT, allowNull: true })\n declare dailyProtein: number | null;\n\n @Column({ type: DataType.FLOAT, allowNull: true })\n declare dailyCarbs: number | null;\n\n @Column({ type: DataType.FLOAT, allowNull: true })\n declare dailyFats: number | null;\n\n @Column({ type: DataType.INTEGER, allowNull: true })\n declare numberOfDays: number | null;\n\n @Column({\n type: DataType.ENUM('pending', 'completed', 'failed'),\n allowNull: false,\n defaultValue: 'pending'\n })\n declare status: 'pending' | 'completed' | 'failed';\n\n @HasMany(() => DietDay, {\n foreignKey: \"dietProgramUuid\",\n onDelete: \"CASCADE\",\n })\n declare days: DietDay[];\n\n @HasMany(() => ShoppingList, {\n foreignKey: \"dietProgramUuid\",\n onDelete: \"CASCADE\",\n })\n declare shoppingLists: ShoppingList[];\n}\n"],"names":["Column","DataType","Default","ForeignKey","HasMany","Model","PrimaryKey","Table","PersistedUser","DietDay","ShoppingList","DietProgram","UUIDV4","UUID","type","DATE","allowNull","STRING","INTEGER","FLOAT","ENUM","defaultValue","foreignKey","onDelete","timestamps","indexes","unique","fields","name"],"mappings":";;;;;;AAAA,SACEA,MAAM,EACNC,QAAQ,EACRC,OAAO,EACPC,UAAU,EACVC,OAAO,EACPC,KAAK,EACLC,UAAU,EACVC,KAAK,QACA,uBAAuB;AAC9B,SAASC,aAAa,QAAQ,2BAA2B;AACzD,SAASC,OAAO,QAAQ,eAAe;AACvC,SAASC,YAAY,QAAQ,oBAAoB;AAYjD,OAAO,MAAMC,oBAAoBN;AAiDjC;;;qBA/CoBO;oBACDC;;;mBAGCL;oBACDK;;;;QAGPC,MAAMb,SAASc,IAAI;QAAEC,WAAW;;;;;QAGhCF,MAAMb,SAASgB,MAAM;QAAED,WAAW;;;;;QAGlCF,MAAMb,SAASiB,OAAO;QAAEF,WAAW;;;;;QAGnCF,MAAMb,SAASkB,KAAK;QAAEH,WAAW;;;;;QAGjCF,MAAMb,SAASkB,KAAK;QAAEH,WAAW;;;;;QAGjCF,MAAMb,SAASkB,KAAK;QAAEH,WAAW;;;;;QAGjCF,MAAMb,SAASiB,OAAO;QAAEF,WAAW;;;;;QAI3CF,MAAMb,SAASmB,IAAI,CAAC,WAAW,aAAa;QAC5CJ,WAAW;QACXK,cAAc;;;;gBAIDZ;QACba,YAAY;QACZC,UAAU;;;;gBAIGb;QACbY,YAAY;QACZC,UAAU;;;;;QAvDZC,YAAY;QACZC,SAAS;YACP;gBACEC,QAAQ;gBACRC,QAAQ;oBAAC;iBAAW;gBACpBC,MAAM;YACR;SACD"}
@@ -0,0 +1,88 @@
1
+ function _ts_decorate(decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ 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;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ }
7
+ import { Table, Model, Column, DataType, Default, PrimaryKey, HasMany, BelongsToMany } from "sequelize-typescript";
8
+ import { RecipeIngredient } from "./RecipeIngredient.js";
9
+ import { IngredientTag } from "./IngredientTag.js";
10
+ import { IngredientTags } from "./IngredientTags.js";
11
+ export class Ingredient extends Model {
12
+ }
13
+ _ts_decorate([
14
+ PrimaryKey,
15
+ Default(DataType.UUIDV4),
16
+ Column(DataType.UUID)
17
+ ], Ingredient.prototype, "uuid", void 0);
18
+ _ts_decorate([
19
+ Column({
20
+ type: DataType.STRING,
21
+ allowNull: false,
22
+ unique: true
23
+ })
24
+ ], Ingredient.prototype, "name", void 0);
25
+ _ts_decorate([
26
+ Column({
27
+ type: DataType.FLOAT,
28
+ allowNull: false
29
+ })
30
+ ], Ingredient.prototype, "caloriesPer100g", void 0);
31
+ _ts_decorate([
32
+ Column({
33
+ type: DataType.FLOAT,
34
+ allowNull: false
35
+ })
36
+ ], Ingredient.prototype, "proteinPer100g", void 0);
37
+ _ts_decorate([
38
+ Column({
39
+ type: DataType.FLOAT,
40
+ allowNull: false
41
+ })
42
+ ], Ingredient.prototype, "carbsPer100g", void 0);
43
+ _ts_decorate([
44
+ Column({
45
+ type: DataType.FLOAT,
46
+ allowNull: false
47
+ })
48
+ ], Ingredient.prototype, "fatsPer100g", void 0);
49
+ _ts_decorate([
50
+ Column({
51
+ type: DataType.STRING,
52
+ allowNull: true
53
+ })
54
+ ], Ingredient.prototype, "category", void 0);
55
+ _ts_decorate([
56
+ HasMany(()=>RecipeIngredient, {
57
+ foreignKey: "ingredientUuid",
58
+ onDelete: "CASCADE"
59
+ })
60
+ ], Ingredient.prototype, "recipeIngredients", void 0);
61
+ _ts_decorate([
62
+ BelongsToMany(()=>IngredientTag, {
63
+ through: ()=>IngredientTags,
64
+ foreignKey: "ingredientUuid",
65
+ otherKey: "ingredientTagUuid",
66
+ as: "tags"
67
+ })
68
+ ], Ingredient.prototype, "tags", void 0);
69
+ Ingredient = _ts_decorate([
70
+ Table({
71
+ timestamps: true,
72
+ indexes: [
73
+ {
74
+ fields: [
75
+ "name"
76
+ ],
77
+ unique: true
78
+ },
79
+ {
80
+ fields: [
81
+ "category"
82
+ ]
83
+ }
84
+ ]
85
+ })
86
+ ], Ingredient);
87
+
88
+ //# sourceMappingURL=Ingredient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/lib/dbmodels/diet/Ingredient.ts"],"sourcesContent":["import {\n Table,\n Model,\n Column,\n DataType,\n Default,\n PrimaryKey,\n HasMany,\n BelongsToMany,\n} from \"sequelize-typescript\";\nimport type { Optional } from \"sequelize\";\nimport { RecipeIngredient } from \"./RecipeIngredient.js\";\nimport { IngredientTag } from \"./IngredientTag.js\";\nimport { IngredientTags } from \"./IngredientTags.js\";\n\ninterface IngredientAttributes {\n uuid: string;\n name: string;\n caloriesPer100g: number;\n proteinPer100g: number;\n carbsPer100g: number;\n fatsPer100g: number;\n category?: string;\n createdAt?: Date;\n updatedAt?: Date;\n}\n\ninterface IngredientCreationAttributes\n extends Optional<IngredientAttributes, \"uuid\" | \"category\" | \"createdAt\" | \"updatedAt\"> {}\n\n@Table({\n timestamps: true,\n indexes: [\n {\n fields: [\"name\"],\n unique: true,\n },\n {\n fields: [\"category\"],\n },\n ],\n})\nexport class Ingredient extends Model<IngredientAttributes, IngredientCreationAttributes> {\n @PrimaryKey\n @Default(DataType.UUIDV4)\n @Column(DataType.UUID)\n declare uuid: string;\n\n @Column({ type: DataType.STRING, allowNull: false, unique: true })\n declare name: string;\n\n @Column({ type: DataType.FLOAT, allowNull: false })\n declare caloriesPer100g: number;\n\n @Column({ type: DataType.FLOAT, allowNull: false })\n declare proteinPer100g: number;\n\n @Column({ type: DataType.FLOAT, allowNull: false })\n declare carbsPer100g: number;\n\n @Column({ type: DataType.FLOAT, allowNull: false })\n declare fatsPer100g: number;\n\n @Column({ type: DataType.STRING, allowNull: true })\n declare category: string;\n\n @HasMany(() => RecipeIngredient, { foreignKey: \"ingredientUuid\", onDelete: \"CASCADE\" })\n declare recipeIngredients: RecipeIngredient[];\n\n @BelongsToMany(() => IngredientTag, {\n through: () => IngredientTags,\n foreignKey: \"ingredientUuid\",\n otherKey: \"ingredientTagUuid\",\n as: \"tags\",\n })\n declare tags: IngredientTag[];\n}\n"],"names":["Table","Model","Column","DataType","Default","PrimaryKey","HasMany","BelongsToMany","RecipeIngredient","IngredientTag","IngredientTags","Ingredient","UUIDV4","UUID","type","STRING","allowNull","unique","FLOAT","foreignKey","onDelete","through","otherKey","as","timestamps","indexes","fields"],"mappings":";;;;;;AAAA,SACEA,KAAK,EACLC,KAAK,EACLC,MAAM,EACNC,QAAQ,EACRC,OAAO,EACPC,UAAU,EACVC,OAAO,EACPC,aAAa,QACR,uBAAuB;AAE9B,SAASC,gBAAgB,QAAQ,wBAAwB;AACzD,SAASC,aAAa,QAAQ,qBAAqB;AACnD,SAASC,cAAc,QAAQ,sBAAsB;AA6BrD,OAAO,MAAMC,mBAAmBV;AAkChC;;;qBAhCoBW;oBACDC;;;;QAGPC,MAAMX,SAASY,MAAM;QAAEC,WAAW;QAAOC,QAAQ;;;;;QAGjDH,MAAMX,SAASe,KAAK;QAAEF,WAAW;;;;;QAGjCF,MAAMX,SAASe,KAAK;QAAEF,WAAW;;;;;QAGjCF,MAAMX,SAASe,KAAK;QAAEF,WAAW;;;;;QAGjCF,MAAMX,SAASe,KAAK;QAAEF,WAAW;;;;;QAGjCF,MAAMX,SAASY,MAAM;QAAEC,WAAW;;;;gBAG7BR;QAAoBW,YAAY;QAAkBC,UAAU;;;;sBAGtDX;QACnBY,SAAS,IAAMX;QACfS,YAAY;QACZG,UAAU;QACVC,IAAI;;;;;QA1CNC,YAAY;QACZC,SAAS;YACP;gBACEC,QAAQ;oBAAC;iBAAO;gBAChBT,QAAQ;YACV;YACA;gBACES,QAAQ;oBAAC;iBAAW;YACtB;SACD"}
@@ -0,0 +1,64 @@
1
+ function _ts_decorate(decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ 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;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ }
7
+ import { BelongsToMany, Column, DataType, Default, Model, PrimaryKey, Table } from "sequelize-typescript";
8
+ import { Ingredient } from "./Ingredient.js";
9
+ import { IngredientTags } from "./IngredientTags.js";
10
+ export class IngredientTag extends Model {
11
+ }
12
+ _ts_decorate([
13
+ PrimaryKey,
14
+ Default(DataType.UUIDV4),
15
+ Column(DataType.UUID)
16
+ ], IngredientTag.prototype, "uuid", void 0);
17
+ _ts_decorate([
18
+ Column({
19
+ type: DataType.TEXT,
20
+ allowNull: false,
21
+ unique: true
22
+ })
23
+ ], IngredientTag.prototype, "tag", void 0);
24
+ _ts_decorate([
25
+ Column({
26
+ type: DataType.STRING,
27
+ allowNull: false
28
+ })
29
+ ], IngredientTag.prototype, "category", void 0);
30
+ _ts_decorate([
31
+ Column({
32
+ type: DataType.INTEGER,
33
+ allowNull: false,
34
+ defaultValue: 0
35
+ })
36
+ ], IngredientTag.prototype, "order", void 0);
37
+ _ts_decorate([
38
+ BelongsToMany(()=>Ingredient, {
39
+ through: ()=>IngredientTags,
40
+ foreignKey: "ingredientTagUuid",
41
+ otherKey: "ingredientUuid"
42
+ })
43
+ ], IngredientTag.prototype, "ingredients", void 0);
44
+ IngredientTag = _ts_decorate([
45
+ Table({
46
+ tableName: "IngredientTag",
47
+ timestamps: true,
48
+ indexes: [
49
+ {
50
+ fields: [
51
+ "tag"
52
+ ],
53
+ unique: true
54
+ },
55
+ {
56
+ fields: [
57
+ "category"
58
+ ]
59
+ }
60
+ ]
61
+ })
62
+ ], IngredientTag);
63
+
64
+ //# sourceMappingURL=IngredientTag.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/lib/dbmodels/diet/IngredientTag.ts"],"sourcesContent":["import {\n BelongsToMany,\n Column,\n DataType,\n Default,\n Model,\n PrimaryKey,\n Table,\n} from \"sequelize-typescript\";\nimport type { Optional } from \"sequelize\";\nimport { Ingredient } from \"./Ingredient.js\";\nimport { IngredientTags } from \"./IngredientTags.js\";\n\ninterface IngredientTagAttributes {\n uuid: string;\n tag: string;\n category: string;\n order: number;\n createdAt?: Date;\n updatedAt?: Date;\n}\n\ninterface IngredientTagCreationAttributes\n extends Optional<IngredientTagAttributes, \"uuid\" | \"order\" | \"createdAt\" | \"updatedAt\"> {}\n\n@Table({\n tableName: \"IngredientTag\",\n timestamps: true,\n indexes: [\n {\n fields: [\"tag\"],\n unique: true,\n },\n {\n fields: [\"category\"],\n },\n ],\n})\nexport class IngredientTag extends Model<\n IngredientTagAttributes,\n IngredientTagCreationAttributes\n> {\n @PrimaryKey\n @Default(DataType.UUIDV4)\n @Column(DataType.UUID)\n declare uuid: string;\n\n @Column({ type: DataType.TEXT, allowNull: false, unique: true })\n declare tag: string;\n\n @Column({ type: DataType.STRING, allowNull: false })\n declare category: string;\n\n @Column({ type: DataType.INTEGER, allowNull: false, defaultValue: 0 })\n declare order: number;\n\n @BelongsToMany(() => Ingredient, {\n through: () => IngredientTags,\n foreignKey: \"ingredientTagUuid\",\n otherKey: \"ingredientUuid\",\n })\n declare ingredients: Ingredient[];\n}\n"],"names":["BelongsToMany","Column","DataType","Default","Model","PrimaryKey","Table","Ingredient","IngredientTags","IngredientTag","UUIDV4","UUID","type","TEXT","allowNull","unique","STRING","INTEGER","defaultValue","through","foreignKey","otherKey","tableName","timestamps","indexes","fields"],"mappings":";;;;;;AAAA,SACEA,aAAa,EACbC,MAAM,EACNC,QAAQ,EACRC,OAAO,EACPC,KAAK,EACLC,UAAU,EACVC,KAAK,QACA,uBAAuB;AAE9B,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,SAASC,cAAc,QAAQ,sBAAsB;AA2BrD,OAAO,MAAMC,sBAAsBL;AAwBnC;;;qBAnBoBM;oBACDC;;;;QAGPC,MAAMV,SAASW,IAAI;QAAEC,WAAW;QAAOC,QAAQ;;;;;QAG/CH,MAAMV,SAASc,MAAM;QAAEF,WAAW;;;;;QAGlCF,MAAMV,SAASe,OAAO;QAAEH,WAAW;QAAOI,cAAc;;;;sBAG7CX;QACnBY,SAAS,IAAMX;QACfY,YAAY;QACZC,UAAU;;;;;QAjCZC,WAAW;QACXC,YAAY;QACZC,SAAS;YACP;gBACEC,QAAQ;oBAAC;iBAAM;gBACfV,QAAQ;YACV;YACA;gBACEU,QAAQ;oBAAC;iBAAW;YACtB;SACD"}
@@ -0,0 +1,29 @@
1
+ function _ts_decorate(decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ 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;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ }
7
+ import { Column, DataType, ForeignKey, Model, Table, PrimaryKey } from "sequelize-typescript";
8
+ import { Ingredient } from "./Ingredient.js";
9
+ import { IngredientTag } from "./IngredientTag.js";
10
+ export class IngredientTags extends Model {
11
+ }
12
+ _ts_decorate([
13
+ PrimaryKey,
14
+ ForeignKey(()=>Ingredient),
15
+ Column(DataType.UUID)
16
+ ], IngredientTags.prototype, "ingredientUuid", void 0);
17
+ _ts_decorate([
18
+ PrimaryKey,
19
+ ForeignKey(()=>IngredientTag),
20
+ Column(DataType.UUID)
21
+ ], IngredientTags.prototype, "ingredientTagUuid", void 0);
22
+ IngredientTags = _ts_decorate([
23
+ Table({
24
+ tableName: "IngredientTags",
25
+ timestamps: false
26
+ })
27
+ ], IngredientTags);
28
+
29
+ //# sourceMappingURL=IngredientTags.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/lib/dbmodels/diet/IngredientTags.ts"],"sourcesContent":["import {\n Column,\n DataType,\n ForeignKey,\n Model,\n Table,\n PrimaryKey,\n} from \"sequelize-typescript\";\nimport { Ingredient } from \"./Ingredient.js\";\nimport { IngredientTag } from \"./IngredientTag.js\";\n\n@Table({ tableName: \"IngredientTags\", timestamps: false })\nexport class IngredientTags extends Model<IngredientTags> {\n @PrimaryKey\n @ForeignKey(() => Ingredient)\n @Column(DataType.UUID)\n declare ingredientUuid: string;\n\n @PrimaryKey\n @ForeignKey(() => IngredientTag)\n @Column(DataType.UUID)\n declare ingredientTagUuid: string;\n}\n"],"names":["Column","DataType","ForeignKey","Model","Table","PrimaryKey","Ingredient","IngredientTag","IngredientTags","UUID","tableName","timestamps"],"mappings":";;;;;;AAAA,SACEA,MAAM,EACNC,QAAQ,EACRC,UAAU,EACVC,KAAK,EACLC,KAAK,EACLC,UAAU,QACL,uBAAuB;AAC9B,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,SAASC,aAAa,QAAQ,qBAAqB;AAGnD,OAAO,MAAMC,uBAAuBL;AAUpC;;;mBARoBG;oBACDG;;;;mBAICF;oBACDE;;;;QATVC,WAAW;QAAkBC,YAAY"}
@@ -0,0 +1,173 @@
1
+ function _ts_decorate(decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ 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;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ }
7
+ import { BelongsTo, BelongsToMany, Column, DataType, Default, ForeignKey, HasMany, Model, Table } from "sequelize-typescript";
8
+ import { TranslatedRecipe } from "./TranslatedRecipe.js";
9
+ import { RecipeTag } from "./RecipeTag.js";
10
+ import { RecipeTags } from "./RecipeTags.js";
11
+ import { RecipeIngredient } from "./RecipeIngredient.js";
12
+ import { PersistedUser } from "../user/PersistedUser.js";
13
+ export class Recipe extends Model {
14
+ }
15
+ _ts_decorate([
16
+ Default(DataType.UUIDV4),
17
+ Column({
18
+ type: DataType.UUID,
19
+ defaultValue: DataType.UUID,
20
+ allowNull: false,
21
+ primaryKey: true
22
+ })
23
+ ], Recipe.prototype, "uuid", void 0);
24
+ _ts_decorate([
25
+ ForeignKey(()=>PersistedUser),
26
+ Column({
27
+ type: DataType.UUID,
28
+ allowNull: true
29
+ })
30
+ ], Recipe.prototype, "createdBy", void 0);
31
+ _ts_decorate([
32
+ Column({
33
+ type: DataType.TEXT,
34
+ allowNull: false
35
+ })
36
+ ], Recipe.prototype, "title", void 0);
37
+ _ts_decorate([
38
+ Column({
39
+ type: DataType.TEXT,
40
+ allowNull: false
41
+ })
42
+ ], Recipe.prototype, "duration", void 0);
43
+ _ts_decorate([
44
+ Column({
45
+ type: DataType.TEXT,
46
+ allowNull: false
47
+ })
48
+ ], Recipe.prototype, "content", void 0);
49
+ _ts_decorate([
50
+ Column({
51
+ type: DataType.TEXT,
52
+ allowNull: false
53
+ })
54
+ ], Recipe.prototype, "kcal", void 0);
55
+ _ts_decorate([
56
+ Column({
57
+ type: DataType.TEXT,
58
+ allowNull: false
59
+ })
60
+ ], Recipe.prototype, "fat", void 0);
61
+ _ts_decorate([
62
+ Column({
63
+ type: DataType.TEXT,
64
+ allowNull: false
65
+ })
66
+ ], Recipe.prototype, "carbs", void 0);
67
+ _ts_decorate([
68
+ Column({
69
+ type: DataType.TEXT,
70
+ allowNull: false
71
+ })
72
+ ], Recipe.prototype, "protein", void 0);
73
+ _ts_decorate([
74
+ Column({
75
+ type: DataType.TEXT,
76
+ allowNull: false
77
+ })
78
+ ], Recipe.prototype, "ingredients", void 0);
79
+ _ts_decorate([
80
+ Column({
81
+ type: DataType.TEXT,
82
+ allowNull: false
83
+ })
84
+ ], Recipe.prototype, "method", void 0);
85
+ _ts_decorate([
86
+ Column({
87
+ type: DataType.TEXT,
88
+ allowNull: false
89
+ })
90
+ ], Recipe.prototype, "tipsAndTricks", void 0);
91
+ _ts_decorate([
92
+ Column({
93
+ type: DataType.BOOLEAN,
94
+ allowNull: false,
95
+ defaultValue: false
96
+ })
97
+ ], Recipe.prototype, "ShowForFreeVersion", void 0);
98
+ _ts_decorate([
99
+ Column({
100
+ type: DataType.BOOLEAN,
101
+ allowNull: false,
102
+ defaultValue: false
103
+ })
104
+ ], Recipe.prototype, "LockForFreeVersion", void 0);
105
+ _ts_decorate([
106
+ Default(true),
107
+ Column({
108
+ type: DataType.BOOLEAN,
109
+ allowNull: false,
110
+ defaultValue: false
111
+ })
112
+ ], Recipe.prototype, "isCoachingRecipe", void 0);
113
+ _ts_decorate([
114
+ Column({
115
+ type: DataType.BOOLEAN,
116
+ allowNull: false,
117
+ defaultValue: false
118
+ })
119
+ ], Recipe.prototype, "isPublic", void 0);
120
+ _ts_decorate([
121
+ BelongsToMany(()=>RecipeTag, {
122
+ through: ()=>RecipeTags,
123
+ as: "tags"
124
+ })
125
+ ], Recipe.prototype, "tags", void 0);
126
+ _ts_decorate([
127
+ Column({
128
+ type: DataType.INTEGER,
129
+ allowNull: false,
130
+ defaultValue: 0
131
+ })
132
+ ], Recipe.prototype, "order", void 0);
133
+ _ts_decorate([
134
+ Column({
135
+ type: DataType.STRING(500),
136
+ allowNull: true
137
+ })
138
+ ], Recipe.prototype, "coverImageUrl", void 0);
139
+ _ts_decorate([
140
+ Column({
141
+ type: DataType.STRING(500),
142
+ allowNull: true
143
+ })
144
+ ], Recipe.prototype, "ingredientsImageUrl", void 0);
145
+ _ts_decorate([
146
+ Column({
147
+ type: DataType.STRING(500),
148
+ allowNull: true
149
+ })
150
+ ], Recipe.prototype, "methodImageUrl", void 0);
151
+ _ts_decorate([
152
+ Column({
153
+ type: DataType.DATE,
154
+ allowNull: true
155
+ })
156
+ ], Recipe.prototype, "imageUploadedAt", void 0);
157
+ _ts_decorate([
158
+ HasMany(()=>TranslatedRecipe)
159
+ ], Recipe.prototype, "translatedRecipes", void 0);
160
+ _ts_decorate([
161
+ HasMany(()=>RecipeIngredient, {
162
+ foreignKey: "recipeUuid",
163
+ onDelete: "CASCADE"
164
+ })
165
+ ], Recipe.prototype, "recipeIngredients", void 0);
166
+ _ts_decorate([
167
+ BelongsTo(()=>PersistedUser)
168
+ ], Recipe.prototype, "creator", void 0);
169
+ Recipe = _ts_decorate([
170
+ Table
171
+ ], Recipe);
172
+
173
+ //# sourceMappingURL=Recipe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/lib/dbmodels/diet/Recipe.ts"],"sourcesContent":["import {\n BelongsTo,\n BelongsToMany,\n Column,\n DataType,\n Default,\n ForeignKey,\n HasMany,\n Model,\n Table,\n} from \"sequelize-typescript\";\nimport type { Optional } from \"sequelize\";\nimport { TranslatedRecipe } from \"./TranslatedRecipe.js\";\nimport { RecipeTag } from \"./RecipeTag.js\";\nimport { RecipeTags } from \"./RecipeTags.js\";\nimport { RecipeIngredient } from \"./RecipeIngredient.js\";\nimport { PersistedUser } from \"../user/PersistedUser.js\";\n\nexport interface RecipeAttributes {\n uuid: string;\n createdBy?: string | null;\n title: string;\n duration: string;\n content: string;\n kcal: string;\n fat: string;\n carbs: string;\n protein: string;\n ingredients: string;\n method: string;\n tipsAndTricks: string;\n ShowForFreeVersion: boolean;\n LockForFreeVersion: boolean;\n isCoachingRecipe: boolean;\n isPublic: boolean;\n order: number;\n coverImageUrl?: string | null;\n ingredientsImageUrl?: string | null;\n methodImageUrl?: string | null;\n imageUploadedAt?: Date | null;\n createdAt?: Date;\n updatedAt?: Date;\n translatedRecipes?: TranslatedRecipe[];\n tags?: RecipeTag[];\n}\n\nexport interface RecipeCreationAttributes extends Optional<RecipeAttributes, \"uuid\" | \"createdBy\" | \"createdAt\" | \"updatedAt\" | \"coverImageUrl\" | \"ingredientsImageUrl\" | \"methodImageUrl\" | \"imageUploadedAt\"> {\n}\n\n@Table\nexport class Recipe extends Model<RecipeAttributes, RecipeCreationAttributes> {\n @Default(DataType.UUIDV4)\n @Column({\n type: DataType.UUID,\n defaultValue: DataType.UUID,\n allowNull: false,\n primaryKey: true,\n })\n declare uuid: string;\n\n @ForeignKey(() => PersistedUser)\n @Column({\n type: DataType.UUID,\n allowNull: true,\n })\n declare createdBy: string | null;\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare title: string;\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare duration: string;\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare content: string;\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare kcal: string;\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare fat: string;\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare carbs: string;\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare protein: string;\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare ingredients: string;\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare method: string;\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare tipsAndTricks: string;\n\n @Column({ type: DataType.BOOLEAN, allowNull: false, defaultValue: false })\n declare ShowForFreeVersion: boolean;\n\n @Column({ type: DataType.BOOLEAN, allowNull: false, defaultValue: false })\n declare LockForFreeVersion: boolean;\n\n @Default(true)\n @Column({ type: DataType.BOOLEAN, allowNull: false, defaultValue: false })\n declare isCoachingRecipe: boolean;\n\n @Column({ type: DataType.BOOLEAN, allowNull: false, defaultValue: false })\n declare isPublic: boolean;\n\n @BelongsToMany(() => RecipeTag, { through: () => RecipeTags, as: \"tags\" })\n declare tags: RecipeTag[];\n\n @Column({ type: DataType.INTEGER, allowNull: false, defaultValue: 0 })\n declare order: number;\n\n @Column({ type: DataType.STRING(500), allowNull: true })\n declare coverImageUrl?: string | null;\n\n @Column({ type: DataType.STRING(500), allowNull: true })\n declare ingredientsImageUrl?: string | null;\n\n @Column({ type: DataType.STRING(500), allowNull: true })\n declare methodImageUrl?: string | null;\n\n @Column({ type: DataType.DATE, allowNull: true })\n declare imageUploadedAt?: Date | null;\n\n @HasMany(() => TranslatedRecipe)\n declare translatedRecipes: TranslatedRecipe[];\n\n @HasMany(() => RecipeIngredient, { foreignKey: \"recipeUuid\", onDelete: \"CASCADE\" })\n declare recipeIngredients: RecipeIngredient[];\n\n @BelongsTo(() => PersistedUser)\n declare creator: PersistedUser;\n}\n"],"names":["BelongsTo","BelongsToMany","Column","DataType","Default","ForeignKey","HasMany","Model","Table","TranslatedRecipe","RecipeTag","RecipeTags","RecipeIngredient","PersistedUser","Recipe","UUIDV4","type","UUID","defaultValue","allowNull","primaryKey","TEXT","BOOLEAN","through","as","INTEGER","STRING","DATE","foreignKey","onDelete"],"mappings":";;;;;;AAAA,SACEA,SAAS,EACTC,aAAa,EACbC,MAAM,EACNC,QAAQ,EACRC,OAAO,EACPC,UAAU,EACVC,OAAO,EACPC,KAAK,EACLC,KAAK,QACA,uBAAuB;AAE9B,SAASC,gBAAgB,QAAQ,wBAAwB;AACzD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,SAASC,gBAAgB,QAAQ,wBAAwB;AACzD,SAASC,aAAa,QAAQ,2BAA2B;AAkCzD,OAAO,MAAMC,eAAeP;AAsF5B;;qBArFoBQ;;QAEhBC,MAAMb,SAASc,IAAI;QACnBC,cAAcf,SAASc,IAAI;QAC3BE,WAAW;QACXC,YAAY;;;;mBAIIP;;QAEhBG,MAAMb,SAASc,IAAI;QACnBE,WAAW;;;;;QAIHH,MAAMb,SAASkB,IAAI;QAAEF,WAAW;;;;;QAGhCH,MAAMb,SAASkB,IAAI;QAAEF,WAAW;;;;;QAGhCH,MAAMb,SAASkB,IAAI;QAAEF,WAAW;;;;;QAGhCH,MAAMb,SAASkB,IAAI;QAAEF,WAAW;;;;;QAGhCH,MAAMb,SAASkB,IAAI;QAAEF,WAAW;;;;;QAGhCH,MAAMb,SAASkB,IAAI;QAAEF,WAAW;;;;;QAGhCH,MAAMb,SAASkB,IAAI;QAAEF,WAAW;;;;;QAGhCH,MAAMb,SAASkB,IAAI;QAAEF,WAAW;;;;;QAGhCH,MAAMb,SAASkB,IAAI;QAAEF,WAAW;;;;;QAGhCH,MAAMb,SAASkB,IAAI;QAAEF,WAAW;;;;;QAGhCH,MAAMb,SAASmB,OAAO;QAAEH,WAAW;QAAOD,cAAc;;;;;QAGxDF,MAAMb,SAASmB,OAAO;QAAEH,WAAW;QAAOD,cAAc;;;;;;QAIxDF,MAAMb,SAASmB,OAAO;QAAEH,WAAW;QAAOD,cAAc;;;;;QAGxDF,MAAMb,SAASmB,OAAO;QAAEH,WAAW;QAAOD,cAAc;;;;sBAG7CR;QAAaa,SAAS,IAAMZ;QAAYa,IAAI;;;;;QAGvDR,MAAMb,SAASsB,OAAO;QAAEN,WAAW;QAAOD,cAAc;;;;;QAGxDF,MAAMb,SAASuB,MAAM,CAAC;QAAMP,WAAW;;;;;QAGvCH,MAAMb,SAASuB,MAAM,CAAC;QAAMP,WAAW;;;;;QAGvCH,MAAMb,SAASuB,MAAM,CAAC;QAAMP,WAAW;;;;;QAGvCH,MAAMb,SAASwB,IAAI;QAAER,WAAW;;;;gBAG3BV;;;gBAGAG;QAAoBgB,YAAY;QAAcC,UAAU;;;;kBAGtDhB"}
@@ -0,0 +1,78 @@
1
+ function _ts_decorate(decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ 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;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ }
7
+ import { Table, Model, Column, DataType, Default, PrimaryKey, ForeignKey, BelongsTo, Index } from "sequelize-typescript";
8
+ import { Recipe } from "./Recipe.js";
9
+ import { Ingredient } from "./Ingredient.js";
10
+ export class RecipeIngredient extends Model {
11
+ }
12
+ _ts_decorate([
13
+ PrimaryKey,
14
+ Default(DataType.UUIDV4),
15
+ Column(DataType.UUID)
16
+ ], RecipeIngredient.prototype, "uuid", void 0);
17
+ _ts_decorate([
18
+ Index,
19
+ ForeignKey(()=>Recipe),
20
+ Column({
21
+ type: DataType.UUID,
22
+ allowNull: false
23
+ })
24
+ ], RecipeIngredient.prototype, "recipeUuid", void 0);
25
+ _ts_decorate([
26
+ BelongsTo(()=>Recipe, {
27
+ foreignKey: "recipeUuid",
28
+ onDelete: "CASCADE"
29
+ })
30
+ ], RecipeIngredient.prototype, "recipe", void 0);
31
+ _ts_decorate([
32
+ Index,
33
+ ForeignKey(()=>Ingredient),
34
+ Column({
35
+ type: DataType.UUID,
36
+ allowNull: false
37
+ })
38
+ ], RecipeIngredient.prototype, "ingredientUuid", void 0);
39
+ _ts_decorate([
40
+ BelongsTo(()=>Ingredient, {
41
+ foreignKey: "ingredientUuid",
42
+ onDelete: "RESTRICT"
43
+ })
44
+ ], RecipeIngredient.prototype, "ingredient", void 0);
45
+ _ts_decorate([
46
+ Column({
47
+ type: DataType.FLOAT,
48
+ allowNull: false
49
+ })
50
+ ], RecipeIngredient.prototype, "grams", void 0);
51
+ _ts_decorate([
52
+ Column({
53
+ type: DataType.FLOAT,
54
+ allowNull: true
55
+ })
56
+ ], RecipeIngredient.prototype, "displayAmount", void 0);
57
+ _ts_decorate([
58
+ Column({
59
+ type: DataType.STRING(100),
60
+ allowNull: true
61
+ })
62
+ ], RecipeIngredient.prototype, "displayUnit", void 0);
63
+ RecipeIngredient = _ts_decorate([
64
+ Table({
65
+ timestamps: true,
66
+ indexes: [
67
+ {
68
+ fields: [
69
+ "recipeUuid",
70
+ "ingredientUuid"
71
+ ],
72
+ unique: true
73
+ }
74
+ ]
75
+ })
76
+ ], RecipeIngredient);
77
+
78
+ //# sourceMappingURL=RecipeIngredient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/lib/dbmodels/diet/RecipeIngredient.ts"],"sourcesContent":["import {\n Table,\n Model,\n Column,\n DataType,\n Default,\n PrimaryKey,\n ForeignKey,\n BelongsTo,\n Index,\n} from \"sequelize-typescript\";\nimport type { Optional } from \"sequelize\";\nimport { Recipe } from \"./Recipe.js\";\nimport { Ingredient } from \"./Ingredient.js\";\n\nexport interface RecipeIngredientAttributes {\n uuid: string;\n recipeUuid: string;\n ingredientUuid: string;\n grams: number;\n displayAmount?: number;\n displayUnit?: string;\n createdAt?: Date;\n updatedAt?: Date;\n}\n\nexport interface RecipeIngredientCreationAttributes\n extends Optional<RecipeIngredientAttributes, \"uuid\" | \"createdAt\" | \"updatedAt\"> {}\n\n@Table({\n timestamps: true,\n indexes: [\n {\n fields: [\"recipeUuid\", \"ingredientUuid\"],\n unique: true,\n },\n ],\n})\nexport class RecipeIngredient extends Model<\n RecipeIngredientAttributes,\n RecipeIngredientCreationAttributes\n> {\n @PrimaryKey\n @Default(DataType.UUIDV4)\n @Column(DataType.UUID)\n declare uuid: string;\n\n @Index\n @ForeignKey(() => Recipe)\n @Column({ type: DataType.UUID, allowNull: false })\n declare recipeUuid: string;\n\n @BelongsTo(() => Recipe, { foreignKey: \"recipeUuid\", onDelete: \"CASCADE\" })\n declare recipe: Recipe;\n\n @Index\n @ForeignKey(() => Ingredient)\n @Column({ type: DataType.UUID, allowNull: false })\n declare ingredientUuid: string;\n\n @BelongsTo(() => Ingredient, { foreignKey: \"ingredientUuid\", onDelete: \"RESTRICT\" })\n declare ingredient: Ingredient;\n\n @Column({ type: DataType.FLOAT, allowNull: false })\n declare grams: number;\n\n @Column({ type: DataType.FLOAT, allowNull: true })\n declare displayAmount?: number;\n\n @Column({ type: DataType.STRING(100), allowNull: true })\n declare displayUnit?: string;\n}\n"],"names":["Table","Model","Column","DataType","Default","PrimaryKey","ForeignKey","BelongsTo","Index","Recipe","Ingredient","RecipeIngredient","UUIDV4","UUID","type","allowNull","foreignKey","onDelete","FLOAT","STRING","timestamps","indexes","fields","unique"],"mappings":";;;;;;AAAA,SACEA,KAAK,EACLC,KAAK,EACLC,MAAM,EACNC,QAAQ,EACRC,OAAO,EACPC,UAAU,EACVC,UAAU,EACVC,SAAS,EACTC,KAAK,QACA,uBAAuB;AAE9B,SAASC,MAAM,QAAQ,cAAc;AACrC,SAASC,UAAU,QAAQ,kBAAkB;AAyB7C,OAAO,MAAMC,yBAAyBV;AAiCtC;;;qBA5BoBW;oBACDC;;;;mBAICJ;;QACRK,MAAMX,SAASU,IAAI;QAAEE,WAAW;;;;kBAGzBN;QAAUO,YAAY;QAAcC,UAAU;;;;;mBAI7CP;;QACRI,MAAMX,SAASU,IAAI;QAAEE,WAAW;;;;kBAGzBL;QAAcM,YAAY;QAAkBC,UAAU;;;;;QAG7DH,MAAMX,SAASe,KAAK;QAAEH,WAAW;;;;;QAGjCD,MAAMX,SAASe,KAAK;QAAEH,WAAW;;;;;QAGjCD,MAAMX,SAASgB,MAAM,CAAC;QAAMJ,WAAW;;;;;QAvCjDK,YAAY;QACZC,SAAS;YACP;gBACEC,QAAQ;oBAAC;oBAAc;iBAAiB;gBACxCC,QAAQ;YACV;SACD"}
@@ -0,0 +1,44 @@
1
+ function _ts_decorate(decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ 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;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ }
7
+ import { BelongsToMany, Column, DataType, Default, HasMany, Model, PrimaryKey, Table } from "sequelize-typescript";
8
+ import { Recipe } from "./Recipe.js";
9
+ import { RecipeTags } from "./RecipeTags.js";
10
+ import { TranslatedRecipeTag } from "./TranslatedRecipeTag.js";
11
+ export class RecipeTag extends Model {
12
+ }
13
+ _ts_decorate([
14
+ PrimaryKey,
15
+ Default(DataType.UUIDV4),
16
+ Column(DataType.UUID)
17
+ ], RecipeTag.prototype, "uuid", void 0);
18
+ _ts_decorate([
19
+ Column({
20
+ type: DataType.TEXT,
21
+ allowNull: false
22
+ })
23
+ ], RecipeTag.prototype, "tag", void 0);
24
+ _ts_decorate([
25
+ Column({
26
+ type: DataType.INTEGER,
27
+ allowNull: false
28
+ })
29
+ ], RecipeTag.prototype, "order", void 0);
30
+ _ts_decorate([
31
+ BelongsToMany(()=>Recipe, {
32
+ through: ()=>RecipeTags
33
+ })
34
+ ], RecipeTag.prototype, "recipes", void 0);
35
+ _ts_decorate([
36
+ HasMany(()=>TranslatedRecipeTag)
37
+ ], RecipeTag.prototype, "translatedRecipeTags", void 0);
38
+ RecipeTag = _ts_decorate([
39
+ Table({
40
+ tableName: "RecipeTag"
41
+ })
42
+ ], RecipeTag);
43
+
44
+ //# sourceMappingURL=RecipeTag.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/lib/dbmodels/diet/RecipeTag.ts"],"sourcesContent":["import {\n BelongsToMany,\n Column,\n DataType,\n Default,\n HasMany,\n Model,\n PrimaryKey,\n Table,\n} from \"sequelize-typescript\";\nimport { Recipe } from \"./Recipe.js\";\nimport { RecipeTags } from \"./RecipeTags.js\";\nimport { TranslatedRecipeTag } from \"./TranslatedRecipeTag.js\";\n\n@Table({ tableName: \"RecipeTag\" })\nexport class RecipeTag extends Model {\n @PrimaryKey\n @Default(DataType.UUIDV4)\n @Column(DataType.UUID)\n declare uuid: string;\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare tag: string;\n\n @Column({ type: DataType.INTEGER, allowNull: false })\n declare order: number;\n\n @BelongsToMany(() => Recipe, { through: () => RecipeTags })\n declare recipes: Recipe[];\n\n @HasMany(() => TranslatedRecipeTag)\n declare translatedRecipeTags: TranslatedRecipeTag[];\n}\n"],"names":["BelongsToMany","Column","DataType","Default","HasMany","Model","PrimaryKey","Table","Recipe","RecipeTags","TranslatedRecipeTag","RecipeTag","UUIDV4","UUID","type","TEXT","allowNull","INTEGER","through","tableName"],"mappings":";;;;;;AAAA,SACEA,aAAa,EACbC,MAAM,EACNC,QAAQ,EACRC,OAAO,EACPC,OAAO,EACPC,KAAK,EACLC,UAAU,EACVC,KAAK,QACA,uBAAuB;AAC9B,SAASC,MAAM,QAAQ,cAAc;AACrC,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,SAASC,mBAAmB,QAAQ,2BAA2B;AAG/D,OAAO,MAAMC,kBAAkBN;AAiB/B;;;qBAfoBO;oBACDC;;;;QAGPC,MAAMZ,SAASa,IAAI;QAAEC,WAAW;;;;;QAGhCF,MAAMZ,SAASe,OAAO;QAAED,WAAW;;;;sBAGxBR;QAAUU,SAAS,IAAMT;;;;gBAG/BC;;;;QAhBRS,WAAW"}
@@ -0,0 +1,24 @@
1
+ function _ts_decorate(decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ 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;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ }
7
+ import { Column, DataType, ForeignKey, Model, Table } from "sequelize-typescript";
8
+ import { Recipe } from "./Recipe.js";
9
+ import { RecipeTag } from "./RecipeTag.js";
10
+ export class RecipeTags extends Model {
11
+ }
12
+ _ts_decorate([
13
+ ForeignKey(()=>Recipe),
14
+ Column(DataType.UUID)
15
+ ], RecipeTags.prototype, "recipeUuid", void 0);
16
+ _ts_decorate([
17
+ ForeignKey(()=>RecipeTag),
18
+ Column(DataType.UUID)
19
+ ], RecipeTags.prototype, "recipeTagUuid", void 0);
20
+ RecipeTags = _ts_decorate([
21
+ Table
22
+ ], RecipeTags);
23
+
24
+ //# sourceMappingURL=RecipeTags.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/lib/dbmodels/diet/RecipeTags.ts"],"sourcesContent":["import {\n Column,\n DataType,\n ForeignKey,\n Model,\n Table,\n} from \"sequelize-typescript\";\nimport { Recipe } from \"./Recipe.js\";\nimport { RecipeTag } from \"./RecipeTag.js\";\n\n@Table\nexport class RecipeTags extends Model<RecipeTags> {\n @ForeignKey(() => Recipe)\n @Column(DataType.UUID)\n declare recipeUuid: string;\n\n @ForeignKey(() => RecipeTag)\n @Column(DataType.UUID)\n declare recipeTagUuid: string;\n}\n"],"names":["Column","DataType","ForeignKey","Model","Table","Recipe","RecipeTag","RecipeTags","UUID"],"mappings":";;;;;;AAAA,SACEA,MAAM,EACNC,QAAQ,EACRC,UAAU,EACVC,KAAK,EACLC,KAAK,QACA,uBAAuB;AAC9B,SAASC,MAAM,QAAQ,cAAc;AACrC,SAASC,SAAS,QAAQ,iBAAiB;AAG3C,OAAO,MAAMC,mBAAmBJ;AAQhC;;mBAPoBE;oBACDG;;;mBAGCF;oBACDE"}