90dc-core 1.12.16 → 1.12.18
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.
- package/dist/lib/dbmodels/index.d.ts +5 -2
- package/dist/lib/dbmodels/index.d.ts.map +1 -1
- package/dist/lib/dbmodels/index.js +7 -1
- package/dist/lib/dbmodels/index.js.map +1 -1
- package/dist/lib/dbmodels/subscription/SubscriptionEvent.d.ts +15 -0
- package/dist/lib/dbmodels/subscription/SubscriptionEvent.d.ts.map +1 -0
- package/dist/lib/dbmodels/subscription/SubscriptionEvent.js +79 -0
- package/dist/lib/dbmodels/subscription/SubscriptionEvent.js.map +1 -0
- package/dist/lib/dbmodels/subscription/SubscriptionRefund.d.ts +17 -0
- package/dist/lib/dbmodels/subscription/SubscriptionRefund.d.ts.map +1 -0
- package/dist/lib/dbmodels/subscription/SubscriptionRefund.js +92 -0
- package/dist/lib/dbmodels/subscription/SubscriptionRefund.js.map +1 -0
- package/dist/lib/utils/NotificationClient.d.ts +12 -0
- package/dist/lib/utils/NotificationClient.d.ts.map +1 -1
- package/dist/lib/utils/NotificationClient.js +13 -0
- package/dist/lib/utils/NotificationClient.js.map +1 -1
- package/package.json +1 -1
|
@@ -9,6 +9,8 @@ export { UserAddons } from "./user/UserAddons.js";
|
|
|
9
9
|
export { DeviceTokens } from "./user/DeviceTokens.js";
|
|
10
10
|
export { Subscription } from "./subscription/Subscription.js";
|
|
11
11
|
export { SubscriptionLog } from "./subscription/SubscriptionLog.js";
|
|
12
|
+
export { SubscriptionEvent } from "./subscription/SubscriptionEvent.js";
|
|
13
|
+
export { SubscriptionRefund } from "./subscription/SubscriptionRefund.js";
|
|
12
14
|
export { Program } from "./program/Program.js";
|
|
13
15
|
export { Workout } from "./program/Workout.js";
|
|
14
16
|
export { Exercise } from "./program/Exercise.js";
|
|
@@ -145,13 +147,14 @@ import { XpTransaction } from "./gamification/xpAndLeaderboards/XpTransaction.js
|
|
|
145
147
|
import { UserRankHistory } from "./gamification/xpAndLeaderboards/UserRankHistory.js";
|
|
146
148
|
import { NotificationModels } from "./notifications/NotificationModels.js";
|
|
147
149
|
import { TranslatedNotification } from "./notifications/TranslatedNotification.js";
|
|
150
|
+
import { SubscriptionRefund } from "./subscription/SubscriptionRefund.js";
|
|
148
151
|
export declare const USER_MODELS: (typeof PersistedUser | typeof UserBadges | typeof UserStreak | typeof UsersFriends | typeof UserCoach | typeof UserDiscount | typeof UserOptions | typeof UserAddons | typeof DeviceTokens)[];
|
|
149
|
-
export declare const SUBSCRIPTION_MODELS: (typeof SubscriptionLog | typeof Subscription)[];
|
|
152
|
+
export declare const SUBSCRIPTION_MODELS: (typeof SubscriptionLog | typeof Subscription | typeof SubscriptionRefund)[];
|
|
150
153
|
export declare const PROGRAM_MODELS: (typeof TranslatedChallenge | typeof Challenge | typeof ProgressEntry | typeof Exercise | typeof UserChallenge | typeof TranslatedStrengthTestExercise | typeof StrengthTestExercise | typeof UserStrengthTests | typeof TranslatedExerciseModel | typeof ExercisesModels | typeof Workout | typeof Superset | typeof Program | typeof TranslatedStrengthTest | typeof StrengthTest | typeof ChallengeBlueprint | typeof CustomProgramBlueprint | typeof CustomStrengthTestExercise | typeof CustomWorkoutBlueprint | typeof RestDay | typeof WorkoutSession | typeof ThirtyDayChallenge | typeof ThirtyDayChallengeStrengthTest | typeof StrengthTestSession)[];
|
|
151
154
|
export declare const NON_CONSUMABLE_PROGRAM_MODELS: (typeof TranslatedConsumableProgram | typeof NonConsumableProgram | typeof UserPrograms | typeof TranslatedNonConsumableProgramWebContent | typeof NonConsumableProgramWebContent)[];
|
|
152
155
|
export declare const DIET_MODELS: (typeof RecipeTags | typeof Recipe | typeof RecipeTag | typeof TranslatedRecipeTag | typeof TranslatedRecipeTags | typeof TranslatedRecipe | typeof IngredientTags | typeof Ingredient | typeof IngredientTag | typeof RecipeIngredient | typeof DietMealRecipeIngredient | typeof DietMealRecipe | typeof DietMeal | typeof DietDay | typeof DietProgram | typeof ShoppingListItem | typeof ShoppingList | typeof DietMealCompletion | typeof UserDietPreferences)[];
|
|
153
156
|
export declare const COACHING_MODELS: (typeof WeeklyCheckin | typeof WeightRecord | typeof Question | typeof Questionnaire | typeof Answer | typeof QuestionnaireResponse)[];
|
|
154
157
|
export declare const GAMIFICATION_MODELS: (typeof TranslatedBadge | typeof Badge | typeof StreaksLog | typeof XpEvent | typeof XpTransaction | typeof UserRankHistory)[];
|
|
155
158
|
export declare const NOTIFICATION_MODELS: (typeof TranslatedNotification | typeof NotificationModels)[];
|
|
156
|
-
export declare const ALL_CORE_MODELS: (typeof TranslatedChallenge | typeof Challenge | typeof ProgressEntry | typeof Exercise | typeof UserChallenge | typeof TranslatedStrengthTestExercise | typeof StrengthTestExercise | typeof UserStrengthTests | typeof TranslatedExerciseModel | typeof ExercisesModels | typeof Workout | typeof Superset | typeof Program | typeof TranslatedConsumableProgram | typeof NonConsumableProgram | typeof SubscriptionLog | typeof Subscription | typeof PersistedUser | typeof UserPrograms | typeof TranslatedNonConsumableProgramWebContent | typeof NonConsumableProgramWebContent | typeof TranslatedStrengthTest | typeof StrengthTest | typeof TranslatedBadge | typeof Badge | typeof UserBadges | typeof UserStreak | typeof UsersFriends | typeof UserCoach | typeof UserDiscount | typeof UserOptions | typeof UserAddons | typeof DeviceTokens | typeof ChallengeBlueprint | typeof CustomProgramBlueprint | typeof CustomStrengthTestExercise | typeof CustomWorkoutBlueprint | typeof RestDay | typeof WorkoutSession | typeof ThirtyDayChallenge | typeof ThirtyDayChallengeStrengthTest | typeof StrengthTestSession | typeof RecipeTags | typeof Recipe | typeof RecipeTag | typeof TranslatedRecipeTag | typeof TranslatedRecipeTags | typeof TranslatedRecipe | typeof IngredientTags | typeof Ingredient | typeof IngredientTag | typeof RecipeIngredient | typeof DietMealRecipeIngredient | typeof DietMealRecipe | typeof DietMeal | typeof DietDay | typeof DietProgram | typeof ShoppingListItem | typeof ShoppingList | typeof DietMealCompletion | typeof UserDietPreferences | typeof WeeklyCheckin | typeof WeightRecord | typeof Question | typeof Questionnaire | typeof Answer | typeof QuestionnaireResponse | typeof StreaksLog | typeof XpEvent | typeof XpTransaction | typeof UserRankHistory | typeof TranslatedNotification | typeof NotificationModels)[];
|
|
159
|
+
export declare const ALL_CORE_MODELS: (typeof TranslatedChallenge | typeof Challenge | typeof ProgressEntry | typeof Exercise | typeof UserChallenge | typeof TranslatedStrengthTestExercise | typeof StrengthTestExercise | typeof UserStrengthTests | typeof TranslatedExerciseModel | typeof ExercisesModels | typeof Workout | typeof Superset | typeof Program | typeof TranslatedConsumableProgram | typeof NonConsumableProgram | typeof SubscriptionLog | typeof Subscription | typeof PersistedUser | typeof UserPrograms | typeof TranslatedNonConsumableProgramWebContent | typeof NonConsumableProgramWebContent | typeof TranslatedStrengthTest | typeof StrengthTest | typeof TranslatedBadge | typeof Badge | typeof UserBadges | typeof UserStreak | typeof UsersFriends | typeof UserCoach | typeof UserDiscount | typeof UserOptions | typeof UserAddons | typeof DeviceTokens | typeof SubscriptionRefund | typeof ChallengeBlueprint | typeof CustomProgramBlueprint | typeof CustomStrengthTestExercise | typeof CustomWorkoutBlueprint | typeof RestDay | typeof WorkoutSession | typeof ThirtyDayChallenge | typeof ThirtyDayChallengeStrengthTest | typeof StrengthTestSession | typeof RecipeTags | typeof Recipe | typeof RecipeTag | typeof TranslatedRecipeTag | typeof TranslatedRecipeTags | typeof TranslatedRecipe | typeof IngredientTags | typeof Ingredient | typeof IngredientTag | typeof RecipeIngredient | typeof DietMealRecipeIngredient | typeof DietMealRecipe | typeof DietMeal | typeof DietDay | typeof DietProgram | typeof ShoppingListItem | typeof ShoppingList | typeof DietMealCompletion | typeof UserDietPreferences | typeof WeeklyCheckin | typeof WeightRecord | typeof Question | typeof Questionnaire | typeof Answer | typeof QuestionnaireResponse | typeof StreaksLog | typeof XpEvent | typeof XpTransaction | typeof UserRankHistory | typeof TranslatedNotification | typeof NotificationModels)[];
|
|
157
160
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/dbmodels/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/dbmodels/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAGtD,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAG1E,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,cAAc,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6B,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,6CAA6C,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,mDAAmD,CAAC;AAClF,OAAO,EAAE,eAAe,EAAE,MAAM,qDAAqD,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AACnF,OAAO,EAAC,kBAAkB,EAAC,MAAM,sCAAsC,CAAC;AAIxE,eAAO,MAAM,WAAW,gMAUvB,CAAC;AAEF,eAAO,MAAM,mBAAmB,8EAAyE,CAAC;AAE1G,eAAO,MAAM,cAAc,koBA0B1B,CAAC;AAEF,eAAO,MAAM,6BAA6B,sLAMzC,CAAC;AAEF,eAAO,MAAM,WAAW,ucAoBvB,CAAC;AAEF,eAAO,MAAM,eAAe,wIAO3B,CAAC;AAEF,eAAO,MAAM,mBAAmB,gIAO/B,CAAC;AAEF,eAAO,MAAM,mBAAmB,+DAA+C,CAAC;AAGhF,eAAO,MAAM,eAAe,+zDAS3B,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// User Models
|
|
2
|
+
import { SubscriptionEvent } from "./subscription/SubscriptionEvent.js";
|
|
2
3
|
export { PersistedUser } from "./user/PersistedUser.js";
|
|
3
4
|
export { UserBadges } from "./user/UserBadges.js";
|
|
4
5
|
export { UserStreak } from "./user/UserStreaks.js";
|
|
@@ -11,6 +12,8 @@ export { DeviceTokens } from "./user/DeviceTokens.js";
|
|
|
11
12
|
// Subscription Models
|
|
12
13
|
export { Subscription } from "./subscription/Subscription.js";
|
|
13
14
|
export { SubscriptionLog } from "./subscription/SubscriptionLog.js";
|
|
15
|
+
export { SubscriptionEvent } from "./subscription/SubscriptionEvent.js";
|
|
16
|
+
export { SubscriptionRefund } from "./subscription/SubscriptionRefund.js";
|
|
14
17
|
// Program Models
|
|
15
18
|
export { Program } from "./program/Program.js";
|
|
16
19
|
export { Workout } from "./program/Workout.js";
|
|
@@ -155,6 +158,7 @@ import { XpTransaction } from "./gamification/xpAndLeaderboards/XpTransaction.js
|
|
|
155
158
|
import { UserRankHistory } from "./gamification/xpAndLeaderboards/UserRankHistory.js";
|
|
156
159
|
import { NotificationModels } from "./notifications/NotificationModels.js";
|
|
157
160
|
import { TranslatedNotification } from "./notifications/TranslatedNotification.js";
|
|
161
|
+
import { SubscriptionRefund } from "./subscription/SubscriptionRefund.js";
|
|
158
162
|
// Model Arrays - grouped by domain
|
|
159
163
|
export const USER_MODELS = [
|
|
160
164
|
PersistedUser,
|
|
@@ -169,7 +173,9 @@ export const USER_MODELS = [
|
|
|
169
173
|
];
|
|
170
174
|
export const SUBSCRIPTION_MODELS = [
|
|
171
175
|
Subscription,
|
|
172
|
-
SubscriptionLog
|
|
176
|
+
SubscriptionLog,
|
|
177
|
+
SubscriptionEvent,
|
|
178
|
+
SubscriptionRefund
|
|
173
179
|
];
|
|
174
180
|
export const PROGRAM_MODELS = [
|
|
175
181
|
Program,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/dbmodels/index.ts"],"sourcesContent":["// User Models\nexport { PersistedUser } from \"./user/PersistedUser.js\";\nexport { UserBadges } from \"./user/UserBadges.js\";\nexport { UserStreak } from \"./user/UserStreaks.js\";\nexport { UsersFriends } from \"./user/UsersFriends.js\";\nexport { UserCoach } from \"./user/UserCoach.js\";\nexport { UserDiscount } from \"./user/UserDiscount.js\";\nexport { UserOptions } from \"./user/UserOptions.js\";\nexport { UserAddons } from \"./user/UserAddons.js\";\nexport { DeviceTokens } from \"./user/DeviceTokens.js\";\n\n// Subscription Models\nexport { Subscription } from \"./subscription/Subscription.js\";\nexport { SubscriptionLog } from \"./subscription/SubscriptionLog.js\";\n\n// Program Models\nexport { Program } from \"./program/Program.js\";\nexport { Workout } from \"./program/Workout.js\";\nexport { Exercise } from \"./program/Exercise.js\";\nexport { ExercisesModels } from \"./program/ExerciseModels.js\";\nexport { Superset } from \"./program/Superset.js\";\nexport { ProgressEntry } from \"./program/ProgressEntry.js\";\nexport { RestDay } from \"./program/RestDay.js\";\nexport { WorkoutSession } from \"./program/WorkoutSession.js\";\nexport { Challenge } from \"./program/Challenge.js\";\nexport { ChallengeBlueprint } from \"./program/ChallengeBlueprint.js\";\nexport { UserChallenge } from \"./program/UserChallenge.js\";\nexport { TranslatedChallenge } from \"./program/TranslatedChallenge.js\";\nexport { ThirtyDayChallenge } from \"./program/ThirtyDayChallenge.js\";\nexport { ThirtyDayChallengeStrengthTest } from \"./program/ThirtyDayChallengeStrengthTest.js\";\nexport { StrengthTest } from \"./program/StrengthTest.js\";\nexport { StrengthTestExercise } from \"./program/StrengthTestExercise.js\";\nexport { StrengthTestSession } from \"./program/StrengthTestSession.js\";\nexport { UserStrengthTests } from \"./program/UserStrengthTests.js\";\nexport { TranslatedStrengthTest } from \"./program/TranslatedStrengthTest.js\";\nexport { TranslatedStrengthTestExercise } from \"./program/TranslatedStrengthTestExercise.js\";\nexport { TranslatedExerciseModel } from \"./program/TranslatedExerciseModel.js\";\nexport { CustomProgramBlueprint } from \"./program/CustomProgramBlueprint.js\";\nexport { CustomWorkoutBlueprint } from \"./program/CustomWorkoutBlueprint.js\";\nexport { CustomStrengthTest } from \"./program/CustomStrengthTest.js\";\nexport { CustomStrengthTestExercise } from \"./program/CustomStrengthTestExercises.js\";\n\n// Non-Consumable Program Models\nexport { NonConsumableProgram } from \"./nonconsprogram/NonConsumableProgram.js\";\nexport { NonConsumableProgramWebContent } from \"./nonconsprogram/NonConsumableProgramWebContent.js\";\nexport { UserPrograms } from \"./nonconsprogram/UserNonConsumableProgram.js\";\nexport { TranslatedConsumableProgram } from \"./nonconsprogram/TranslatedConsumableProgram.js\";\nexport { TranslatedNonConsumableProgramWebContent } from \"./nonconsprogram/TranslatedNonConsumableProgramWebContent.js\";\n\n// Diet & Nutrition Models\nexport { DietProgram } from \"./diet/DietProgram.js\";\nexport { DietDay } from \"./diet/DietDay.js\";\nexport { DietMeal } from \"./diet/DietMeal.js\";\nexport { DietMealRecipe } from \"./diet/DietMealRecipe.js\";\nexport { DietMealRecipeIngredient } from \"./diet/DietMealRecipeIngredient.js\";\nexport { DietMealCompletion } from \"./diet/DietMealCompletion.js\";\nexport { Recipe } from \"./diet/Recipe.js\";\nexport { TranslatedRecipe } from \"./diet/TranslatedRecipe.js\";\nexport { RecipeTag } from \"./diet/RecipeTag.js\";\nexport { TranslatedRecipeTag } from \"./diet/TranslatedRecipeTag.js\";\nexport { RecipeTags } from \"./diet/RecipeTags.js\";\nexport { TranslatedRecipeTags } from \"./diet/TranslatedRecipeTags.js\";\nexport { ShoppingList } from \"./diet/ShoppingList.js\";\nexport { ShoppingListItem } from \"./diet/ShoppingListItem.js\";\nexport { UserDietPreferences } from \"./diet/UserDietPreferences.js\";\nexport { Ingredient } from \"./diet/Ingredient.js\";\nexport { IngredientTag } from \"./diet/IngredientTag.js\";\nexport { IngredientTags } from \"./diet/IngredientTags.js\";\nexport { RecipeIngredient } from \"./diet/RecipeIngredient.js\";\n\n// Coaching Models\nexport { WeeklyCheckin } from \"./coaching/WeeklyCheckIn.js\";\nexport { WeightRecord } from \"./coaching/WeightRecord.js\";\nexport { Questionnaire, QuestionnaireType } from \"./coaching/Questionnaire.js\";\nexport { Question, QuestionType } from \"./coaching/Question.js\";\nexport { Answer } from \"./coaching/Answer.js\";\nexport { QuestionnaireResponse } from \"./coaching/QuestionnaireResponse.js\";\n\n// Gamification Models\nexport { Badge } from \"./gamification/Badge.js\";\nexport { TranslatedBadge } from \"./gamification/TranslatedBadge.js\";\nexport { StreaksLog } from \"./gamification/StreaksLog.js\";\nexport { XpEvent } from \"./gamification/xpAndLeaderboards/XpEvent.js\";\nexport { XpTransaction } from \"./gamification/xpAndLeaderboards/XpTransaction.js\";\nexport { UserRankHistory } from \"./gamification/xpAndLeaderboards/UserRankHistory.js\";\n\n// Notification Models\nexport { NotificationModels } from \"./notifications/NotificationModels.js\";\nexport { TranslatedNotification } from \"./notifications/TranslatedNotification.js\";\n\n// Import for model arrays\nimport { PersistedUser } from \"./user/PersistedUser.js\";\nimport { UserBadges } from \"./user/UserBadges.js\";\nimport { UserStreak } from \"./user/UserStreaks.js\";\nimport { UsersFriends } from \"./user/UsersFriends.js\";\nimport { UserCoach } from \"./user/UserCoach.js\";\nimport { UserDiscount } from \"./user/UserDiscount.js\";\nimport { UserOptions } from \"./user/UserOptions.js\";\nimport { UserAddons } from \"./user/UserAddons.js\";\nimport { DeviceTokens } from \"./user/DeviceTokens.js\";\nimport { Subscription } from \"./subscription/Subscription.js\";\nimport { SubscriptionLog } from \"./subscription/SubscriptionLog.js\";\nimport { Program } from \"./program/Program.js\";\nimport { Workout } from \"./program/Workout.js\";\nimport { Exercise } from \"./program/Exercise.js\";\nimport { ExercisesModels } from \"./program/ExerciseModels.js\";\nimport { Superset } from \"./program/Superset.js\";\nimport { ProgressEntry } from \"./program/ProgressEntry.js\";\nimport { RestDay } from \"./program/RestDay.js\";\nimport { WorkoutSession } from \"./program/WorkoutSession.js\";\nimport { Challenge } from \"./program/Challenge.js\";\nimport { ChallengeBlueprint } from \"./program/ChallengeBlueprint.js\";\nimport { UserChallenge } from \"./program/UserChallenge.js\";\nimport { TranslatedChallenge } from \"./program/TranslatedChallenge.js\";\nimport { ThirtyDayChallenge } from \"./program/ThirtyDayChallenge.js\";\nimport { ThirtyDayChallengeStrengthTest } from \"./program/ThirtyDayChallengeStrengthTest.js\";\nimport { StrengthTest } from \"./program/StrengthTest.js\";\nimport { StrengthTestExercise } from \"./program/StrengthTestExercise.js\";\nimport { StrengthTestSession } from \"./program/StrengthTestSession.js\";\nimport { UserStrengthTests } from \"./program/UserStrengthTests.js\";\nimport { TranslatedStrengthTest } from \"./program/TranslatedStrengthTest.js\";\nimport { TranslatedStrengthTestExercise } from \"./program/TranslatedStrengthTestExercise.js\";\nimport { TranslatedExerciseModel } from \"./program/TranslatedExerciseModel.js\";\nimport { CustomProgramBlueprint } from \"./program/CustomProgramBlueprint.js\";\nimport { CustomWorkoutBlueprint } from \"./program/CustomWorkoutBlueprint.js\";\nimport { CustomStrengthTest } from \"./program/CustomStrengthTest.js\";\nimport { CustomStrengthTestExercise } from \"./program/CustomStrengthTestExercises.js\";\nimport { NonConsumableProgram } from \"./nonconsprogram/NonConsumableProgram.js\";\nimport { NonConsumableProgramWebContent } from \"./nonconsprogram/NonConsumableProgramWebContent.js\";\nimport { UserPrograms } from \"./nonconsprogram/UserNonConsumableProgram.js\";\nimport { TranslatedConsumableProgram } from \"./nonconsprogram/TranslatedConsumableProgram.js\";\nimport { TranslatedNonConsumableProgramWebContent } from \"./nonconsprogram/TranslatedNonConsumableProgramWebContent.js\";\nimport { DietProgram } from \"./diet/DietProgram.js\";\nimport { DietDay } from \"./diet/DietDay.js\";\nimport { DietMeal } from \"./diet/DietMeal.js\";\nimport { DietMealRecipe } from \"./diet/DietMealRecipe.js\";\nimport { DietMealRecipeIngredient } from \"./diet/DietMealRecipeIngredient.js\";\nimport { DietMealCompletion } from \"./diet/DietMealCompletion.js\";\nimport { Recipe } from \"./diet/Recipe.js\";\nimport { TranslatedRecipe } from \"./diet/TranslatedRecipe.js\";\nimport { RecipeTag } from \"./diet/RecipeTag.js\";\nimport { TranslatedRecipeTag } from \"./diet/TranslatedRecipeTag.js\";\nimport { RecipeTags } from \"./diet/RecipeTags.js\";\nimport { TranslatedRecipeTags } from \"./diet/TranslatedRecipeTags.js\";\nimport { ShoppingList } from \"./diet/ShoppingList.js\";\nimport { ShoppingListItem } from \"./diet/ShoppingListItem.js\";\nimport { UserDietPreferences } from \"./diet/UserDietPreferences.js\";\nimport { Ingredient } from \"./diet/Ingredient.js\";\nimport { IngredientTag } from \"./diet/IngredientTag.js\";\nimport { IngredientTags } from \"./diet/IngredientTags.js\";\nimport { RecipeIngredient } from \"./diet/RecipeIngredient.js\";\nimport { WeeklyCheckin } from \"./coaching/WeeklyCheckIn.js\";\nimport { WeightRecord } from \"./coaching/WeightRecord.js\";\nimport { Questionnaire } from \"./coaching/Questionnaire.js\";\nimport { Question } from \"./coaching/Question.js\";\nimport { Answer } from \"./coaching/Answer.js\";\nimport { QuestionnaireResponse } from \"./coaching/QuestionnaireResponse.js\";\nimport { Badge } from \"./gamification/Badge.js\";\nimport { TranslatedBadge } from \"./gamification/TranslatedBadge.js\";\nimport { StreaksLog } from \"./gamification/StreaksLog.js\";\nimport { XpEvent } from \"./gamification/xpAndLeaderboards/XpEvent.js\";\nimport { XpTransaction } from \"./gamification/xpAndLeaderboards/XpTransaction.js\";\nimport { UserRankHistory } from \"./gamification/xpAndLeaderboards/UserRankHistory.js\";\nimport { NotificationModels } from \"./notifications/NotificationModels.js\";\nimport { TranslatedNotification } from \"./notifications/TranslatedNotification.js\";\n\n// Model Arrays - grouped by domain\nexport const USER_MODELS = [\n PersistedUser,\n UserBadges,\n UserStreak,\n UsersFriends,\n UserCoach,\n UserDiscount,\n UserOptions,\n UserAddons,\n DeviceTokens,\n];\n\nexport const SUBSCRIPTION_MODELS = [Subscription, SubscriptionLog];\n\nexport const PROGRAM_MODELS = [\n Program,\n Workout,\n Exercise,\n ExercisesModels,\n Superset,\n ProgressEntry,\n RestDay,\n WorkoutSession,\n Challenge,\n ChallengeBlueprint,\n UserChallenge,\n TranslatedChallenge,\n ThirtyDayChallenge,\n ThirtyDayChallengeStrengthTest,\n StrengthTest,\n StrengthTestExercise,\n StrengthTestSession,\n UserStrengthTests,\n TranslatedStrengthTest,\n TranslatedStrengthTestExercise,\n TranslatedExerciseModel,\n CustomProgramBlueprint,\n CustomWorkoutBlueprint,\n CustomStrengthTest,\n CustomStrengthTestExercise,\n];\n\nexport const NON_CONSUMABLE_PROGRAM_MODELS = [\n NonConsumableProgram,\n NonConsumableProgramWebContent,\n UserPrograms,\n TranslatedConsumableProgram,\n TranslatedNonConsumableProgramWebContent,\n];\n\nexport const DIET_MODELS = [\n DietProgram,\n DietDay,\n DietMeal,\n DietMealRecipe,\n DietMealRecipeIngredient,\n DietMealCompletion,\n Recipe,\n TranslatedRecipe,\n RecipeTag,\n TranslatedRecipeTag,\n RecipeTags,\n TranslatedRecipeTags,\n ShoppingList,\n ShoppingListItem,\n UserDietPreferences,\n Ingredient,\n IngredientTag,\n IngredientTags,\n RecipeIngredient,\n];\n\nexport const COACHING_MODELS = [\n WeeklyCheckin,\n WeightRecord,\n Questionnaire,\n Question,\n Answer,\n QuestionnaireResponse,\n];\n\nexport const GAMIFICATION_MODELS = [\n Badge,\n TranslatedBadge,\n StreaksLog,\n XpEvent,\n XpTransaction,\n UserRankHistory,\n];\n\nexport const NOTIFICATION_MODELS = [NotificationModels, TranslatedNotification];\n\n// All core models combined\nexport const ALL_CORE_MODELS = [\n ...USER_MODELS,\n ...SUBSCRIPTION_MODELS,\n ...PROGRAM_MODELS,\n ...NON_CONSUMABLE_PROGRAM_MODELS,\n ...DIET_MODELS,\n ...COACHING_MODELS,\n ...GAMIFICATION_MODELS,\n ...NOTIFICATION_MODELS,\n];\n"],"names":["PersistedUser","UserBadges","UserStreak","UsersFriends","UserCoach","UserDiscount","UserOptions","UserAddons","DeviceTokens","Subscription","SubscriptionLog","Program","Workout","Exercise","ExercisesModels","Superset","ProgressEntry","RestDay","WorkoutSession","Challenge","ChallengeBlueprint","UserChallenge","TranslatedChallenge","ThirtyDayChallenge","ThirtyDayChallengeStrengthTest","StrengthTest","StrengthTestExercise","StrengthTestSession","UserStrengthTests","TranslatedStrengthTest","TranslatedStrengthTestExercise","TranslatedExerciseModel","CustomProgramBlueprint","CustomWorkoutBlueprint","CustomStrengthTest","CustomStrengthTestExercise","NonConsumableProgram","NonConsumableProgramWebContent","UserPrograms","TranslatedConsumableProgram","TranslatedNonConsumableProgramWebContent","DietProgram","DietDay","DietMeal","DietMealRecipe","DietMealRecipeIngredient","DietMealCompletion","Recipe","TranslatedRecipe","RecipeTag","TranslatedRecipeTag","RecipeTags","TranslatedRecipeTags","ShoppingList","ShoppingListItem","UserDietPreferences","Ingredient","IngredientTag","IngredientTags","RecipeIngredient","WeeklyCheckin","WeightRecord","Questionnaire","QuestionnaireType","Question","QuestionType","Answer","QuestionnaireResponse","Badge","TranslatedBadge","StreaksLog","XpEvent","XpTransaction","UserRankHistory","NotificationModels","TranslatedNotification","USER_MODELS","SUBSCRIPTION_MODELS","PROGRAM_MODELS","NON_CONSUMABLE_PROGRAM_MODELS","DIET_MODELS","COACHING_MODELS","GAMIFICATION_MODELS","NOTIFICATION_MODELS","ALL_CORE_MODELS"],"mappings":"AAAA,cAAc;AACd,SAASA,aAAa,QAAQ,0BAA0B;AACxD,SAASC,UAAU,QAAQ,uBAAuB;AAClD,SAASC,UAAU,QAAQ,wBAAwB;AACnD,SAASC,YAAY,QAAQ,yBAAyB;AACtD,SAASC,SAAS,QAAQ,sBAAsB;AAChD,SAASC,YAAY,QAAQ,yBAAyB;AACtD,SAASC,WAAW,QAAQ,wBAAwB;AACpD,SAASC,UAAU,QAAQ,uBAAuB;AAClD,SAASC,YAAY,QAAQ,yBAAyB;AAEtD,sBAAsB;AACtB,SAASC,YAAY,QAAQ,iCAAiC;AAC9D,SAASC,eAAe,QAAQ,oCAAoC;AAEpE,iBAAiB;AACjB,SAASC,OAAO,QAAQ,uBAAuB;AAC/C,SAASC,OAAO,QAAQ,uBAAuB;AAC/C,SAASC,QAAQ,QAAQ,wBAAwB;AACjD,SAASC,eAAe,QAAQ,8BAA8B;AAC9D,SAASC,QAAQ,QAAQ,wBAAwB;AACjD,SAASC,aAAa,QAAQ,6BA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EnE,OAAO,MAAMoE,iBAAiB;IAC1BnE;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;CACH,CAAC;AAEF,OAAO,MAAM4C,gCAAgC;IACzC3C;IACAC;IACAC;IACAC;IACAC;CACH,CAAC;AAEF,OAAO,MAAMwC,cAAc;IACvBvC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;CACH,CAAC;AAEF,OAAO,MAAMsB,kBAAkB;IAC3BrB;IACAC;IACAC;IACAE;IACAE;IACAC;CACH,CAAC;AAEF,OAAO,MAAMe,sBAAsB;IAC/Bd;IACAC;IACAC;IACAC;IACAC;IACAC;CACH,CAAC;AAEF,OAAO,MAAMU,sBAAsB;IAACT;IAAoBC;CAAuB,CAAC;AAEhF,2BAA2B;AAC3B,OAAO,MAAMS,kBAAkB;OACxBR;OACAC;OACAC;OACAC;OACAC;OACAC;OACAC;OACAC;CACN,CAAC"}
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/dbmodels/index.ts"],"sourcesContent":["// User Models\nimport {SubscriptionEvent} from \"./subscription/SubscriptionEvent.js\";\n\nexport { PersistedUser } from \"./user/PersistedUser.js\";\nexport { UserBadges } from \"./user/UserBadges.js\";\nexport { UserStreak } from \"./user/UserStreaks.js\";\nexport { UsersFriends } from \"./user/UsersFriends.js\";\nexport { UserCoach } from \"./user/UserCoach.js\";\nexport { UserDiscount } from \"./user/UserDiscount.js\";\nexport { UserOptions } from \"./user/UserOptions.js\";\nexport { UserAddons } from \"./user/UserAddons.js\";\nexport { DeviceTokens } from \"./user/DeviceTokens.js\";\n\n// Subscription Models\nexport { Subscription } from \"./subscription/Subscription.js\";\nexport { SubscriptionLog } from \"./subscription/SubscriptionLog.js\";\nexport { SubscriptionEvent } from \"./subscription/SubscriptionEvent.js\";\nexport { SubscriptionRefund } from \"./subscription/SubscriptionRefund.js\";\n\n// Program Models\nexport { Program } from \"./program/Program.js\";\nexport { Workout } from \"./program/Workout.js\";\nexport { Exercise } from \"./program/Exercise.js\";\nexport { ExercisesModels } from \"./program/ExerciseModels.js\";\nexport { Superset } from \"./program/Superset.js\";\nexport { ProgressEntry } from \"./program/ProgressEntry.js\";\nexport { RestDay } from \"./program/RestDay.js\";\nexport { WorkoutSession } from \"./program/WorkoutSession.js\";\nexport { Challenge } from \"./program/Challenge.js\";\nexport { ChallengeBlueprint } from \"./program/ChallengeBlueprint.js\";\nexport { UserChallenge } from \"./program/UserChallenge.js\";\nexport { TranslatedChallenge } from \"./program/TranslatedChallenge.js\";\nexport { ThirtyDayChallenge } from \"./program/ThirtyDayChallenge.js\";\nexport { ThirtyDayChallengeStrengthTest } from \"./program/ThirtyDayChallengeStrengthTest.js\";\nexport { StrengthTest } from \"./program/StrengthTest.js\";\nexport { StrengthTestExercise } from \"./program/StrengthTestExercise.js\";\nexport { StrengthTestSession } from \"./program/StrengthTestSession.js\";\nexport { UserStrengthTests } from \"./program/UserStrengthTests.js\";\nexport { TranslatedStrengthTest } from \"./program/TranslatedStrengthTest.js\";\nexport { TranslatedStrengthTestExercise } from \"./program/TranslatedStrengthTestExercise.js\";\nexport { TranslatedExerciseModel } from \"./program/TranslatedExerciseModel.js\";\nexport { CustomProgramBlueprint } from \"./program/CustomProgramBlueprint.js\";\nexport { CustomWorkoutBlueprint } from \"./program/CustomWorkoutBlueprint.js\";\nexport { CustomStrengthTest } from \"./program/CustomStrengthTest.js\";\nexport { CustomStrengthTestExercise } from \"./program/CustomStrengthTestExercises.js\";\n\n// Non-Consumable Program Models\nexport { NonConsumableProgram } from \"./nonconsprogram/NonConsumableProgram.js\";\nexport { NonConsumableProgramWebContent } from \"./nonconsprogram/NonConsumableProgramWebContent.js\";\nexport { UserPrograms } from \"./nonconsprogram/UserNonConsumableProgram.js\";\nexport { TranslatedConsumableProgram } from \"./nonconsprogram/TranslatedConsumableProgram.js\";\nexport { TranslatedNonConsumableProgramWebContent } from \"./nonconsprogram/TranslatedNonConsumableProgramWebContent.js\";\n\n// Diet & Nutrition Models\nexport { DietProgram } from \"./diet/DietProgram.js\";\nexport { DietDay } from \"./diet/DietDay.js\";\nexport { DietMeal } from \"./diet/DietMeal.js\";\nexport { DietMealRecipe } from \"./diet/DietMealRecipe.js\";\nexport { DietMealRecipeIngredient } from \"./diet/DietMealRecipeIngredient.js\";\nexport { DietMealCompletion } from \"./diet/DietMealCompletion.js\";\nexport { Recipe } from \"./diet/Recipe.js\";\nexport { TranslatedRecipe } from \"./diet/TranslatedRecipe.js\";\nexport { RecipeTag } from \"./diet/RecipeTag.js\";\nexport { TranslatedRecipeTag } from \"./diet/TranslatedRecipeTag.js\";\nexport { RecipeTags } from \"./diet/RecipeTags.js\";\nexport { TranslatedRecipeTags } from \"./diet/TranslatedRecipeTags.js\";\nexport { ShoppingList } from \"./diet/ShoppingList.js\";\nexport { ShoppingListItem } from \"./diet/ShoppingListItem.js\";\nexport { UserDietPreferences } from \"./diet/UserDietPreferences.js\";\nexport { Ingredient } from \"./diet/Ingredient.js\";\nexport { IngredientTag } from \"./diet/IngredientTag.js\";\nexport { IngredientTags } from \"./diet/IngredientTags.js\";\nexport { RecipeIngredient } from \"./diet/RecipeIngredient.js\";\n\n// Coaching Models\nexport { WeeklyCheckin } from \"./coaching/WeeklyCheckIn.js\";\nexport { WeightRecord } from \"./coaching/WeightRecord.js\";\nexport { Questionnaire, QuestionnaireType } from \"./coaching/Questionnaire.js\";\nexport { Question, QuestionType } from \"./coaching/Question.js\";\nexport { Answer } from \"./coaching/Answer.js\";\nexport { QuestionnaireResponse } from \"./coaching/QuestionnaireResponse.js\";\n\n// Gamification Models\nexport { Badge } from \"./gamification/Badge.js\";\nexport { TranslatedBadge } from \"./gamification/TranslatedBadge.js\";\nexport { StreaksLog } from \"./gamification/StreaksLog.js\";\nexport { XpEvent } from \"./gamification/xpAndLeaderboards/XpEvent.js\";\nexport { XpTransaction } from \"./gamification/xpAndLeaderboards/XpTransaction.js\";\nexport { UserRankHistory } from \"./gamification/xpAndLeaderboards/UserRankHistory.js\";\n\n// Notification Models\nexport { NotificationModels } from \"./notifications/NotificationModels.js\";\nexport { TranslatedNotification } from \"./notifications/TranslatedNotification.js\";\n\n// Import for model arrays\nimport { PersistedUser } from \"./user/PersistedUser.js\";\nimport { UserBadges } from \"./user/UserBadges.js\";\nimport { UserStreak } from \"./user/UserStreaks.js\";\nimport { UsersFriends } from \"./user/UsersFriends.js\";\nimport { UserCoach } from \"./user/UserCoach.js\";\nimport { UserDiscount } from \"./user/UserDiscount.js\";\nimport { UserOptions } from \"./user/UserOptions.js\";\nimport { UserAddons } from \"./user/UserAddons.js\";\nimport { DeviceTokens } from \"./user/DeviceTokens.js\";\nimport { Subscription } from \"./subscription/Subscription.js\";\nimport { SubscriptionLog } from \"./subscription/SubscriptionLog.js\";\nimport { Program } from \"./program/Program.js\";\nimport { Workout } from \"./program/Workout.js\";\nimport { Exercise } from \"./program/Exercise.js\";\nimport { ExercisesModels } from \"./program/ExerciseModels.js\";\nimport { Superset } from \"./program/Superset.js\";\nimport { ProgressEntry } from \"./program/ProgressEntry.js\";\nimport { RestDay } from \"./program/RestDay.js\";\nimport { WorkoutSession } from \"./program/WorkoutSession.js\";\nimport { Challenge } from \"./program/Challenge.js\";\nimport { ChallengeBlueprint } from \"./program/ChallengeBlueprint.js\";\nimport { UserChallenge } from \"./program/UserChallenge.js\";\nimport { TranslatedChallenge } from \"./program/TranslatedChallenge.js\";\nimport { ThirtyDayChallenge } from \"./program/ThirtyDayChallenge.js\";\nimport { ThirtyDayChallengeStrengthTest } from \"./program/ThirtyDayChallengeStrengthTest.js\";\nimport { StrengthTest } from \"./program/StrengthTest.js\";\nimport { StrengthTestExercise } from \"./program/StrengthTestExercise.js\";\nimport { StrengthTestSession } from \"./program/StrengthTestSession.js\";\nimport { UserStrengthTests } from \"./program/UserStrengthTests.js\";\nimport { TranslatedStrengthTest } from \"./program/TranslatedStrengthTest.js\";\nimport { TranslatedStrengthTestExercise } from \"./program/TranslatedStrengthTestExercise.js\";\nimport { TranslatedExerciseModel } from \"./program/TranslatedExerciseModel.js\";\nimport { CustomProgramBlueprint } from \"./program/CustomProgramBlueprint.js\";\nimport { CustomWorkoutBlueprint } from \"./program/CustomWorkoutBlueprint.js\";\nimport { CustomStrengthTest } from \"./program/CustomStrengthTest.js\";\nimport { CustomStrengthTestExercise } from \"./program/CustomStrengthTestExercises.js\";\nimport { NonConsumableProgram } from \"./nonconsprogram/NonConsumableProgram.js\";\nimport { NonConsumableProgramWebContent } from \"./nonconsprogram/NonConsumableProgramWebContent.js\";\nimport { UserPrograms } from \"./nonconsprogram/UserNonConsumableProgram.js\";\nimport { TranslatedConsumableProgram } from \"./nonconsprogram/TranslatedConsumableProgram.js\";\nimport { TranslatedNonConsumableProgramWebContent } from \"./nonconsprogram/TranslatedNonConsumableProgramWebContent.js\";\nimport { DietProgram } from \"./diet/DietProgram.js\";\nimport { DietDay } from \"./diet/DietDay.js\";\nimport { DietMeal } from \"./diet/DietMeal.js\";\nimport { DietMealRecipe } from \"./diet/DietMealRecipe.js\";\nimport { DietMealRecipeIngredient } from \"./diet/DietMealRecipeIngredient.js\";\nimport { DietMealCompletion } from \"./diet/DietMealCompletion.js\";\nimport { Recipe } from \"./diet/Recipe.js\";\nimport { TranslatedRecipe } from \"./diet/TranslatedRecipe.js\";\nimport { RecipeTag } from \"./diet/RecipeTag.js\";\nimport { TranslatedRecipeTag } from \"./diet/TranslatedRecipeTag.js\";\nimport { RecipeTags } from \"./diet/RecipeTags.js\";\nimport { TranslatedRecipeTags } from \"./diet/TranslatedRecipeTags.js\";\nimport { ShoppingList } from \"./diet/ShoppingList.js\";\nimport { ShoppingListItem } from \"./diet/ShoppingListItem.js\";\nimport { UserDietPreferences } from \"./diet/UserDietPreferences.js\";\nimport { Ingredient } from \"./diet/Ingredient.js\";\nimport { IngredientTag } from \"./diet/IngredientTag.js\";\nimport { IngredientTags } from \"./diet/IngredientTags.js\";\nimport { RecipeIngredient } from \"./diet/RecipeIngredient.js\";\nimport { WeeklyCheckin } from \"./coaching/WeeklyCheckIn.js\";\nimport { WeightRecord } from \"./coaching/WeightRecord.js\";\nimport { Questionnaire } from \"./coaching/Questionnaire.js\";\nimport { Question } from \"./coaching/Question.js\";\nimport { Answer } from \"./coaching/Answer.js\";\nimport { QuestionnaireResponse } from \"./coaching/QuestionnaireResponse.js\";\nimport { Badge } from \"./gamification/Badge.js\";\nimport { TranslatedBadge } from \"./gamification/TranslatedBadge.js\";\nimport { StreaksLog } from \"./gamification/StreaksLog.js\";\nimport { XpEvent } from \"./gamification/xpAndLeaderboards/XpEvent.js\";\nimport { XpTransaction } from \"./gamification/xpAndLeaderboards/XpTransaction.js\";\nimport { UserRankHistory } from \"./gamification/xpAndLeaderboards/UserRankHistory.js\";\nimport { NotificationModels } from \"./notifications/NotificationModels.js\";\nimport { TranslatedNotification } from \"./notifications/TranslatedNotification.js\";\nimport {SubscriptionRefund} from \"./subscription/SubscriptionRefund.js\";\n\n\n// Model Arrays - grouped by domain\nexport const USER_MODELS = [\n PersistedUser,\n UserBadges,\n UserStreak,\n UsersFriends,\n UserCoach,\n UserDiscount,\n UserOptions,\n UserAddons,\n DeviceTokens,\n];\n\nexport const SUBSCRIPTION_MODELS = [Subscription, SubscriptionLog ,SubscriptionEvent, SubscriptionRefund];\n\nexport const PROGRAM_MODELS = [\n Program,\n Workout,\n Exercise,\n ExercisesModels,\n Superset,\n ProgressEntry,\n RestDay,\n WorkoutSession,\n Challenge,\n ChallengeBlueprint,\n UserChallenge,\n TranslatedChallenge,\n ThirtyDayChallenge,\n ThirtyDayChallengeStrengthTest,\n StrengthTest,\n StrengthTestExercise,\n StrengthTestSession,\n UserStrengthTests,\n TranslatedStrengthTest,\n TranslatedStrengthTestExercise,\n TranslatedExerciseModel,\n CustomProgramBlueprint,\n CustomWorkoutBlueprint,\n CustomStrengthTest,\n CustomStrengthTestExercise,\n];\n\nexport const NON_CONSUMABLE_PROGRAM_MODELS = [\n NonConsumableProgram,\n NonConsumableProgramWebContent,\n UserPrograms,\n TranslatedConsumableProgram,\n TranslatedNonConsumableProgramWebContent,\n];\n\nexport const DIET_MODELS = [\n DietProgram,\n DietDay,\n DietMeal,\n DietMealRecipe,\n DietMealRecipeIngredient,\n DietMealCompletion,\n Recipe,\n TranslatedRecipe,\n RecipeTag,\n TranslatedRecipeTag,\n RecipeTags,\n TranslatedRecipeTags,\n ShoppingList,\n ShoppingListItem,\n UserDietPreferences,\n Ingredient,\n IngredientTag,\n IngredientTags,\n RecipeIngredient,\n];\n\nexport const COACHING_MODELS = [\n WeeklyCheckin,\n WeightRecord,\n Questionnaire,\n Question,\n Answer,\n QuestionnaireResponse,\n];\n\nexport const GAMIFICATION_MODELS = [\n Badge,\n TranslatedBadge,\n StreaksLog,\n XpEvent,\n XpTransaction,\n UserRankHistory,\n];\n\nexport const NOTIFICATION_MODELS = [NotificationModels, TranslatedNotification];\n\n// All core models combined\nexport const ALL_CORE_MODELS = [\n ...USER_MODELS,\n ...SUBSCRIPTION_MODELS,\n ...PROGRAM_MODELS,\n ...NON_CONSUMABLE_PROGRAM_MODELS,\n ...DIET_MODELS,\n ...COACHING_MODELS,\n ...GAMIFICATION_MODELS,\n ...NOTIFICATION_MODELS,\n];\n"],"names":["SubscriptionEvent","PersistedUser","UserBadges","UserStreak","UsersFriends","UserCoach","UserDiscount","UserOptions","UserAddons","DeviceTokens","Subscription","SubscriptionLog","SubscriptionRefund","Program","Workout","Exercise","ExercisesModels","Superset","ProgressEntry","RestDay","WorkoutSession","Challenge","ChallengeBlueprint","UserChallenge","TranslatedChallenge","ThirtyDayChallenge","ThirtyDayChallengeStrengthTest","StrengthTest","StrengthTestExercise","StrengthTestSession","UserStrengthTests","TranslatedStrengthTest","TranslatedStrengthTestExercise","TranslatedExerciseModel","CustomProgramBlueprint","CustomWorkoutBlueprint","CustomStrengthTest","CustomStrengthTestExercise","NonConsumableProgram","NonConsumableProgramWebContent","UserPrograms","TranslatedConsumableProgram","TranslatedNonConsumableProgramWebContent","DietProgram","DietDay","DietMeal","DietMealRecipe","DietMealRecipeIngredient","DietMealCompletion","Recipe","TranslatedRecipe","RecipeTag","TranslatedRecipeTag","RecipeTags","TranslatedRecipeTags","ShoppingList","ShoppingListItem","UserDietPreferences","Ingredient","IngredientTag","IngredientTags","RecipeIngredient","WeeklyCheckin","WeightRecord","Questionnaire","QuestionnaireType","Question","QuestionType","Answer","QuestionnaireResponse","Badge","TranslatedBadge","StreaksLog","XpEvent","XpTransaction","UserRankHistory","NotificationModels","TranslatedNotification","USER_MODELS","SUBSCRIPTION_MODELS","PROGRAM_MODELS","NON_CONSUMABLE_PROGRAM_MODELS","DIET_MODELS","COACHING_MODELS","GAMIFICATION_MODELS","NOTIFICATION_MODELS","ALL_CORE_MODELS"],"mappings":"AAAA,cAAc;AACd,SAAQA,iBAAiB,QAAO,sCAAsC;AAEtE,SAASC,aAAa,QAAQ,0BAA0B;AACxD,SAASC,UAAU,QAAQ,uBAAuB;AAClD,SAASC,UAAU,QAAQ,wBAAwB;AACnD,SAASC,YAAY,QAAQ,yBAAyB;AACtD,SAASC,SAAS,QAAQ,sBAAsB;AAChD,SAASC,YAAY,QAAQ,yBAAyB;AACtD,SAASC,WAAW,QAAQ,wBAAwB;AACpD,SAASC,UAAU,QAAQ,uBAAuB;AAClD,SAASC,YAAY,QAAQ,yBAAyB;AAEtD,sBAAsB;AACtB,SAASC,YAAY,QAAQ,iCAAiC;AAC9D,SAASC,eAAe,QAAQ,oCAAoC;AACpE,SAASX,iBAAiB,QAAQ,sCAAsC;AACxE,SAASY,kBAAkB,QAAQ,uCAAuC;AAE1E,iBAAiB;AACjB,SAASC,OAAO,QAAQ,uBAAuB;AAC/C,SAASC,OAAO,QAAQ,uBAAuB;AAC/C,SAASC,QAAQ,QAAQ,wBA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,MAAMkE,cAAc;IACvB7E;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;CACH,CAAC;AAEF,OAAO,MAAMsE,sBAAsB;IAACrE;IAAcC;IAAiBX;IAAmBY;CAAmB,CAAC;AAE1G,OAAO,MAAMoE,iBAAiB;IAC1BnE;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;CACH,CAAC;AAEF,OAAO,MAAM4C,gCAAgC;IACzC3C;IACAC;IACAC;IACAC;IACAC;CACH,CAAC;AAEF,OAAO,MAAMwC,cAAc;IACvBvC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;CACH,CAAC;AAEF,OAAO,MAAMsB,kBAAkB;IAC3BrB;IACAC;IACAC;IACAE;IACAE;IACAC;CACH,CAAC;AAEF,OAAO,MAAMe,sBAAsB;IAC/Bd;IACAC;IACAC;IACAC;IACAC;IACAC;CACH,CAAC;AAEF,OAAO,MAAMU,sBAAsB;IAACT;IAAoBC;CAAuB,CAAC;AAEhF,2BAA2B;AAC3B,OAAO,MAAMS,kBAAkB;OACxBR;OACAC;OACAC;OACAC;OACAC;OACAC;OACAC;OACAC;CACN,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Model } from "sequelize-typescript";
|
|
2
|
+
import { Subscription } from "./Subscription.js";
|
|
3
|
+
export declare class SubscriptionEvent extends Model {
|
|
4
|
+
uuid: string;
|
|
5
|
+
subscriptionUuid: string;
|
|
6
|
+
eventType: string;
|
|
7
|
+
action: string;
|
|
8
|
+
externalId: string | null;
|
|
9
|
+
amount: number | null;
|
|
10
|
+
currency: string | null;
|
|
11
|
+
metadata: Record<string, any> | null;
|
|
12
|
+
subscription: Subscription;
|
|
13
|
+
createdAt: Date;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=SubscriptionEvent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubscriptionEvent.d.ts","sourceRoot":"","sources":["../../../../src/lib/dbmodels/subscription/SubscriptionEvent.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,EAIN,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,qBACa,iBAAkB,SAAQ,KAAK;IAOlC,IAAI,EAAE,MAAM,CAAC;IAOb,gBAAgB,EAAE,MAAM,CAAC;IAMzB,SAAS,EAAE,MAAM,CAAC;IAMlB,MAAM,EAAE,MAAM,CAAC;IAMf,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAM1B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAMtB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAMxB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IAGrC,YAAY,EAAE,YAAY,CAAC;IAO3B,SAAS,EAAE,IAAI,CAAC;CACzB"}
|
|
@@ -0,0 +1,79 @@
|
|
|
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, Column, DataType, Default, ForeignKey, Model, PrimaryKey, Table, CreatedAt } from "sequelize-typescript";
|
|
8
|
+
import { Subscription } from "./Subscription.js";
|
|
9
|
+
export class SubscriptionEvent extends Model {
|
|
10
|
+
}
|
|
11
|
+
_ts_decorate([
|
|
12
|
+
PrimaryKey,
|
|
13
|
+
Default(DataType.UUIDV4),
|
|
14
|
+
Column({
|
|
15
|
+
type: DataType.UUID,
|
|
16
|
+
allowNull: false
|
|
17
|
+
})
|
|
18
|
+
], SubscriptionEvent.prototype, "uuid", void 0);
|
|
19
|
+
_ts_decorate([
|
|
20
|
+
ForeignKey(()=>Subscription),
|
|
21
|
+
Column({
|
|
22
|
+
type: DataType.UUID,
|
|
23
|
+
allowNull: false
|
|
24
|
+
})
|
|
25
|
+
], SubscriptionEvent.prototype, "subscriptionUuid", void 0);
|
|
26
|
+
_ts_decorate([
|
|
27
|
+
Column({
|
|
28
|
+
type: DataType.TEXT,
|
|
29
|
+
allowNull: false
|
|
30
|
+
})
|
|
31
|
+
], SubscriptionEvent.prototype, "eventType", void 0);
|
|
32
|
+
_ts_decorate([
|
|
33
|
+
Column({
|
|
34
|
+
type: DataType.TEXT,
|
|
35
|
+
allowNull: false
|
|
36
|
+
})
|
|
37
|
+
], SubscriptionEvent.prototype, "action", void 0);
|
|
38
|
+
_ts_decorate([
|
|
39
|
+
Column({
|
|
40
|
+
type: DataType.TEXT,
|
|
41
|
+
allowNull: true
|
|
42
|
+
})
|
|
43
|
+
], SubscriptionEvent.prototype, "externalId", void 0);
|
|
44
|
+
_ts_decorate([
|
|
45
|
+
Column({
|
|
46
|
+
type: DataType.DECIMAL(10, 2),
|
|
47
|
+
allowNull: true
|
|
48
|
+
})
|
|
49
|
+
], SubscriptionEvent.prototype, "amount", void 0);
|
|
50
|
+
_ts_decorate([
|
|
51
|
+
Column({
|
|
52
|
+
type: DataType.TEXT,
|
|
53
|
+
allowNull: true
|
|
54
|
+
})
|
|
55
|
+
], SubscriptionEvent.prototype, "currency", void 0);
|
|
56
|
+
_ts_decorate([
|
|
57
|
+
Column({
|
|
58
|
+
type: DataType.JSONB,
|
|
59
|
+
allowNull: true
|
|
60
|
+
})
|
|
61
|
+
], SubscriptionEvent.prototype, "metadata", void 0);
|
|
62
|
+
_ts_decorate([
|
|
63
|
+
BelongsTo(()=>Subscription)
|
|
64
|
+
], SubscriptionEvent.prototype, "subscription", void 0);
|
|
65
|
+
_ts_decorate([
|
|
66
|
+
CreatedAt,
|
|
67
|
+
Column({
|
|
68
|
+
type: DataType.DATE,
|
|
69
|
+
allowNull: false
|
|
70
|
+
})
|
|
71
|
+
], SubscriptionEvent.prototype, "createdAt", void 0);
|
|
72
|
+
SubscriptionEvent = _ts_decorate([
|
|
73
|
+
Table({
|
|
74
|
+
timestamps: true,
|
|
75
|
+
tableName: "subscription_events"
|
|
76
|
+
})
|
|
77
|
+
], SubscriptionEvent);
|
|
78
|
+
|
|
79
|
+
//# sourceMappingURL=SubscriptionEvent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/dbmodels/subscription/SubscriptionEvent.ts"],"sourcesContent":["import {\n BelongsTo,\n Column,\n DataType,\n Default,\n ForeignKey,\n Model,\n PrimaryKey,\n Table,\n CreatedAt,\n} from \"sequelize-typescript\";\nimport { Subscription } from \"./Subscription.js\";\n\n@Table({ timestamps: true, tableName: \"subscription_events\" })\nexport class SubscriptionEvent extends Model {\n @PrimaryKey\n @Default(DataType.UUIDV4)\n @Column({\n type: DataType.UUID,\n allowNull: false,\n })\n declare uuid: string;\n\n @ForeignKey(() => Subscription)\n @Column({\n type: DataType.UUID,\n allowNull: false,\n })\n declare subscriptionUuid: string;\n\n @Column({\n type: DataType.TEXT,\n allowNull: false,\n })\n declare eventType: string;\n\n @Column({\n type: DataType.TEXT,\n allowNull: false,\n })\n declare action: string;\n\n @Column({\n type: DataType.TEXT,\n allowNull: true,\n })\n declare externalId: string | null;\n\n @Column({\n type: DataType.DECIMAL(10, 2),\n allowNull: true,\n })\n declare amount: number | null;\n\n @Column({\n type: DataType.TEXT,\n allowNull: true,\n })\n declare currency: string | null;\n\n @Column({\n type: DataType.JSONB,\n allowNull: true,\n })\n declare metadata: Record<string, any> | null;\n\n @BelongsTo(() => Subscription)\n declare subscription: Subscription;\n\n @CreatedAt\n @Column({\n type: DataType.DATE,\n allowNull: false,\n })\n declare createdAt: Date;\n}\n"],"names":["BelongsTo","Column","DataType","Default","ForeignKey","Model","PrimaryKey","Table","CreatedAt","Subscription","SubscriptionEvent","UUIDV4","type","UUID","allowNull","TEXT","DECIMAL","JSONB","DATE","timestamps","tableName"],"mappings":";;;;;;AAAA,SACEA,SAAS,EACTC,MAAM,EACNC,QAAQ,EACRC,OAAO,EACPC,UAAU,EACVC,KAAK,EACLC,UAAU,EACVC,KAAK,EACLC,SAAS,QACJ,uBAAuB;AAC9B,SAASC,YAAY,QAAQ,oBAAoB;AAGjD,OAAO,MAAMC,0BAA0BL;AA6DvC;;;qBA3DoBM;;QAEhBC,MAAMV,SAASW,IAAI;QACnBC,WAAW;;;;mBAIKL;;QAEhBG,MAAMV,SAASW,IAAI;QACnBC,WAAW;;;;;QAKXF,MAAMV,SAASa,IAAI;QACnBD,WAAW;;;;;QAKXF,MAAMV,SAASa,IAAI;QACnBD,WAAW;;;;;QAKXF,MAAMV,SAASa,IAAI;QACnBD,WAAW;;;;;QAKXF,MAAMV,SAASc,OAAO,CAAC,IAAI;QAC3BF,WAAW;;;;;QAKXF,MAAMV,SAASa,IAAI;QACnBD,WAAW;;;;;QAKXF,MAAMV,SAASe,KAAK;QACpBH,WAAW;;;;kBAIIL;;;;;QAKfG,MAAMV,SAASgB,IAAI;QACnBJ,WAAW;;;;;QA3DNK,YAAY;QAAMC,WAAW"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Model } from "sequelize-typescript";
|
|
2
|
+
import { Subscription } from "./Subscription.js";
|
|
3
|
+
export declare class SubscriptionRefund extends Model {
|
|
4
|
+
uuid: string;
|
|
5
|
+
subscriptionUuid: string;
|
|
6
|
+
mollieRefundId: string;
|
|
7
|
+
molliePaymentId: string;
|
|
8
|
+
status: string;
|
|
9
|
+
amount: number;
|
|
10
|
+
currency: string;
|
|
11
|
+
description: string | null;
|
|
12
|
+
metadata: Record<string, any> | null;
|
|
13
|
+
subscription: Subscription;
|
|
14
|
+
createdAt: Date;
|
|
15
|
+
updatedAt: Date;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=SubscriptionRefund.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubscriptionRefund.d.ts","sourceRoot":"","sources":["../../../../src/lib/dbmodels/subscription/SubscriptionRefund.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,EAKN,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,qBACa,kBAAmB,SAAQ,KAAK;IAOnC,IAAI,EAAE,MAAM,CAAC;IAOb,gBAAgB,EAAE,MAAM,CAAC;IAOzB,cAAc,EAAE,MAAM,CAAC;IAMvB,eAAe,EAAE,MAAM,CAAC;IAOxB,MAAM,EAAE,MAAM,CAAC;IAOf,MAAM,EAAE,MAAM,CAAC;IAMf,QAAQ,EAAE,MAAM,CAAC;IAMjB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAM3B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IAGrC,YAAY,EAAE,YAAY,CAAC;IAO3B,SAAS,EAAE,IAAI,CAAC;IAOhB,SAAS,EAAE,IAAI,CAAC;CACzB"}
|
|
@@ -0,0 +1,92 @@
|
|
|
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, Column, DataType, Default, ForeignKey, Model, PrimaryKey, Table, CreatedAt, UpdatedAt } from "sequelize-typescript";
|
|
8
|
+
import { Subscription } from "./Subscription.js";
|
|
9
|
+
export class SubscriptionRefund extends Model {
|
|
10
|
+
}
|
|
11
|
+
_ts_decorate([
|
|
12
|
+
PrimaryKey,
|
|
13
|
+
Default(DataType.UUIDV4),
|
|
14
|
+
Column({
|
|
15
|
+
type: DataType.UUID,
|
|
16
|
+
allowNull: false
|
|
17
|
+
})
|
|
18
|
+
], SubscriptionRefund.prototype, "uuid", void 0);
|
|
19
|
+
_ts_decorate([
|
|
20
|
+
ForeignKey(()=>Subscription),
|
|
21
|
+
Column({
|
|
22
|
+
type: DataType.UUID,
|
|
23
|
+
allowNull: false
|
|
24
|
+
})
|
|
25
|
+
], SubscriptionRefund.prototype, "subscriptionUuid", void 0);
|
|
26
|
+
_ts_decorate([
|
|
27
|
+
Column({
|
|
28
|
+
type: DataType.TEXT,
|
|
29
|
+
allowNull: false
|
|
30
|
+
})
|
|
31
|
+
], SubscriptionRefund.prototype, "mollieRefundId", void 0);
|
|
32
|
+
_ts_decorate([
|
|
33
|
+
Column({
|
|
34
|
+
type: DataType.TEXT,
|
|
35
|
+
allowNull: false
|
|
36
|
+
})
|
|
37
|
+
], SubscriptionRefund.prototype, "molliePaymentId", void 0);
|
|
38
|
+
_ts_decorate([
|
|
39
|
+
Column({
|
|
40
|
+
type: DataType.TEXT,
|
|
41
|
+
allowNull: false
|
|
42
|
+
})
|
|
43
|
+
], SubscriptionRefund.prototype, "status", void 0);
|
|
44
|
+
_ts_decorate([
|
|
45
|
+
Column({
|
|
46
|
+
type: DataType.DECIMAL(10, 2),
|
|
47
|
+
allowNull: false
|
|
48
|
+
})
|
|
49
|
+
], SubscriptionRefund.prototype, "amount", void 0);
|
|
50
|
+
_ts_decorate([
|
|
51
|
+
Column({
|
|
52
|
+
type: DataType.TEXT,
|
|
53
|
+
allowNull: false
|
|
54
|
+
})
|
|
55
|
+
], SubscriptionRefund.prototype, "currency", void 0);
|
|
56
|
+
_ts_decorate([
|
|
57
|
+
Column({
|
|
58
|
+
type: DataType.TEXT,
|
|
59
|
+
allowNull: true
|
|
60
|
+
})
|
|
61
|
+
], SubscriptionRefund.prototype, "description", void 0);
|
|
62
|
+
_ts_decorate([
|
|
63
|
+
Column({
|
|
64
|
+
type: DataType.JSONB,
|
|
65
|
+
allowNull: true
|
|
66
|
+
})
|
|
67
|
+
], SubscriptionRefund.prototype, "metadata", void 0);
|
|
68
|
+
_ts_decorate([
|
|
69
|
+
BelongsTo(()=>Subscription)
|
|
70
|
+
], SubscriptionRefund.prototype, "subscription", void 0);
|
|
71
|
+
_ts_decorate([
|
|
72
|
+
CreatedAt,
|
|
73
|
+
Column({
|
|
74
|
+
type: DataType.DATE,
|
|
75
|
+
allowNull: false
|
|
76
|
+
})
|
|
77
|
+
], SubscriptionRefund.prototype, "createdAt", void 0);
|
|
78
|
+
_ts_decorate([
|
|
79
|
+
UpdatedAt,
|
|
80
|
+
Column({
|
|
81
|
+
type: DataType.DATE,
|
|
82
|
+
allowNull: false
|
|
83
|
+
})
|
|
84
|
+
], SubscriptionRefund.prototype, "updatedAt", void 0);
|
|
85
|
+
SubscriptionRefund = _ts_decorate([
|
|
86
|
+
Table({
|
|
87
|
+
timestamps: true,
|
|
88
|
+
tableName: "subscription_refunds"
|
|
89
|
+
})
|
|
90
|
+
], SubscriptionRefund);
|
|
91
|
+
|
|
92
|
+
//# sourceMappingURL=SubscriptionRefund.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/dbmodels/subscription/SubscriptionRefund.ts"],"sourcesContent":["import {\n BelongsTo,\n Column,\n DataType,\n Default,\n ForeignKey,\n Model,\n PrimaryKey,\n Table,\n CreatedAt,\n UpdatedAt,\n} from \"sequelize-typescript\";\nimport { Subscription } from \"./Subscription.js\";\n\n@Table({ timestamps: true, tableName: \"subscription_refunds\" })\nexport class SubscriptionRefund extends Model {\n @PrimaryKey\n @Default(DataType.UUIDV4)\n @Column({\n type: DataType.UUID,\n allowNull: false,\n })\n declare uuid: string;\n\n @ForeignKey(() => Subscription)\n @Column({\n type: DataType.UUID,\n allowNull: false,\n })\n declare subscriptionUuid: string;\n\n\n @Column({\n type: DataType.TEXT,\n allowNull: false,\n })\n declare mollieRefundId: string;\n\n @Column({\n type: DataType.TEXT,\n allowNull: false,\n })\n declare molliePaymentId: string;\n\n\n @Column({\n type: DataType.TEXT,\n allowNull: false,\n })\n declare status: string;\n\n\n @Column({\n type: DataType.DECIMAL(10, 2),\n allowNull: false,\n })\n declare amount: number;\n\n @Column({\n type: DataType.TEXT,\n allowNull: false,\n })\n declare currency: string;\n\n @Column({\n type: DataType.TEXT,\n allowNull: true,\n })\n declare description: string | null;\n\n @Column({\n type: DataType.JSONB,\n allowNull: true,\n })\n declare metadata: Record<string, any> | null;\n\n @BelongsTo(() => Subscription)\n declare subscription: Subscription;\n\n @CreatedAt\n @Column({\n type: DataType.DATE,\n allowNull: false,\n })\n declare createdAt: Date;\n\n @UpdatedAt\n @Column({\n type: DataType.DATE,\n allowNull: false,\n })\n declare updatedAt: Date;\n}\n"],"names":["BelongsTo","Column","DataType","Default","ForeignKey","Model","PrimaryKey","Table","CreatedAt","UpdatedAt","Subscription","SubscriptionRefund","UUIDV4","type","UUID","allowNull","TEXT","DECIMAL","JSONB","DATE","timestamps","tableName"],"mappings":";;;;;;AAAA,SACEA,SAAS,EACTC,MAAM,EACNC,QAAQ,EACRC,OAAO,EACPC,UAAU,EACVC,KAAK,EACLC,UAAU,EACVC,KAAK,EACLC,SAAS,EACTC,SAAS,QACJ,uBAAuB;AAC9B,SAASC,YAAY,QAAQ,oBAAoB;AAGjD,OAAO,MAAMC,2BAA2BN;AA6ExC;;;qBA3EoBO;;QAEhBC,MAAMX,SAASY,IAAI;QACnBC,WAAW;;;;mBAIKL;;QAEhBG,MAAMX,SAASY,IAAI;QACnBC,WAAW;;;;;QAMXF,MAAMX,SAASc,IAAI;QACnBD,WAAW;;;;;QAKXF,MAAMX,SAASc,IAAI;QACnBD,WAAW;;;;;QAMXF,MAAMX,SAASc,IAAI;QACnBD,WAAW;;;;;QAMXF,MAAMX,SAASe,OAAO,CAAC,IAAI;QAC3BF,WAAW;;;;;QAKXF,MAAMX,SAASc,IAAI;QACnBD,WAAW;;;;;QAKXF,MAAMX,SAASc,IAAI;QACnBD,WAAW;;;;;QAKXF,MAAMX,SAASgB,KAAK;QACpBH,WAAW;;;;kBAIIL;;;;;QAKfG,MAAMX,SAASiB,IAAI;QACnBJ,WAAW;;;;;;QAMXF,MAAMX,SAASiB,IAAI;QACnBJ,WAAW;;;;;QA3ENK,YAAY;QAAMC,WAAW"}
|
|
@@ -181,6 +181,18 @@ export declare class NotificationClient {
|
|
|
181
181
|
* @param authToken - User authentication token (required)
|
|
182
182
|
*/
|
|
183
183
|
sendExportFinishedEmail(authToken: string): Promise<void>;
|
|
184
|
+
/**
|
|
185
|
+
* Send student questionnaire response to coach
|
|
186
|
+
*
|
|
187
|
+
* @param to - Coach email address
|
|
188
|
+
* @param subject - Email subject line
|
|
189
|
+
* @param html - HTML content of the email
|
|
190
|
+
*/
|
|
191
|
+
sendStudentResponseToCoach(params: {
|
|
192
|
+
to: string;
|
|
193
|
+
subject: string;
|
|
194
|
+
html: string;
|
|
195
|
+
}): Promise<void>;
|
|
184
196
|
/**
|
|
185
197
|
* Create a new notification template
|
|
186
198
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationClient.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/NotificationClient.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,EACnB,yBAAyB,EAC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CAAC;IAalB;;;;;;;;;;;;;OAaG;IACG,WAAW,CACf,SAAS,EAAE,MAAM,EAAE,EACnB,YAAY,EAAE,mBAAmB,GAChC,OAAO,CAAC,IAAI,CAAC;IAWhB;;;;;;;;;;;;;OAaG;IACG,cAAc,CAAC,YAAY,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC;IAYxE;;;;;;;;;;;;;;;OAeG;IACG,qBAAqB,CACzB,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,IAAI,CAAC;IAUhB;;;;OAIG;IACG,qBAAqB,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;IAWzE;;;;OAIG;IACG,iBAAiB,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;IAQrE;;;;OAIG;IACG,uBAAuB,CAC3B,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,IAAI,CAAC;IAQhB;;;;;OAKG;IACG,qBAAqB,CACzB,OAAO,EAAE,wBAAwB,EACjC,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC;IAYhB;;;;OAIG;IACG,gBAAgB,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAQnE;;;;OAIG;IACG,wBAAwB,CAC5B,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,IAAI,CAAC;IAQhB;;;;OAIG;IACG,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAgB9D;;;;OAIG;IACG,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"NotificationClient.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/NotificationClient.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,EACnB,yBAAyB,EACzB,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IACG,kBAAkB,CACtB,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,MAAM,CAAC;IAalB;;;;OAIG;IACG,6BAA6B,CACjC,OAAO,EAAE,8BAA8B,GACtC,OAAO,CAAC,IAAI,CAAC;IAWhB;;;;OAIG;IACG,kBAAkB,CACtB,OAAO,EAAE,8BAA8B,GACtC,OAAO,CAAC,IAAI,CAAC;IAQhB;;;;OAIG;IACG,6BAA6B,CACjC,OAAO,EAAE,8BAA8B,GACtC,OAAO,CAAC,IAAI,CAAC;IAWhB;;;;;OAKG;IACG,gBAAgB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAazD;;;;;OAKG;IACG,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAaxE;;OAEG;IACH,OAAO,CAAC,WAAW;CAoBpB"}
|
|
@@ -232,6 +232,19 @@ import axios from "axios";
|
|
|
232
232
|
this.handleError("Failed to send export finished email", error);
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
|
+
/**
|
|
236
|
+
* Send student questionnaire response to coach
|
|
237
|
+
*
|
|
238
|
+
* @param to - Coach email address
|
|
239
|
+
* @param subject - Email subject line
|
|
240
|
+
* @param html - HTML content of the email
|
|
241
|
+
*/ async sendStudentResponseToCoach(params) {
|
|
242
|
+
try {
|
|
243
|
+
await this.client.post("/mail/send-student-response-to-coach", params);
|
|
244
|
+
} catch (error) {
|
|
245
|
+
this.handleError("Failed to send student response to coach", error);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
235
248
|
// ==================== Notification Management Methods ====================
|
|
236
249
|
/**
|
|
237
250
|
* Create a new notification template
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/utils/NotificationClient.ts"],"sourcesContent":["import axios from \"axios\";\nimport type { AxiosInstance, AxiosError } from \"axios\";\nimport type {\n NotificationPayload,\n EmailReminderPayload,\n GroupNotificationRequest,\n NotificationRequest,\n CreateNotificationRequest,\n NotificationTranslationRequest,\n} from '../models/NotificationInterfaces.js';\n\nexport interface NotificationClientConfig {\n baseURL: string;\n timeout?: number;\n headers?: Record<string, string>;\n}\n\n/**\n * Abandoned cart notification payload\n */\nexport interface AbandonedCartPayload {\n email: string;\n}\n\n/**\n * Password restoration types\n */\nexport type PasswordRestorationType = \"change\" | \"reset\" | \"platform-reset\";\n\n/**\n * Password restoration request\n */\nexport interface PasswordRestorationRequest {\n email: string;\n type: PasswordRestorationType;\n}\n\n/**\n * Email confirmation request\n */\nexport interface EmailConfirmationRequest {\n type: \"main\" | \"utility\";\n}\n\n/**\n * Shopify email request\n */\nexport interface ShopifyEmailRequest {\n email: string;\n name: string;\n orderNumber: string;\n items: Array<{\n name: string;\n quantity: number;\n price: number;\n }>;\n}\n\n/**\n * Challenge friend email request\n */\nexport interface ChallengeFriendRequest {\n friendsEmail: string;\n name: string;\n}\n\n/**\n * NotificationClient\n *\n * Provides methods to interact with the notification service via HTTP API.\n * This allows services to send notifications without direct database access\n * or code duplication.\n */\nexport class NotificationClient {\n private client: AxiosInstance;\n\n /**\n * Create a new notification client\n *\n * @param config - Client configuration with base URL and optional settings\n *\n * @example\n * ```typescript\n * const notificationClient = new NotificationClient({\n * baseURL: 'http://localhost:3037',\n * timeout: 5000\n * });\n * ```\n */\n constructor(config: NotificationClientConfig) {\n this.client = axios.create({\n baseURL: config.baseURL,\n timeout: config.timeout || 10000,\n headers: {\n \"Content-Type\": \"application/json\",\n ...config.headers,\n },\n });\n }\n\n // ==================== Push Notification Methods ====================\n\n /**\n * Schedule a push notification for a specific user\n *\n * @param payload - Notification details including user UUID and notification type\n *\n * @example\n * ```typescript\n * await client.scheduleNotification({\n * userUuid: '123e4567-e89b-12d3-a456-426614174000',\n * name: 'workout_reminder'\n * });\n * ```\n */\n async scheduleNotification(payload: NotificationPayload): Promise<void> {\n try {\n await this.client.post(\"/notifications/save-job\", payload);\n } catch (error) {\n this.handleError(\"Failed to schedule notification\", error);\n }\n }\n\n async sendToUser(\n userUuid: string,\n notification: NotificationRequest\n ): Promise<string> {\n try {\n const response = await this.client.post(\"/notifications/send-to-user\", {\n userUuid,\n notification,\n });\n return response.data.messageId;\n } catch (error) {\n this.handleError(\"Failed to send notification to user\", error);\n throw error;\n }\n }\n\n /**\n * Send notification to multiple users in batch\n *\n * @param userUuids - Array of user UUIDs\n * @param notification - Notification content\n *\n * @example\n * ```typescript\n * await client.sendToUsers(['uuid1', 'uuid2'], {\n * title: 'New Feature',\n * body: 'Check out what's new!'\n * });\n * ```\n */\n async sendToUsers(\n userUuids: string[],\n notification: NotificationRequest\n ): Promise<void> {\n try {\n await this.client.post(\"/notifications/send-to-users\", {\n userUuids,\n notification,\n });\n } catch (error) {\n this.handleError(\"Failed to send batch notification\", error);\n }\n }\n\n /**\n * Send notification to all users\n *\n * @param notification - Notification content\n * @returns Total number of users notified\n *\n * @example\n * ```typescript\n * const totalSent = await client.sendToAllUsers({\n * title: 'System Update',\n * body: 'App will be updated soon'\n * });\n * ```\n */\n async sendToAllUsers(notification: NotificationRequest): Promise<number> {\n try {\n const response = await this.client.post(\"/notifications/send-to-all\", {\n notification,\n });\n return response.data.totalSent;\n } catch (error) {\n this.handleError(\"Failed to send to all users\", error);\n throw error;\n }\n }\n\n /**\n * Send a push notification to a specific group of users\n *\n * @param request - Group notification request with target group and message\n *\n * @example\n * ```typescript\n * await client.sendGroupNotification({\n * group: NotificationGroups.PREMIUM,\n * notification: {\n * title: 'New Feature!',\n * body: 'Check out our new workout plans'\n * }\n * });\n * ```\n */\n async sendGroupNotification(\n request: GroupNotificationRequest\n ): Promise<void> {\n try {\n await this.client.post(\"/notifications/send-group\", request);\n } catch (error) {\n this.handleError(\"Failed to send group notification\", error);\n }\n }\n\n // ==================== Email Methods ====================\n\n /**\n * Schedule an email checkout reminder\n *\n * @param payload - Email reminder details\n */\n async scheduleEmailReminder(payload: EmailReminderPayload): Promise<void> {\n try {\n await this.client.post(\n \"/notifications/save-email-checkout-reminder\",\n payload\n );\n } catch (error) {\n this.handleError(\"Failed to schedule email reminder\", error);\n }\n }\n\n /**\n * Send abandoned cart notification\n *\n * @param payload - Abandoned cart details with user email\n */\n async sendAbandonedCart(payload: AbandonedCartPayload): Promise<void> {\n try {\n await this.client.post(\"/notifications/abandoned-cart\", payload);\n } catch (error) {\n this.handleError(\"Failed to send abandoned cart notification\", error);\n }\n }\n\n /**\n * Send password restoration email\n *\n * @param request - Password restoration request\n */\n async sendPasswordRestoration(\n request: PasswordRestorationRequest\n ): Promise<void> {\n try {\n await this.client.post(\"/mail/send-password-restoration\", request);\n } catch (error) {\n this.handleError(\"Failed to send password restoration email\", error);\n }\n }\n\n /**\n * Send email confirmation\n *\n * @param request - Email confirmation request\n * @param authToken - User authentication token (required)\n */\n async sendEmailConfirmation(\n request: EmailConfirmationRequest,\n authToken: string\n ): Promise<void> {\n try {\n await this.client.post(\"/mail/send-confirmation\", request, {\n headers: {\n Authorization: `Bearer ${authToken}`,\n },\n });\n } catch (error) {\n this.handleError(\"Failed to send email confirmation\", error);\n }\n }\n\n /**\n * Send Shopify email\n *\n * @param request - Shopify email details\n */\n async sendShopifyEmail(request: ShopifyEmailRequest): Promise<void> {\n try {\n await this.client.post(\"/mail/send-shopify-email\", request);\n } catch (error) {\n this.handleError(\"Failed to send Shopify email\", error);\n }\n }\n\n /**\n * Send challenge friend invitation email\n *\n * @param request - Challenge friend request\n */\n async sendChallengeFriendEmail(\n request: ChallengeFriendRequest\n ): Promise<void> {\n try {\n await this.client.post(\"/mail/send-challenge-email\", request);\n } catch (error) {\n this.handleError(\"Failed to send challenge email\", error);\n }\n }\n\n /**\n * Send account deletion email\n *\n * @param authToken - User authentication token (required)\n */\n async sendDeleteAccountEmail(authToken: string): Promise<void> {\n try {\n await this.client.post(\n \"/mail/send-delete-email\",\n {},\n {\n headers: {\n Authorization: `Bearer ${authToken}`,\n },\n }\n );\n } catch (error) {\n this.handleError(\"Failed to send delete account email\", error);\n }\n }\n\n /**\n * Send export finished email\n *\n * @param authToken - User authentication token (required)\n */\n async sendExportFinishedEmail(authToken: string): Promise<void> {\n try {\n await this.client.post(\n \"/mail/send-export-finished-email\",\n {},\n {\n headers: {\n Authorization: `Bearer ${authToken}`,\n },\n }\n );\n } catch (error) {\n this.handleError(\"Failed to send export finished email\", error);\n }\n }\n\n // ==================== Notification Management Methods ====================\n\n /**\n * Create a new notification template\n *\n * @param request - Notification template details\n * @returns The created notification UUID\n */\n async createNotification(\n request: CreateNotificationRequest\n ): Promise<string> {\n try {\n const response = await this.client.post(\n \"/notifications/create-notification\",\n request\n );\n return response.data.uuid;\n } catch (error) {\n this.handleError(\"Failed to create notification\", error);\n throw error;\n }\n }\n\n /**\n * Create a notification translation\n *\n * @param request - Translation details\n */\n async createNotificationTranslation(\n request: NotificationTranslationRequest\n ): Promise<void> {\n try {\n await this.client.post(\n \"/notifications/create-notification-translation\",\n request\n );\n } catch (error) {\n this.handleError(\"Failed to create notification translation\", error);\n }\n }\n\n /**\n * Update a notification template\n *\n * @param request - Updated notification details\n */\n async updateNotification(\n request: NotificationTranslationRequest\n ): Promise<void> {\n try {\n await this.client.put(\"/notifications/update-notification\", request);\n } catch (error) {\n this.handleError(\"Failed to update notification\", error);\n }\n }\n\n /**\n * Update a notification translation\n *\n * @param request - Updated translation details\n */\n async updateNotificationTranslation(\n request: NotificationTranslationRequest\n ): Promise<void> {\n try {\n await this.client.put(\n \"/notifications/update-notification-translation\",\n request\n );\n } catch (error) {\n this.handleError(\"Failed to update notification translation\", error);\n }\n }\n\n /**\n * Get all notifications, optionally filtered by language\n *\n * @param language - Optional language code to filter translations\n * @returns Array of notifications with translations\n */\n async getNotifications(language?: string): Promise<any[]> {\n try {\n const url = language\n ? `/notifications/get-notifications/${language}`\n : \"/notifications/get-notifications\";\n const response = await this.client.get(url);\n return response.data;\n } catch (error) {\n this.handleError(\"Failed to get notifications\", error);\n throw error;\n }\n }\n\n /**\n * Delete a notification or translation\n *\n * @param uuid - Notification UUID\n * @param language - Optional language code to delete only translation\n */\n async deleteNotification(uuid: string, language?: string): Promise<void> {\n try {\n const params = language ? { language } : {};\n await this.client.delete(`/notifications/delete-notifications/${uuid}`, {\n params,\n });\n } catch (error) {\n this.handleError(\"Failed to delete notification\", error);\n }\n }\n\n // ==================== Error Handling ====================\n\n /**\n * Handle and format errors from notification service\n */\n private handleError(message: string, error: unknown): void {\n if (axios.isAxiosError(error)) {\n const axiosError = error as AxiosError;\n const status = axiosError.response?.status;\n const data = axiosError.response?.data;\n\n console.error(`[NotificationClient] ${message}:`, {\n status,\n message: axiosError.message,\n data,\n });\n\n throw new Error(\n `${message}: ${status ? `HTTP ${status}` : axiosError.message}`\n );\n }\n\n console.error(`[NotificationClient] ${message}:`, error);\n throw new Error(`${message}: ${error}`);\n }\n}\n"],"names":["axios","NotificationClient","client","config","create","baseURL","timeout","headers","scheduleNotification","payload","post","error","handleError","sendToUser","userUuid","notification","response","data","messageId","sendToUsers","userUuids","sendToAllUsers","totalSent","sendGroupNotification","request","scheduleEmailReminder","sendAbandonedCart","sendPasswordRestoration","sendEmailConfirmation","authToken","Authorization","sendShopifyEmail","sendChallengeFriendEmail","sendDeleteAccountEmail","sendExportFinishedEmail","createNotification","uuid","createNotificationTranslation","updateNotification","put","updateNotificationTranslation","getNotifications","language","url","get","deleteNotification","params","delete","message","isAxiosError","axiosError","status","console","Error"],"mappings":"AAAA,OAAOA,WAAW,QAAQ;AAkE1B;;;;;;CAMC,GACD,OAAO,MAAMC;IACHC,OAAsB;IAE9B;;;;;;;;;;;;GAYC,GACD,YAAYC,MAAgC,CAAE;QAC5C,IAAI,CAACD,MAAM,GAAGF,MAAMI,MAAM,CAAC;YACzBC,SAASF,OAAOE,OAAO;YACvBC,SAASH,OAAOG,OAAO,IAAI;YAC3BC,SAAS;gBACP,gBAAgB;gBAChB,GAAGJ,OAAOI,OAAO;YACnB;QACF;IACF;IAEA,sEAAsE;IAEtE;;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AQ,GAAGD,WAAWF,OAAO,EAAE;QAEnE;QAEAI,QAAQzC,KAAK,CAAC,CAAC,qBAAqB,EAAEqC,QAAQ,CAAC,CAAC,EAAErC;QAClD,MAAM,IAAI0C,MAAM,GAAGL,QAAQ,EAAE,EAAErC,OAAO;IACxC;AACF"}
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/utils/NotificationClient.ts"],"sourcesContent":["import axios from \"axios\";\nimport type { AxiosInstance, AxiosError } from \"axios\";\nimport type {\n NotificationPayload,\n EmailReminderPayload,\n GroupNotificationRequest,\n NotificationRequest,\n CreateNotificationRequest,\n NotificationTranslationRequest,\n} from '../models/NotificationInterfaces.js';\n\nexport interface NotificationClientConfig {\n baseURL: string;\n timeout?: number;\n headers?: Record<string, string>;\n}\n\n/**\n * Abandoned cart notification payload\n */\nexport interface AbandonedCartPayload {\n email: string;\n}\n\n/**\n * Password restoration types\n */\nexport type PasswordRestorationType = \"change\" | \"reset\" | \"platform-reset\";\n\n/**\n * Password restoration request\n */\nexport interface PasswordRestorationRequest {\n email: string;\n type: PasswordRestorationType;\n}\n\n/**\n * Email confirmation request\n */\nexport interface EmailConfirmationRequest {\n type: \"main\" | \"utility\";\n}\n\n/**\n * Shopify email request\n */\nexport interface ShopifyEmailRequest {\n email: string;\n name: string;\n orderNumber: string;\n items: Array<{\n name: string;\n quantity: number;\n price: number;\n }>;\n}\n\n/**\n * Challenge friend email request\n */\nexport interface ChallengeFriendRequest {\n friendsEmail: string;\n name: string;\n}\n\n/**\n * NotificationClient\n *\n * Provides methods to interact with the notification service via HTTP API.\n * This allows services to send notifications without direct database access\n * or code duplication.\n */\nexport class NotificationClient {\n private client: AxiosInstance;\n\n /**\n * Create a new notification client\n *\n * @param config - Client configuration with base URL and optional settings\n *\n * @example\n * ```typescript\n * const notificationClient = new NotificationClient({\n * baseURL: 'http://localhost:3037',\n * timeout: 5000\n * });\n * ```\n */\n constructor(config: NotificationClientConfig) {\n this.client = axios.create({\n baseURL: config.baseURL,\n timeout: config.timeout || 10000,\n headers: {\n \"Content-Type\": \"application/json\",\n ...config.headers,\n },\n });\n }\n\n // ==================== Push Notification Methods ====================\n\n /**\n * Schedule a push notification for a specific user\n *\n * @param payload - Notification details including user UUID and notification type\n *\n * @example\n * ```typescript\n * await client.scheduleNotification({\n * userUuid: '123e4567-e89b-12d3-a456-426614174000',\n * name: 'workout_reminder'\n * });\n * ```\n */\n async scheduleNotification(payload: NotificationPayload): Promise<void> {\n try {\n await this.client.post(\"/notifications/save-job\", payload);\n } catch (error) {\n this.handleError(\"Failed to schedule notification\", error);\n }\n }\n\n async sendToUser(\n userUuid: string,\n notification: NotificationRequest\n ): Promise<string> {\n try {\n const response = await this.client.post(\"/notifications/send-to-user\", {\n userUuid,\n notification,\n });\n return response.data.messageId;\n } catch (error) {\n this.handleError(\"Failed to send notification to user\", error);\n throw error;\n }\n }\n\n /**\n * Send notification to multiple users in batch\n *\n * @param userUuids - Array of user UUIDs\n * @param notification - Notification content\n *\n * @example\n * ```typescript\n * await client.sendToUsers(['uuid1', 'uuid2'], {\n * title: 'New Feature',\n * body: 'Check out what's new!'\n * });\n * ```\n */\n async sendToUsers(\n userUuids: string[],\n notification: NotificationRequest\n ): Promise<void> {\n try {\n await this.client.post(\"/notifications/send-to-users\", {\n userUuids,\n notification,\n });\n } catch (error) {\n this.handleError(\"Failed to send batch notification\", error);\n }\n }\n\n /**\n * Send notification to all users\n *\n * @param notification - Notification content\n * @returns Total number of users notified\n *\n * @example\n * ```typescript\n * const totalSent = await client.sendToAllUsers({\n * title: 'System Update',\n * body: 'App will be updated soon'\n * });\n * ```\n */\n async sendToAllUsers(notification: NotificationRequest): Promise<number> {\n try {\n const response = await this.client.post(\"/notifications/send-to-all\", {\n notification,\n });\n return response.data.totalSent;\n } catch (error) {\n this.handleError(\"Failed to send to all users\", error);\n throw error;\n }\n }\n\n /**\n * Send a push notification to a specific group of users\n *\n * @param request - Group notification request with target group and message\n *\n * @example\n * ```typescript\n * await client.sendGroupNotification({\n * group: NotificationGroups.PREMIUM,\n * notification: {\n * title: 'New Feature!',\n * body: 'Check out our new workout plans'\n * }\n * });\n * ```\n */\n async sendGroupNotification(\n request: GroupNotificationRequest\n ): Promise<void> {\n try {\n await this.client.post(\"/notifications/send-group\", request);\n } catch (error) {\n this.handleError(\"Failed to send group notification\", error);\n }\n }\n\n // ==================== Email Methods ====================\n\n /**\n * Schedule an email checkout reminder\n *\n * @param payload - Email reminder details\n */\n async scheduleEmailReminder(payload: EmailReminderPayload): Promise<void> {\n try {\n await this.client.post(\n \"/notifications/save-email-checkout-reminder\",\n payload\n );\n } catch (error) {\n this.handleError(\"Failed to schedule email reminder\", error);\n }\n }\n\n /**\n * Send abandoned cart notification\n *\n * @param payload - Abandoned cart details with user email\n */\n async sendAbandonedCart(payload: AbandonedCartPayload): Promise<void> {\n try {\n await this.client.post(\"/notifications/abandoned-cart\", payload);\n } catch (error) {\n this.handleError(\"Failed to send abandoned cart notification\", error);\n }\n }\n\n /**\n * Send password restoration email\n *\n * @param request - Password restoration request\n */\n async sendPasswordRestoration(\n request: PasswordRestorationRequest\n ): Promise<void> {\n try {\n await this.client.post(\"/mail/send-password-restoration\", request);\n } catch (error) {\n this.handleError(\"Failed to send password restoration email\", error);\n }\n }\n\n /**\n * Send email confirmation\n *\n * @param request - Email confirmation request\n * @param authToken - User authentication token (required)\n */\n async sendEmailConfirmation(\n request: EmailConfirmationRequest,\n authToken: string\n ): Promise<void> {\n try {\n await this.client.post(\"/mail/send-confirmation\", request, {\n headers: {\n Authorization: `Bearer ${authToken}`,\n },\n });\n } catch (error) {\n this.handleError(\"Failed to send email confirmation\", error);\n }\n }\n\n /**\n * Send Shopify email\n *\n * @param request - Shopify email details\n */\n async sendShopifyEmail(request: ShopifyEmailRequest): Promise<void> {\n try {\n await this.client.post(\"/mail/send-shopify-email\", request);\n } catch (error) {\n this.handleError(\"Failed to send Shopify email\", error);\n }\n }\n\n /**\n * Send challenge friend invitation email\n *\n * @param request - Challenge friend request\n */\n async sendChallengeFriendEmail(\n request: ChallengeFriendRequest\n ): Promise<void> {\n try {\n await this.client.post(\"/mail/send-challenge-email\", request);\n } catch (error) {\n this.handleError(\"Failed to send challenge email\", error);\n }\n }\n\n /**\n * Send account deletion email\n *\n * @param authToken - User authentication token (required)\n */\n async sendDeleteAccountEmail(authToken: string): Promise<void> {\n try {\n await this.client.post(\n \"/mail/send-delete-email\",\n {},\n {\n headers: {\n Authorization: `Bearer ${authToken}`,\n },\n }\n );\n } catch (error) {\n this.handleError(\"Failed to send delete account email\", error);\n }\n }\n\n /**\n * Send export finished email\n *\n * @param authToken - User authentication token (required)\n */\n async sendExportFinishedEmail(authToken: string): Promise<void> {\n try {\n await this.client.post(\n \"/mail/send-export-finished-email\",\n {},\n {\n headers: {\n Authorization: `Bearer ${authToken}`,\n },\n }\n );\n } catch (error) {\n this.handleError(\"Failed to send export finished email\", error);\n }\n }\n\n /**\n * Send student questionnaire response to coach\n *\n * @param to - Coach email address\n * @param subject - Email subject line\n * @param html - HTML content of the email\n */\n async sendStudentResponseToCoach(params: {\n to: string;\n subject: string;\n html: string;\n }): Promise<void> {\n try {\n await this.client.post(\"/mail/send-student-response-to-coach\", params);\n } catch (error) {\n this.handleError(\"Failed to send student response to coach\", error);\n }\n }\n\n // ==================== Notification Management Methods ====================\n\n /**\n * Create a new notification template\n *\n * @param request - Notification template details\n * @returns The created notification UUID\n */\n async createNotification(\n request: CreateNotificationRequest\n ): Promise<string> {\n try {\n const response = await this.client.post(\n \"/notifications/create-notification\",\n request\n );\n return response.data.uuid;\n } catch (error) {\n this.handleError(\"Failed to create notification\", error);\n throw error;\n }\n }\n\n /**\n * Create a notification translation\n *\n * @param request - Translation details\n */\n async createNotificationTranslation(\n request: NotificationTranslationRequest\n ): Promise<void> {\n try {\n await this.client.post(\n \"/notifications/create-notification-translation\",\n request\n );\n } catch (error) {\n this.handleError(\"Failed to create notification translation\", error);\n }\n }\n\n /**\n * Update a notification template\n *\n * @param request - Updated notification details\n */\n async updateNotification(\n request: NotificationTranslationRequest\n ): Promise<void> {\n try {\n await this.client.put(\"/notifications/update-notification\", request);\n } catch (error) {\n this.handleError(\"Failed to update notification\", error);\n }\n }\n\n /**\n * Update a notification translation\n *\n * @param request - Updated translation details\n */\n async updateNotificationTranslation(\n request: NotificationTranslationRequest\n ): Promise<void> {\n try {\n await this.client.put(\n \"/notifications/update-notification-translation\",\n request\n );\n } catch (error) {\n this.handleError(\"Failed to update notification translation\", error);\n }\n }\n\n /**\n * Get all notifications, optionally filtered by language\n *\n * @param language - Optional language code to filter translations\n * @returns Array of notifications with translations\n */\n async getNotifications(language?: string): Promise<any[]> {\n try {\n const url = language\n ? `/notifications/get-notifications/${language}`\n : \"/notifications/get-notifications\";\n const response = await this.client.get(url);\n return response.data;\n } catch (error) {\n this.handleError(\"Failed to get notifications\", error);\n throw error;\n }\n }\n\n /**\n * Delete a notification or translation\n *\n * @param uuid - Notification UUID\n * @param language - Optional language code to delete only translation\n */\n async deleteNotification(uuid: string, language?: string): Promise<void> {\n try {\n const params = language ? { language } : {};\n await this.client.delete(`/notifications/delete-notifications/${uuid}`, {\n params,\n });\n } catch (error) {\n this.handleError(\"Failed to delete notification\", error);\n }\n }\n\n // ==================== Error Handling ====================\n\n /**\n * Handle and format errors from notification service\n */\n private handleError(message: string, error: unknown): void {\n if (axios.isAxiosError(error)) {\n const axiosError = error as AxiosError;\n const status = axiosError.response?.status;\n const data = axiosError.response?.data;\n\n console.error(`[NotificationClient] ${message}:`, {\n status,\n message: axiosError.message,\n data,\n });\n\n throw new Error(\n `${message}: ${status ? `HTTP ${status}` : axiosError.message}`\n );\n }\n\n console.error(`[NotificationClient] ${message}:`, error);\n throw new Error(`${message}: ${error}`);\n }\n}\n"],"names":["axios","NotificationClient","client","config","create","baseURL","timeout","headers","scheduleNotification","payload","post","error","handleError","sendToUser","userUuid","notification","response","data","messageId","sendToUsers","userUuids","sendToAllUsers","totalSent","sendGroupNotification","request","scheduleEmailReminder","sendAbandonedCart","sendPasswordRestoration","sendEmailConfirmation","authToken","Authorization","sendShopifyEmail","sendChallengeFriendEmail","sendDeleteAccountEmail","sendExportFinishedEmail","sendStudentResponseToCoach","params","createNotification","uuid","createNotificationTranslation","updateNotification","put","updateNotificationTranslation","getNotifications","language","url","get","deleteNotification","delete","message","isAxiosError","axiosError","status","console","Error"],"mappings":"AAAA,OAAOA,WAAW,QAAQ;AAkE1B;;;;;;CAMC,GACD,OAAO,MAAMC;IACHC,OAAsB;IAE9B;;;;;;;;;;;;GAYC,GACD,YAAYC,MAAgC,CAAE;QAC5C,IAAI,CAACD,MAAM,GAAGF,MAAMI,MAAM,CAAC;YACzBC,SAASF,OAAOE,OAAO;YACvBC,SAASH,OAAOG,OAAO,IAAI;YAC3BC,SAAS;gBACP,gBAAgB;gBAChB,GAAGJ,OAAOI,OAAO;YACnB;QACF;IACF;IAEA,sEAAsE;IAEtE;;;;;;;;;;;;GAYC,GACD,MAAMC,qBAAqBC,OAA4B,EAAiB;QACtE,IAAI;YACF,MAAM,IAAI,CAACP,MAAM,CAACQ,IAAI,CAAC,2BAA2BD;QACpD,EAAE,OAAOE,OAAO;YACd,IAAI,CAACC,WAAW,CAAC,mCAAmCD;QACtD;IACF;IAEA,MAAME,WACJC,QAAgB,EAChBC,YAAiC,EAChB;QACjB,IAAI;YACF,MAAMC,WAAW,MAAM,IAAI,CAACd,MAAM,CAACQ,IAAI,CAAC,+BAA+B;gBACrEI;gBACAC;YACF;YACA,OAAOC,SAASC,IAAI,CAACC,SAAS;QAChC,EAAE,OAAOP,OAAO;YACd,IAAI,CAACC,WAAW,CAAC,uCAAuCD;YACxD,MAAMA;QACR;IACF;IAEA;;;;;;;;;;;;;GAaC,GACD,MAAMQ,YACJC,SAAmB,EACnBL,YAAiC,EAClB;QACf,IAAI;YACF,MAAM,IAAI,CAACb,MAAM,CAACQ,IAAI,CAAC,gCAAgC;gBACrDU;gBACAL;YACF;QACF,EAAE,OAAOJ,OAAO;YACd,IAAI,CAACC,WA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