@strong-together/shared 2.8.0 → 2.10.0

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/index.js CHANGED
@@ -38,7 +38,7 @@ var authProviders = identitySchema.enum("Auth Providers", [
38
38
  ]);
39
39
 
40
40
  // ../../src/infrastructure/db/schema/drizzle/identity/user/table.ts
41
- import { relations as relations14, sql as drizzleSql24 } from "drizzle-orm";
41
+ import { relations as relations14, sql as drizzleSql21 } from "drizzle-orm";
42
42
  import { bigint as bigint11, boolean as boolean6, primaryKey as primaryKey14, text as text8, timestamp as timestamp10, uniqueIndex as uniqueIndex4, uuid as uuid11 } from "drizzle-orm/pg-core";
43
43
 
44
44
  // ../../src/infrastructure/db/schema/drizzle/messages/messages/table.ts
@@ -91,7 +91,7 @@ var message = messagesSchema.table("message", {
91
91
  msg: text("msg").default("Hello World").notNull(),
92
92
  sentAt: timestamp("sent_at", {
93
93
  withTimezone: true
94
- }).default(drizzleSql2`(now() AT TIME ZONE 'utc')`).notNull(),
94
+ }).defaultNow().notNull(),
95
95
  isRead: boolean("is_read").default(false).notNull()
96
96
  }, (t) => [
97
97
  primaryKey({
@@ -143,7 +143,7 @@ var messageRelations = relations(message, ({ one }) => ({
143
143
  }));
144
144
 
145
145
  // ../../src/infrastructure/db/schema/drizzle/reminders/user_reminder_setting/table.ts
146
- import { relations as relations2, sql as drizzleSql4 } from "drizzle-orm";
146
+ import { relations as relations2 } from "drizzle-orm";
147
147
  import { boolean as boolean2, foreignKey as foreignKey2, integer, primaryKey as primaryKey2, text as text2, timestamp as timestamp2, uuid as uuid2 } from "drizzle-orm/pg-core";
148
148
 
149
149
  // ../../src/infrastructure/db/schema/drizzle/reminders/user_reminder_setting/policies.ts
@@ -188,7 +188,7 @@ var userReminderSetting = remindersSchema.table("user_reminder_setting", {
188
188
  reminderOffsetMinutes: integer("reminder_offset_minutes").default(60).notNull(),
189
189
  updatedAt: timestamp2("updated_at", {
190
190
  withTimezone: true
191
- }).default(drizzleSql4`timezone('UTC', now())`).notNull(),
191
+ }).defaultNow().notNull(),
192
192
  timezone: text2("timezone").default("'UTC'::text")
193
193
  }, (t) => [
194
194
  primaryKey2({
@@ -220,19 +220,19 @@ var userReminderSettingRelations = relations2(userReminderSetting, ({ one }) =>
220
220
  }));
221
221
 
222
222
  // ../../src/infrastructure/db/schema/drizzle/reminders/user_split_information/table.ts
223
- import { relations as relations11, sql as drizzleSql18 } from "drizzle-orm";
223
+ import { relations as relations11, sql as drizzleSql17 } from "drizzle-orm";
224
224
  import { bigint as bigint9, foreignKey as foreignKey10, index as index8, integer as integer5, numeric, primaryKey as primaryKey11, timestamp as timestamp7, unique as unique4, uuid as uuid8 } from "drizzle-orm/pg-core";
225
225
 
226
226
  // ../../src/infrastructure/db/schema/drizzle/workout/workout_split/table.ts
227
- import { sql as drizzleSql17, relations as relations10 } from "drizzle-orm";
227
+ import { sql as drizzleSql16, relations as relations10 } from "drizzle-orm";
228
228
  import { bigint as bigint8, boolean as boolean5, foreignKey as foreignKey9, index as index7, integer as integer4, primaryKey as primaryKey10, text as text5, timestamp as timestamp6, uniqueIndex as uniqueIndex3 } from "drizzle-orm/pg-core";
229
229
 
230
230
  // ../../src/infrastructure/db/schema/drizzle/tracking/workout_summary/table.ts
231
- import { relations as relations8, sql as drizzleSql13 } from "drizzle-orm";
231
+ import { relations as relations8, sql as drizzleSql12 } from "drizzle-orm";
232
232
  import { bigint as bigint6, foreignKey as foreignKey7, index as index6, primaryKey as primaryKey8, timestamp as timestamp4, uuid as uuid6 } from "drizzle-orm/pg-core";
233
233
 
234
234
  // ../../src/infrastructure/db/schema/drizzle/tracking/exercise_tracking/table.ts
235
- import { relations as relations7, sql as drizzleSql11 } from "drizzle-orm";
235
+ import { relations as relations7, sql as drizzleSql10 } from "drizzle-orm";
236
236
  import { bigint as bigint5, foreignKey as foreignKey6, index as index5, primaryKey as primaryKey7, text as text4, uuid as uuid5 } from "drizzle-orm/pg-core";
237
237
 
238
238
  // ../../src/infrastructure/db/schema/drizzle/workout/exercises/table.ts
@@ -240,7 +240,7 @@ import { relations as relations5 } from "drizzle-orm";
240
240
  import { bigint as bigint3, primaryKey as primaryKey5, text as text3, uniqueIndex } from "drizzle-orm/pg-core";
241
241
 
242
242
  // ../../src/infrastructure/db/schema/drizzle/workout/exercisetoworkoutsplit/table.ts
243
- import { relations as relations4, sql as drizzleSql7 } from "drizzle-orm";
243
+ import { relations as relations4, sql as drizzleSql6 } from "drizzle-orm";
244
244
  import { bigint as bigint2, boolean as boolean3, foreignKey as foreignKey4, index as index3, primaryKey as primaryKey4, timestamp as timestamp3, unique as unique2 } from "drizzle-orm/pg-core";
245
245
 
246
246
  // ../../src/infrastructure/db/schema/drizzle/workout/workout_set/table.ts
@@ -248,11 +248,11 @@ import { relations as relations3 } from "drizzle-orm";
248
248
  import { bigint, foreignKey as foreignKey3, index as index2, integer as integer2, primaryKey as primaryKey3, unique, uuid as uuid3 } from "drizzle-orm/pg-core";
249
249
 
250
250
  // ../../src/infrastructure/db/schema/drizzle/workout/workout_set/policies.ts
251
- import { sql as drizzleSql5 } from "drizzle-orm";
251
+ import { sql as drizzleSql4 } from "drizzle-orm";
252
252
  import { pgPolicy as pgPolicy3 } from "drizzle-orm/pg-core";
253
- var currentUserId = drizzleSql5`"identity"."current_user_id"()`;
253
+ var currentUserId = drizzleSql4`"identity"."current_user_id"()`;
254
254
  function workoutSetPolicies(table) {
255
- const ownsWorkoutSet = drizzleSql5`exists (
255
+ const ownsWorkoutSet = drizzleSql4`exists (
256
256
  select 1
257
257
  from "workout"."exercise_to_workout_split" ets
258
258
  join "workout"."workout_split" ws on ws."id" = ets."workout_split_id"
@@ -330,12 +330,12 @@ var workoutSetRelations = relations3(workoutSet, ({ one }) => ({
330
330
  }));
331
331
 
332
332
  // ../../src/infrastructure/db/schema/drizzle/workout/exercisetoworkoutsplit/policies.ts
333
- import { sql as drizzleSql6 } from "drizzle-orm";
333
+ import { sql as drizzleSql5 } from "drizzle-orm";
334
334
  import { pgPolicy as pgPolicy4 } from "drizzle-orm/pg-core";
335
- var uid4 = drizzleSql6`"identity"."current_user_id"()`;
335
+ var uid4 = drizzleSql5`"identity"."current_user_id"()`;
336
336
  function exerciseToWorkoutSplitPolicies(t) {
337
- const owns = drizzleSql6`${uid4} = (select wp."user_id" from "workout"."workout_plan" wp join "workout"."workout_split" ws on ws."workout_id" = wp."id" where ws."id" = ${t.workoutSplitId})`;
338
- const ownsForDelete = drizzleSql6`exists (select 1 from "workout"."workout_split" ws join "workout"."workout_plan" wp on wp."id" = ws."workout_id" where ws."id" = ${t.workoutSplitId} and wp."user_id" = ${uid4})`;
337
+ const owns = drizzleSql5`${uid4} = (select wp."user_id" from "workout"."workout_plan" wp join "workout"."workout_split" ws on ws."workout_id" = wp."id" where ws."id" = ${t.workoutSplitId})`;
338
+ const ownsForDelete = drizzleSql5`exists (select 1 from "workout"."workout_split" ws join "workout"."workout_plan" wp on wp."id" = ws."workout_id" where ws."id" = ${t.workoutSplitId} and wp."user_id" = ${uid4})`;
339
339
  return [
340
340
  // Lets authenticated users read exercise assignments in splits they own.
341
341
  pgPolicy4("Enable read access for auth users on exercise_to_workout_split", {
@@ -381,7 +381,7 @@ var exerciseToWorkoutSplit = workoutSchema.table("exercise_to_workout_split", {
381
381
  }).notNull(),
382
382
  createdAt: timestamp3("created_at", {
383
383
  withTimezone: true
384
- }).default(drizzleSql7`(now() AT TIME ZONE 'utc')`).notNull(),
384
+ }).defaultNow().notNull(),
385
385
  orderIndex: bigint2("order_index", {
386
386
  mode: "number"
387
387
  }).notNull(),
@@ -412,7 +412,7 @@ var exerciseToWorkoutSplit = workoutSchema.table("exercise_to_workout_split", {
412
412
  workoutSplit.id
413
413
  ]
414
414
  }).onUpdate("cascade").onDelete("cascade"),
415
- index3("exercise_to_workout_split_active_idx").on(t.workoutSplitId, t.orderIndex).where(drizzleSql7`${t.isActive} = true`),
415
+ index3("exercise_to_workout_split_active_idx").on(t.workoutSplitId, t.orderIndex).where(drizzleSql6`${t.isActive} = true`),
416
416
  index3("exercise_to_workout_split_workout_split_id_order_index_idx").on(t.workoutSplitId, t.orderIndex),
417
417
  ...exerciseToWorkoutSplitPolicies(t)
418
418
  ]);
@@ -438,14 +438,14 @@ var exerciseToWorkoutSplitRelations = relations4(exerciseToWorkoutSplit, ({ many
438
438
  }));
439
439
 
440
440
  // ../../src/infrastructure/db/schema/drizzle/workout/exercises/policies.ts
441
- import { sql as drizzleSql8 } from "drizzle-orm";
441
+ import { sql as drizzleSql7 } from "drizzle-orm";
442
442
  import { pgPolicy as pgPolicy5 } from "drizzle-orm/pg-core";
443
443
  var exercisePolicies = /* @__PURE__ */ __name(() => [
444
444
  // Makes the shared exercise catalog readable to every authenticated user.
445
445
  pgPolicy5("Allow all authenticated users to read exercise", {
446
446
  for: "select",
447
447
  to: authenticatedRole,
448
- using: drizzleSql8`true`
448
+ using: drizzleSql7`true`
449
449
  })
450
450
  ], "exercisePolicies");
451
451
 
@@ -479,11 +479,11 @@ import { relations as relations6 } from "drizzle-orm";
479
479
  import { bigint as bigint4, foreignKey as foreignKey5, index as index4, integer as integer3, primaryKey as primaryKey6, real, unique as unique3, uuid as uuid4 } from "drizzle-orm/pg-core";
480
480
 
481
481
  // ../../src/infrastructure/db/schema/drizzle/tracking/tracking_set/policies.ts
482
- import { sql as drizzleSql9 } from "drizzle-orm";
482
+ import { sql as drizzleSql8 } from "drizzle-orm";
483
483
  import { pgPolicy as pgPolicy6 } from "drizzle-orm/pg-core";
484
- var currentUserId2 = drizzleSql9`"identity"."current_user_id"()`;
484
+ var currentUserId2 = drizzleSql8`"identity"."current_user_id"()`;
485
485
  function trackingSetPolicies(table) {
486
- const ownsExerciseTracking = drizzleSql9`exists (
486
+ const ownsExerciseTracking = drizzleSql8`exists (
487
487
  select 1
488
488
  from "tracking"."exercise_tracking" et
489
489
  join "tracking"."workout_summary" ws on ws."id" = et."workout_summary_id"
@@ -561,11 +561,11 @@ var trackingSetRelations = relations6(trackingSet, ({ one }) => ({
561
561
  }));
562
562
 
563
563
  // ../../src/infrastructure/db/schema/drizzle/tracking/exercise_tracking/policies.ts
564
- import { sql as drizzleSql10 } from "drizzle-orm";
564
+ import { sql as drizzleSql9 } from "drizzle-orm";
565
565
  import { pgPolicy as pgPolicy7 } from "drizzle-orm/pg-core";
566
- var uid5 = drizzleSql10`"identity"."current_user_id"()`;
566
+ var uid5 = drizzleSql9`"identity"."current_user_id"()`;
567
567
  function exerciseTrackingPolicies(t) {
568
- const owns = drizzleSql10`exists (select 1 from "tracking"."workout_summary" ws where ws."id" = ${t.workoutSummaryId} and ws."user_id" = ${uid5})`;
568
+ const owns = drizzleSql9`exists (select 1 from "tracking"."workout_summary" ws where ws."id" = ${t.workoutSummaryId} and ws."user_id" = ${uid5})`;
569
569
  return [
570
570
  // Lets authenticated users read exercise tracking rows through summaries they own.
571
571
  pgPolicy7("exercise_tracking_select_by_summary_owner", {
@@ -646,7 +646,7 @@ var exerciseTracking = trackingSchema.table("exercise_tracking", {
646
646
  workoutSummary.id
647
647
  ]
648
648
  }).onUpdate("cascade").onDelete("cascade"),
649
- check("exercise_tracking_xor_check", drizzleSql11`num_nonnulls(${t.exerciseToSplitId}, ${t.exerciseId}) = 1`),
649
+ check("exercise_tracking_xor_check", drizzleSql10`num_nonnulls(${t.exerciseToSplitId}, ${t.exerciseId}) = 1`),
650
650
  index5("exercise_tracking_workout_summary_id_idx").on(t.workoutSummaryId),
651
651
  ...exerciseTrackingPolicies(t)
652
652
  ]);
@@ -679,35 +679,35 @@ var exerciseTrackingRelations = relations7(exerciseTracking, ({ many, one }) =>
679
679
  }));
680
680
 
681
681
  // ../../src/infrastructure/db/schema/drizzle/tracking/workout_summary/policies.ts
682
- import { sql as drizzleSql12 } from "drizzle-orm";
682
+ import { sql as drizzleSql11 } from "drizzle-orm";
683
683
  import { pgPolicy as pgPolicy8 } from "drizzle-orm/pg-core";
684
- var uid6 = drizzleSql12`"identity"."current_user_id"()`;
684
+ var uid6 = drizzleSql11`"identity"."current_user_id"()`;
685
685
  function workoutSummaryPolicies(t) {
686
686
  return [
687
687
  // Lets authenticated users read only their own completed workout summaries.
688
688
  pgPolicy8("users can read their workout summaries", {
689
689
  for: "select",
690
690
  to: authenticatedRole,
691
- using: drizzleSql12`${t.userId} = ${uid6}`
691
+ using: drizzleSql11`${t.userId} = ${uid6}`
692
692
  }),
693
693
  // Lets authenticated users insert completed workout summaries only for themselves.
694
694
  pgPolicy8("users can insert their workout summaries", {
695
695
  for: "insert",
696
696
  to: authenticatedRole,
697
- withCheck: drizzleSql12`${t.userId} = ${uid6}`
697
+ withCheck: drizzleSql11`${t.userId} = ${uid6}`
698
698
  }),
699
699
  // Lets authenticated users update only their own completed workout summaries.
700
700
  pgPolicy8("users can update their workout summaries", {
701
701
  for: "update",
702
702
  to: authenticatedRole,
703
- using: drizzleSql12`${t.userId} = ${uid6}`,
704
- withCheck: drizzleSql12`${t.userId} = ${uid6}`
703
+ using: drizzleSql11`${t.userId} = ${uid6}`,
704
+ withCheck: drizzleSql11`${t.userId} = ${uid6}`
705
705
  }),
706
706
  // Lets authenticated users delete only their own completed workout summaries.
707
707
  pgPolicy8("users can delete their workout summaries", {
708
708
  for: "delete",
709
709
  to: authenticatedRole,
710
- using: drizzleSql12`${t.userId} = ${uid6}`
710
+ using: drizzleSql11`${t.userId} = ${uid6}`
711
711
  })
712
712
  ];
713
713
  }
@@ -754,7 +754,7 @@ var workoutSummary = trackingSchema.table("workout_summary", {
754
754
  workoutSplit.id
755
755
  ]
756
756
  }).onUpdate("cascade").onDelete("cascade"),
757
- index6("workout_summary_start_date_idx").on(drizzleSql13`((${t.workoutStartUtc} at time zone 'UTC')::date)`),
757
+ index6("workout_summary_start_date_idx").on(drizzleSql12`((${t.workoutStartUtc} at time zone 'UTC')::date)`),
758
758
  index6("workout_summary_user_start_utc_idx").on(t.userId, t.workoutStartUtc.desc().nullsFirst()),
759
759
  ...workoutSummaryPolicies(t)
760
760
  ]);
@@ -779,39 +779,39 @@ var workoutSummaryRelations = relations8(workoutSummary, ({ many, one }) => ({
779
779
  }));
780
780
 
781
781
  // ../../src/infrastructure/db/schema/drizzle/workout/workout_plan/table.ts
782
- import { relations as relations9, sql as drizzleSql15 } from "drizzle-orm";
782
+ import { relations as relations9, sql as drizzleSql14 } from "drizzle-orm";
783
783
  import { bigint as bigint7, boolean as boolean4, foreignKey as foreignKey8, primaryKey as primaryKey9, timestamp as timestamp5, uniqueIndex as uniqueIndex2, uuid as uuid7 } from "drizzle-orm/pg-core";
784
784
 
785
785
  // ../../src/infrastructure/db/schema/drizzle/workout/workout_plan/policies.ts
786
- import { sql as drizzleSql14 } from "drizzle-orm";
786
+ import { sql as drizzleSql13 } from "drizzle-orm";
787
787
  import { pgPolicy as pgPolicy9 } from "drizzle-orm/pg-core";
788
- var uid7 = drizzleSql14`"identity"."current_user_id"()`;
788
+ var uid7 = drizzleSql13`"identity"."current_user_id"()`;
789
789
  function workoutPlanPolicies(t) {
790
790
  return [
791
791
  // Lets authenticated users read only workout plans they own.
792
792
  pgPolicy9("Enable read access for auth users on workout_plan", {
793
793
  for: "select",
794
794
  to: authenticatedRole,
795
- using: drizzleSql14`${uid7} = ${t.userId}`
795
+ using: drizzleSql13`${uid7} = ${t.userId}`
796
796
  }),
797
797
  // Lets authenticated users create workout plans only for themselves.
798
798
  pgPolicy9("Enable insert for auth users on workout_plan", {
799
799
  for: "insert",
800
800
  to: authenticatedRole,
801
- withCheck: drizzleSql14`${uid7} = ${t.userId}`
801
+ withCheck: drizzleSql13`${uid7} = ${t.userId}`
802
802
  }),
803
803
  // Lets authenticated users update only workout plans they own.
804
804
  pgPolicy9("Enable update for auth users on workout_plan", {
805
805
  for: "update",
806
806
  to: authenticatedRole,
807
- using: drizzleSql14`${uid7} = ${t.userId}`,
808
- withCheck: drizzleSql14`${uid7} = ${t.userId}`
807
+ using: drizzleSql13`${uid7} = ${t.userId}`,
808
+ withCheck: drizzleSql13`${uid7} = ${t.userId}`
809
809
  }),
810
810
  // Lets authenticated users delete only workout plans they own.
811
811
  pgPolicy9("Enable delete for auth users on workout_plan", {
812
812
  for: "delete",
813
813
  to: authenticatedRole,
814
- using: drizzleSql14`${uid7} = ${t.userId}`
814
+ using: drizzleSql13`${uid7} = ${t.userId}`
815
815
  })
816
816
  ];
817
817
  }
@@ -828,7 +828,7 @@ var workoutPlan = workoutSchema.table("workout_plan", {
828
828
  isActive: boolean4("is_active").default(true).notNull(),
829
829
  updatedAt: timestamp5("updated_at", {
830
830
  withTimezone: true
831
- }).default(drizzleSql15`(now() AT TIME ZONE 'utc')`).notNull(),
831
+ }).defaultNow().notNull(),
832
832
  createdAt: timestamp5("created_at", {
833
833
  withTimezone: true
834
834
  }).defaultNow().notNull()
@@ -848,7 +848,7 @@ var workoutPlan = workoutSchema.table("workout_plan", {
848
848
  user.id
849
849
  ]
850
850
  }).onUpdate("cascade").onDelete("cascade"),
851
- uniqueIndex2("uq_workout_plan_active_user").on(t.userId).where(drizzleSql15`${t.isActive}`),
851
+ uniqueIndex2("uq_workout_plan_active_user").on(t.userId).where(drizzleSql14`${t.isActive}`),
852
852
  ...workoutPlanPolicies(t)
853
853
  ]);
854
854
  var workoutPlanRelations = relations9(workoutPlan, ({ many, one }) => ({
@@ -865,12 +865,12 @@ var workoutPlanRelations = relations9(workoutPlan, ({ many, one }) => ({
865
865
  }));
866
866
 
867
867
  // ../../src/infrastructure/db/schema/drizzle/workout/workout_split/policies.ts
868
- import { sql as drizzleSql16 } from "drizzle-orm";
868
+ import { sql as drizzleSql15 } from "drizzle-orm";
869
869
  import { pgPolicy as pgPolicy10 } from "drizzle-orm/pg-core";
870
- var uid8 = drizzleSql16`"identity"."current_user_id"()`;
870
+ var uid8 = drizzleSql15`"identity"."current_user_id"()`;
871
871
  function workoutSplitPolicies(t) {
872
- const owns = drizzleSql16`${uid8} = (select wp."user_id" from "workout"."workout_plan" wp where wp."id" = ${t.workoutId})`;
873
- const ownsForDelete = drizzleSql16`exists (select 1 from "workout"."workout_plan" wp where wp."id" = ${t.workoutId} and wp."user_id" = ${uid8})`;
872
+ const owns = drizzleSql15`${uid8} = (select wp."user_id" from "workout"."workout_plan" wp where wp."id" = ${t.workoutId})`;
873
+ const ownsForDelete = drizzleSql15`exists (select 1 from "workout"."workout_plan" wp where wp."id" = ${t.workoutId} and wp."user_id" = ${uid8})`;
874
874
  return [
875
875
  // Lets authenticated users read splits belonging to their own plans.
876
876
  pgPolicy10("Enable read access for auth users on workout_split", {
@@ -915,7 +915,7 @@ var workoutSplit = workoutSchema.table("workout_split", {
915
915
  orderIndex: integer4("order_index").notNull(),
916
916
  createdAt: timestamp6("created_at", {
917
917
  withTimezone: true
918
- }).default(drizzleSql17`(NOW() AT TIME ZONE 'utc')`).notNull(),
918
+ }).defaultNow().notNull(),
919
919
  isActive: boolean5("is_active").default(true).notNull()
920
920
  }, (t) => [
921
921
  primaryKey10({
@@ -924,7 +924,7 @@ var workoutSplit = workoutSchema.table("workout_split", {
924
924
  t.id
925
925
  ]
926
926
  }),
927
- uniqueIndex3("uq_active_workout_split_order_index").on(t.workoutId, t.orderIndex).where(drizzleSql17`${t.isActive} = TRUE`),
927
+ uniqueIndex3("uq_active_workout_split_order_index").on(t.workoutId, t.orderIndex).where(drizzleSql16`${t.isActive} = TRUE`),
928
928
  foreignKey9({
929
929
  name: "workout_split_workout_id_fkey",
930
930
  columns: [
@@ -971,7 +971,7 @@ var userSplitInformation = remindersSchema.table("user_split_information", {
971
971
  }).default("1.00").notNull(),
972
972
  lastComputedAt: timestamp7("last_computed_at", {
973
973
  withTimezone: true
974
- }).default(drizzleSql18`timezone('UTC', now())`).notNull(),
974
+ }).defaultNow().notNull(),
975
975
  preferredWeekday: integer5("preferred_weekday")
976
976
  }, (t) => [
977
977
  primaryKey11({
@@ -999,8 +999,8 @@ var userSplitInformation = remindersSchema.table("user_split_information", {
999
999
  workoutSplit.id
1000
1000
  ]
1001
1001
  }).onDelete("cascade"),
1002
- index8("user_split_information_confidence_idx").on(t.preferredWeekday, t.confidence).where(drizzleSql18`${t.confidence} >= 0.60`),
1003
- index8("user_split_information_user_weekday_idx").on(t.userId, t.preferredWeekday).where(drizzleSql18`${t.preferredWeekday} is not null`)
1002
+ index8("user_split_information_confidence_idx").on(t.preferredWeekday, t.confidence).where(drizzleSql17`${t.confidence} >= 0.60`),
1003
+ index8("user_split_information_user_weekday_idx").on(t.userId, t.preferredWeekday).where(drizzleSql17`${t.preferredWeekday} is not null`)
1004
1004
  ]).enableRLS();
1005
1005
  var userSplitInformationRelations = relations11(userSplitInformation, ({ one }) => ({
1006
1006
  user: one(user, {
@@ -1022,39 +1022,39 @@ var userSplitInformationRelations = relations11(userSplitInformation, ({ one })
1022
1022
  }));
1023
1023
 
1024
1024
  // ../../src/infrastructure/db/schema/drizzle/tracking/aerobic_tracking/table.ts
1025
- import { relations as relations12, sql as drizzleSql20 } from "drizzle-orm";
1025
+ import { relations as relations12 } from "drizzle-orm";
1026
1026
  import { bigint as bigint10, foreignKey as foreignKey11, index as index9, primaryKey as primaryKey12, text as text6, timestamp as timestamp8, uuid as uuid9 } from "drizzle-orm/pg-core";
1027
1027
 
1028
1028
  // ../../src/infrastructure/db/schema/drizzle/tracking/aerobic_tracking/policies.ts
1029
- import { sql as drizzleSql19 } from "drizzle-orm";
1029
+ import { sql as drizzleSql18 } from "drizzle-orm";
1030
1030
  import { pgPolicy as pgPolicy11 } from "drizzle-orm/pg-core";
1031
- var uid9 = drizzleSql19`"identity"."current_user_id"()`;
1031
+ var uid9 = drizzleSql18`"identity"."current_user_id"()`;
1032
1032
  function aerobicTrackingPolicies(t) {
1033
1033
  return [
1034
1034
  // Lets authenticated users read only their own aerobic tracking rows.
1035
1035
  pgPolicy11("Enable read access for auth users on aerobic_tracking", {
1036
1036
  for: "select",
1037
1037
  to: authenticatedRole,
1038
- using: drizzleSql19`${uid9} = ${t.userId}`
1038
+ using: drizzleSql18`${uid9} = ${t.userId}`
1039
1039
  }),
1040
1040
  // Lets authenticated users insert aerobic tracking rows only for themselves.
1041
1041
  pgPolicy11("Enable insert for auth users on aerobic_tracking", {
1042
1042
  for: "insert",
1043
1043
  to: authenticatedRole,
1044
- withCheck: drizzleSql19`${uid9} = ${t.userId}`
1044
+ withCheck: drizzleSql18`${uid9} = ${t.userId}`
1045
1045
  }),
1046
1046
  // Lets authenticated users update only their own aerobic tracking rows.
1047
1047
  pgPolicy11("Enable update for auth users on aerobic_tracking", {
1048
1048
  for: "update",
1049
1049
  to: authenticatedRole,
1050
- using: drizzleSql19`${uid9} = ${t.userId}`,
1051
- withCheck: drizzleSql19`${uid9} = ${t.userId}`
1050
+ using: drizzleSql18`${uid9} = ${t.userId}`,
1051
+ withCheck: drizzleSql18`${uid9} = ${t.userId}`
1052
1052
  }),
1053
1053
  // Lets authenticated users delete only their own aerobic tracking rows.
1054
1054
  pgPolicy11("Enable delete for auth users on aerobic_tracking", {
1055
1055
  for: "delete",
1056
1056
  to: authenticatedRole,
1057
- using: drizzleSql19`${uid9} = ${t.userId}`
1057
+ using: drizzleSql18`${uid9} = ${t.userId}`
1058
1058
  })
1059
1059
  ];
1060
1060
  }
@@ -1074,7 +1074,7 @@ var aerobicTracking = trackingSchema.table("aerobic_tracking", {
1074
1074
  }).default(0).notNull(),
1075
1075
  workoutTimeUtc: timestamp8("workout_time_utc", {
1076
1076
  withTimezone: true
1077
- }).default(drizzleSql20`(now() AT TIME ZONE 'utc')`).notNull()
1077
+ }).defaultNow().notNull()
1078
1078
  }, (t) => [
1079
1079
  primaryKey12({
1080
1080
  name: "aerobic_tracking_pkey",
@@ -1106,39 +1106,39 @@ var aerobicTrackingRelations = relations12(aerobicTracking, ({ one }) => ({
1106
1106
  }));
1107
1107
 
1108
1108
  // ../../src/infrastructure/db/schema/drizzle/identity/oauth_account/table.ts
1109
- import { relations as relations13, sql as drizzleSql22 } from "drizzle-orm";
1109
+ import { relations as relations13 } from "drizzle-orm";
1110
1110
  import { foreignKey as foreignKey12, primaryKey as primaryKey13, text as text7, timestamp as timestamp9, unique as unique5, uuid as uuid10 } from "drizzle-orm/pg-core";
1111
1111
 
1112
1112
  // ../../src/infrastructure/db/schema/drizzle/identity/oauth_account/policies.ts
1113
- import { sql as drizzleSql21 } from "drizzle-orm";
1113
+ import { sql as drizzleSql19 } from "drizzle-orm";
1114
1114
  import { pgPolicy as pgPolicy12 } from "drizzle-orm/pg-core";
1115
- var currentUserId3 = drizzleSql21`"identity"."current_user_id"()`;
1115
+ var currentUserId3 = drizzleSql19`"identity"."current_user_id"()`;
1116
1116
  function oauthAccountPolicies(table) {
1117
1117
  return [
1118
1118
  // Lets authenticated users read only OAuth accounts linked to themselves.
1119
1119
  pgPolicy12("Enable read access for auth users on oauth_account", {
1120
1120
  for: "select",
1121
1121
  to: authenticatedRole,
1122
- using: drizzleSql21`${currentUserId3} = ${table.userId}`
1122
+ using: drizzleSql19`${currentUserId3} = ${table.userId}`
1123
1123
  }),
1124
1124
  // Lets authenticated users link OAuth accounts only to themselves.
1125
1125
  pgPolicy12("Enable insert for auth users on oauth_account", {
1126
1126
  for: "insert",
1127
1127
  to: authenticatedRole,
1128
- withCheck: drizzleSql21`${currentUserId3} = ${table.userId}`
1128
+ withCheck: drizzleSql19`${currentUserId3} = ${table.userId}`
1129
1129
  }),
1130
1130
  // Lets authenticated users update only OAuth accounts linked to themselves.
1131
1131
  pgPolicy12("Enable update for auth users on oauth_account", {
1132
1132
  for: "update",
1133
1133
  to: authenticatedRole,
1134
- using: drizzleSql21`${currentUserId3} = ${table.userId}`,
1135
- withCheck: drizzleSql21`${currentUserId3} = ${table.userId}`
1134
+ using: drizzleSql19`${currentUserId3} = ${table.userId}`,
1135
+ withCheck: drizzleSql19`${currentUserId3} = ${table.userId}`
1136
1136
  }),
1137
1137
  // Lets authenticated users delete only OAuth accounts linked to themselves.
1138
1138
  pgPolicy12("Enable delete for auth users on oauth_account", {
1139
1139
  for: "delete",
1140
1140
  to: authenticatedRole,
1141
- using: drizzleSql21`${currentUserId3} = ${table.userId}`
1141
+ using: drizzleSql19`${currentUserId3} = ${table.userId}`
1142
1142
  })
1143
1143
  ];
1144
1144
  }
@@ -1153,7 +1153,7 @@ var oauthAccount = identitySchema.table("oauth_account", {
1153
1153
  providerEmail: text7("provider_email").notNull(),
1154
1154
  linkedAt: timestamp9("linked_at", {
1155
1155
  withTimezone: true
1156
- }).default(drizzleSql22`(now() AT TIME ZONE 'utc')`).notNull(),
1156
+ }).defaultNow().notNull(),
1157
1157
  missingFields: text7("missing_fields")
1158
1158
  }, (t) => [
1159
1159
  primaryKey13({
@@ -1186,47 +1186,47 @@ var oauthAccountRelations = relations13(oauthAccount, ({ one }) => ({
1186
1186
  }));
1187
1187
 
1188
1188
  // ../../src/infrastructure/db/schema/drizzle/identity/user/policies.ts
1189
- import { sql as drizzleSql23 } from "drizzle-orm";
1189
+ import { sql as drizzleSql20 } from "drizzle-orm";
1190
1190
  import { pgPolicy as pgPolicy13 } from "drizzle-orm/pg-core";
1191
- var currentUserId4 = drizzleSql23`"identity"."current_user_id"()`;
1191
+ var currentUserId4 = drizzleSql20`"identity"."current_user_id"()`;
1192
1192
  function userPolicies(table) {
1193
1193
  return [
1194
1194
  // Lets an authenticated user read their own profile.
1195
1195
  pgPolicy13("Enable read access for auth users on own profile", {
1196
1196
  for: "select",
1197
1197
  to: authenticatedRole,
1198
- using: drizzleSql23`${currentUserId4} = ${table.id}`
1198
+ using: drizzleSql20`${currentUserId4} = ${table.id}`
1199
1199
  }),
1200
1200
  // Lets a message receiver read the profile of a sender in their inbox.
1201
1201
  pgPolicy13("Allow user to view senders in their messages", {
1202
1202
  for: "select",
1203
1203
  to: authenticatedRole,
1204
- using: drizzleSql23`exists (select 1 from "messages"."message" m where m."sender_id" = ${table.id} and m."receiver_id" = ${currentUserId4})`
1204
+ using: drizzleSql20`exists (select 1 from "messages"."message" m where m."sender_id" = ${table.id} and m."receiver_id" = ${currentUserId4})`
1205
1205
  }),
1206
1206
  // Lets an authenticated user create only their own profile row.
1207
1207
  pgPolicy13("Enable insert for auth users on own profile", {
1208
1208
  for: "insert",
1209
1209
  to: authenticatedRole,
1210
- withCheck: drizzleSql23`${currentUserId4} = ${table.id}`
1210
+ withCheck: drizzleSql20`${currentUserId4} = ${table.id}`
1211
1211
  }),
1212
1212
  // Preserves the legacy public self-registration policy for compatibility.
1213
1213
  pgPolicy13("Enable insert for public users on own profile", {
1214
1214
  for: "insert",
1215
1215
  to: "public",
1216
- withCheck: drizzleSql23`${currentUserId4} = ${table.id}`
1216
+ withCheck: drizzleSql20`${currentUserId4} = ${table.id}`
1217
1217
  }),
1218
1218
  // Lets an authenticated user update only their own profile.
1219
1219
  pgPolicy13("Enable update for auth users on own profile", {
1220
1220
  for: "update",
1221
1221
  to: authenticatedRole,
1222
- using: drizzleSql23`${currentUserId4} = ${table.id}`,
1223
- withCheck: drizzleSql23`${currentUserId4} = ${table.id}`
1222
+ using: drizzleSql20`${currentUserId4} = ${table.id}`,
1223
+ withCheck: drizzleSql20`${currentUserId4} = ${table.id}`
1224
1224
  }),
1225
1225
  // Lets an authenticated user delete only their own profile.
1226
1226
  pgPolicy13("Enable delete for auth users on own profile", {
1227
1227
  for: "delete",
1228
1228
  to: authenticatedRole,
1229
- using: drizzleSql23`${currentUserId4} = ${table.id}`
1229
+ using: drizzleSql20`${currentUserId4} = ${table.id}`
1230
1230
  })
1231
1231
  ];
1232
1232
  }
@@ -1240,10 +1240,10 @@ var user = identitySchema.table("user", {
1240
1240
  gender: text8("gender").default("Unknown").notNull(),
1241
1241
  createdAt: timestamp10("created_at", {
1242
1242
  withTimezone: true
1243
- }).default(drizzleSql24`(now() AT TIME ZONE 'utc')`).notNull(),
1243
+ }).defaultNow().notNull(),
1244
1244
  updatedAt: timestamp10("updated_at", {
1245
1245
  withTimezone: true
1246
- }).default(drizzleSql24`(now() AT TIME ZONE 'utc')`).notNull(),
1246
+ }).defaultNow().notNull(),
1247
1247
  profilePicPath: text8("profile_pic_path"),
1248
1248
  id: uuid11("id").defaultRandom().notNull(),
1249
1249
  pushToken: text8("push_token"),
@@ -1264,8 +1264,8 @@ var user = identitySchema.table("user", {
1264
1264
  t.id
1265
1265
  ]
1266
1266
  }),
1267
- uniqueIndex4("user_email_ci_unique").on(drizzleSql24`lower(trim(both from ${t.email}))`),
1268
- uniqueIndex4("user_username_ci_unique").on(drizzleSql24`lower(trim(both from ${t.username}))`),
1267
+ uniqueIndex4("user_email_ci_unique").on(drizzleSql21`lower(trim(both from ${t.email}))`),
1268
+ uniqueIndex4("user_username_ci_unique").on(drizzleSql21`lower(trim(both from ${t.username}))`),
1269
1269
  ...userPolicies(t)
1270
1270
  ]);
1271
1271
  var userRelations = relations14(user, ({ many, one }) => ({
@@ -1290,7 +1290,7 @@ var userRelations = relations14(user, ({ many, one }) => ({
1290
1290
 
1291
1291
  // ../../src/infrastructure/db/schema/drizzle/workout/views/exercise-to-workoutsplit-expanded.view.ts
1292
1292
  import { bigint as bigint12, boolean as boolean7, text as text9, timestamp as timestamp11 } from "drizzle-orm/pg-core";
1293
- import { sql as drizzleSql25 } from "drizzle-orm";
1293
+ import { sql as drizzleSql22 } from "drizzle-orm";
1294
1294
  import { integer as integer6 } from "drizzle-orm/pg-core";
1295
1295
  var exerciseToWorkoutSplitSetExpandedView = workoutSchema.view("v_exercise_to_workout_split_set_expanded", {
1296
1296
  id: bigint12("id", {
@@ -1318,7 +1318,7 @@ var exerciseToWorkoutSplitSetExpandedView = workoutSchema.view("v_exercise_to_wo
1318
1318
  isActive: boolean7("is_active")
1319
1319
  }).with({
1320
1320
  securityInvoker: true
1321
- }).as(drizzleSql25`
1321
+ }).as(drizzleSql22`
1322
1322
  SELECT
1323
1323
  ews.id,
1324
1324
  ews.workout_split_id,
@@ -1351,7 +1351,7 @@ var exerciseToWorkoutSplitSetExpandedView = workoutSchema.view("v_exercise_to_wo
1351
1351
  `);
1352
1352
 
1353
1353
  // ../../src/infrastructure/db/schema/drizzle/analytics/views/exercise-tracking-expanded.view.ts
1354
- import { sql as drizzleSql26 } from "drizzle-orm";
1354
+ import { sql as drizzleSql23 } from "drizzle-orm";
1355
1355
  import { bigint as bigint13, boolean as boolean8, real as real2, text as text10, timestamp as timestamp12, uuid as uuid12 } from "drizzle-orm/pg-core";
1356
1356
  import { integer as integer7 } from "drizzle-orm/pg-core";
1357
1357
  var exerciseTrackingSetExpandedView = analyticsSchema.view("v_exercise_tracking_set_expanded", {
@@ -1388,7 +1388,7 @@ var exerciseTrackingSetExpandedView = analyticsSchema.view("v_exercise_tracking_
1388
1388
  isAssignedToSplit: boolean8("is_assigned_to_split")
1389
1389
  }).with({
1390
1390
  securityInvoker: true
1391
- }).as(drizzleSql26`
1391
+ }).as(drizzleSql23`
1392
1392
  SELECT
1393
1393
  et.id,
1394
1394
  et.exercise_to_split_id,
@@ -1420,7 +1420,7 @@ var exerciseTrackingSetExpandedView = analyticsSchema.view("v_exercise_tracking_
1420
1420
  `);
1421
1421
 
1422
1422
  // ../../src/infrastructure/db/schema/drizzle/analytics/views/prs.view.ts
1423
- import { sql as drizzleSql27 } from "drizzle-orm";
1423
+ import { sql as drizzleSql24 } from "drizzle-orm";
1424
1424
  import { bigint as bigint14, real as real3, text as text11, timestamp as timestamp13, uuid as uuid13 } from "drizzle-orm/pg-core";
1425
1425
  import { integer as integer8 } from "drizzle-orm/pg-core";
1426
1426
  var prsView = analyticsSchema.view("v_prs", {
@@ -1448,7 +1448,7 @@ var prsView = analyticsSchema.view("v_prs", {
1448
1448
  })
1449
1449
  }).with({
1450
1450
  securityInvoker: true
1451
- }).as(drizzleSql27`
1451
+ }).as(drizzleSql24`
1452
1452
  SELECT DISTINCT
1453
1453
  ON (et.exercise_id) et.id,
1454
1454
  et.exercise_to_split_id,
@@ -1507,7 +1507,7 @@ var aerobicsDailyRecordQueryDtoSchema = z2.object({
1507
1507
  durationMins: aerobicTrackingDbSchema.shape.durationSec
1508
1508
  });
1509
1509
  var aerobicsWeeklyRecordQueryDtoSchema = aerobicsDailyRecordQueryDtoSchema.extend({
1510
- workoutTimeUtc: serializedDateSchema
1510
+ workoutTimeLocal: serializedDateSchema
1511
1511
  });
1512
1512
  var weeklyDataQueryDtoSchema = z2.object({
1513
1513
  records: z2.array(aerobicsWeeklyRecordQueryDtoSchema),
@@ -1804,15 +1804,32 @@ var userByUsernameRowQueryDtoSchema = z13.object({
1804
1804
  userData: userByUsernameRawQueryDtoSchema.nullable()
1805
1805
  });
1806
1806
 
1807
- // src/modules/bootstrap/bootstrap.contracts.ts
1808
- import { z as z19 } from "zod/v4";
1807
+ // src/modules/exercises/exercises.dtos.ts
1808
+ import { z as z14 } from "zod/v4";
1809
+ var getAllExercisesExerciseQueryDtoSchema = z14.object({
1810
+ id: exerciseDbSchema.shape.id,
1811
+ name: exerciseDbSchema.shape.name,
1812
+ specificTargetMuscle: exerciseDbSchema.shape.specificTargetMuscle
1813
+ });
1814
+ var exercisesMapByMuscleQueryDtoSchema = z14.record(z14.string(), z14.array(getAllExercisesExerciseQueryDtoSchema));
1815
+ var exerciseMapByMuscleRowQueryDtoSchema = z14.object({
1816
+ result: z14.object({
1817
+ map: exercisesMapByMuscleQueryDtoSchema.nullable()
1818
+ }).nullable()
1819
+ });
1820
+
1821
+ // src/modules/exercises/exercises.contracts.ts
1822
+ var getAllExercisesResponseSchema = exercisesMapByMuscleQueryDtoSchema;
1823
+ var getAllExercisesContract = {
1824
+ response: getAllExercisesResponseSchema
1825
+ };
1809
1826
 
1810
1827
  // src/modules/messages/messages.contracts.ts
1811
- import { z as z15 } from "zod/v4";
1828
+ import { z as z16 } from "zod/v4";
1812
1829
 
1813
1830
  // src/modules/messages/messages.dtos.ts
1814
- import { z as z14 } from "zod/v4";
1815
- var allUserMessageQueryDtoSchema = z14.object({
1831
+ import { z as z15 } from "zod/v4";
1832
+ var allUserMessageQueryDtoSchema = z15.object({
1816
1833
  id: messageDbSchema.shape.id,
1817
1834
  subject: messageDbSchema.shape.subject,
1818
1835
  msg: messageDbSchema.shape.msg,
@@ -1821,14 +1838,14 @@ var allUserMessageQueryDtoSchema = z14.object({
1821
1838
  senderFullName: userDbSchema.shape.name,
1822
1839
  senderProfilePicPath: userDbSchema.shape.profilePicPath
1823
1840
  });
1824
- var messageAsReadQueryDtoSchema = z14.object({
1841
+ var messageAsReadQueryDtoSchema = z15.object({
1825
1842
  id: messageDbSchema.shape.id,
1826
1843
  isRead: messageDbSchema.shape.isRead
1827
1844
  });
1828
- var deletedMessageQueryDtoSchema = z14.object({
1845
+ var deletedMessageQueryDtoSchema = z15.object({
1829
1846
  id: messageDbSchema.shape.id
1830
1847
  });
1831
- var messageAfterSendQueryDtoSchema = z14.object({
1848
+ var messageAfterSendQueryDtoSchema = z15.object({
1832
1849
  id: messageDbSchema.shape.id,
1833
1850
  senderId: messageDbSchema.shape.senderId,
1834
1851
  receiverId: messageDbSchema.shape.receiverId,
@@ -1843,20 +1860,20 @@ var messageAfterSendQueryDtoSchema = z14.object({
1843
1860
  });
1844
1861
 
1845
1862
  // src/modules/messages/messages.contracts.ts
1846
- var getAllMessagesRequestSchema = z15.object({
1847
- query: z15.object({
1848
- tz: z15.string()
1863
+ var getAllMessagesRequestSchema = z16.object({
1864
+ query: z16.object({
1865
+ tz: z16.string()
1849
1866
  })
1850
1867
  });
1851
- var getAllUserMessagesResponseSchema = z15.object({
1852
- messages: z15.array(allUserMessageQueryDtoSchema)
1868
+ var getAllUserMessagesResponseSchema = z16.object({
1869
+ messages: z16.array(allUserMessageQueryDtoSchema)
1853
1870
  });
1854
1871
  var getAllUserMessagesContract = {
1855
1872
  request: getAllMessagesRequestSchema,
1856
1873
  response: getAllUserMessagesResponseSchema
1857
1874
  };
1858
- var markMessageAsReadRequestSchema = z15.object({
1859
- params: z15.object({
1875
+ var markMessageAsReadRequestSchema = z16.object({
1876
+ params: z16.object({
1860
1877
  id: messageDbSchema.shape.id
1861
1878
  })
1862
1879
  });
@@ -1865,8 +1882,8 @@ var markMessageAsReadContract = {
1865
1882
  request: markMessageAsReadRequestSchema,
1866
1883
  response: markMessageAsReadResponseSchema
1867
1884
  };
1868
- var deleteMessageRequestSchema = z15.object({
1869
- params: z15.object({
1885
+ var deleteMessageRequestSchema = z16.object({
1886
+ params: z16.object({
1870
1887
  id: messageDbSchema.shape.id
1871
1888
  })
1872
1889
  });
@@ -1876,285 +1893,18 @@ var deleteMessageContract = {
1876
1893
  response: deleteMessageResponseSchema
1877
1894
  };
1878
1895
 
1879
- // src/modules/workout/plan/plan.contracts.ts
1896
+ // src/modules/oauth/apple/apple.contracts.ts
1880
1897
  import { z as z17 } from "zod/v4";
1881
-
1882
- // src/modules/workout/plan/plan.dtos.ts
1883
- import { z as z16 } from "zod/v4";
1884
- var workoutExerciseInputQueryDtoSchema = z16.object({
1885
- exerciseId: exerciseDbSchema.shape.id,
1886
- sets: z16.array(workoutSetDbSchema.shape.reps),
1887
- orderIndex: exerciseToWorkoutSplitDbSchema.shape.orderIndex
1888
- });
1889
- var workoutSplitInputBaseQueryDtoSchema = z16.object({
1890
- name: workoutSplitDbSchema.shape.name.min(1, "Split name is required"),
1891
- orderIndex: z16.number().int().nonnegative(),
1892
- exercises: z16.array(workoutExerciseInputQueryDtoSchema).min(1, "Each split must include at least one exercise")
1893
- });
1894
- var saveWorkoutSplitInputQueryDtoSchema = workoutSplitInputBaseQueryDtoSchema.extend({
1895
- id: workoutSplitDbSchema.shape.id.optional()
1896
- });
1897
- var saveWorkoutSplitPayloadQueryDtoSchema = z16.array(saveWorkoutSplitInputQueryDtoSchema).min(1, "Workout must include at least one split");
1898
- var exerciseInPlanQueryDtoSchema = z16.object({
1899
- exerciseToSplitId: exerciseToWorkoutSplitDbSchema.shape.id,
1900
- exerciseId: exerciseDbSchema.shape.id,
1901
- name: exerciseDbSchema.shape.name,
1902
- sets: z16.array(z16.object({
1903
- orderIndex: workoutSetDbSchema.shape.orderIndex,
1904
- reps: workoutSetDbSchema.shape.reps
1905
- })),
1906
- orderIndex: exerciseToWorkoutSplitDbSchema.shape.orderIndex,
1907
- isActive: exerciseToWorkoutSplitDbSchema.shape.isActive,
1908
- targetMuscle: exerciseDbSchema.shape.targetMuscle,
1909
- specificTargetMuscle: exerciseDbSchema.shape.specificTargetMuscle
1910
- });
1911
- var workoutSplitQueryDtoSchema = z16.object({
1912
- id: workoutSplitDbSchema.shape.id,
1913
- workoutId: workoutSplitDbSchema.shape.workoutId,
1914
- name: workoutSplitDbSchema.shape.name,
1915
- orderIndex: workoutSplitDbSchema.shape.orderIndex,
1916
- createdAt: serializedDateSchema,
1917
- muscleGroup: z16.string().nullable(),
1918
- isActive: workoutSplitDbSchema.shape.isActive,
1919
- exercises: z16.array(exerciseInPlanQueryDtoSchema)
1920
- });
1921
- var wholeUserWorkoutPlanQueryDtoSchema = z16.object({
1922
- id: workoutPlanDbSchema.shape.id,
1923
- numberOfSplits: z16.number(),
1924
- createdAt: serializedDateSchema,
1925
- userId: userDbSchema.shape.id,
1926
- isActive: workoutPlanDbSchema.shape.isActive,
1927
- updatedAt: serializedDateSchema,
1928
- workoutSplits: z16.array(workoutSplitQueryDtoSchema).nullable()
1929
- });
1930
- var workoutPlanIdQueryDtoSchema = z16.object({
1931
- id: workoutPlanDbSchema.shape.id
1932
- });
1933
- var workoutSplitIdQueryDtoSchema = z16.object({
1934
- id: workoutSplitDbSchema.shape.id
1935
- });
1936
- var exerciseAssignmentIdQueryDtoSchema = z16.object({
1937
- id: exerciseToWorkoutSplitDbSchema.shape.id
1938
- });
1939
-
1940
- // src/modules/workout/plan/plan.contracts.ts
1941
- var getWholeWorkoutPlanRequestSchema = z17.object({
1942
- query: z17.object({
1943
- tz: z17.string().optional()
1944
- })
1898
+ var appleNameInputSchema = z17.object({
1899
+ givenName: z17.string().nullable(),
1900
+ familyName: z17.string().nullable()
1945
1901
  });
1946
- var getWholeUserWorkoutPlanResponseSchema = z17.object({
1947
- workoutPlan: wholeUserWorkoutPlanQueryDtoSchema.nullable()
1948
- });
1949
- var getWholeUserWorkoutPlanContract = {
1950
- request: getWholeWorkoutPlanRequestSchema,
1951
- response: getWholeUserWorkoutPlanResponseSchema
1952
- };
1953
- var workoutMutationResponseSchema = z17.object({
1954
- message: z17.string(),
1955
- workoutPlan: wholeUserWorkoutPlanQueryDtoSchema
1956
- });
1957
- var addWorkoutRequestSchema = z17.object({
1902
+ var appleOAuthRequestSchema = z17.object({
1958
1903
  body: z17.object({
1959
- workoutData: saveWorkoutSplitPayloadQueryDtoSchema,
1960
- workoutName: z17.string().optional(),
1961
- tz: z17.string()
1962
- })
1963
- });
1964
- var addWorkoutResponseSchema = workoutMutationResponseSchema;
1965
- var addWorkoutContract = {
1966
- request: addWorkoutRequestSchema,
1967
- response: addWorkoutResponseSchema
1968
- };
1969
-
1970
- // src/modules/workout/tracking/tracking.dtos.ts
1971
- import { z as z18 } from "zod/v4";
1972
- var trackedSetQueryDtoSchema = z18.object({
1973
- reps: trackingSetDbSchema.shape.reps,
1974
- weight: trackingSetDbSchema.shape.weight,
1975
- setIndex: trackingSetDbSchema.shape.setIndex
1976
- });
1977
- var finishedWorkoutEntryBaseQueryDtoSchema = z18.object({
1978
- trackedSets: z18.array(trackedSetQueryDtoSchema),
1979
- notes: exerciseTrackingDbSchema.shape.notes.optional()
1980
- });
1981
- var finishedWorkoutEntryQueryDtoSchema = finishedWorkoutEntryBaseQueryDtoSchema.extend({
1982
- isExerciseAssignedToSplit: z18.boolean(),
1983
- exerciseToSplitId: exerciseTrackingDbSchema.shape.exerciseToSplitId,
1984
- exerciseId: exerciseTrackingDbSchema.shape.exerciseId
1985
- });
1986
- var exerciseMetadataQueryDtoSchema = z18.object({
1987
- targetMuscle: exerciseDbSchema.shape.targetMuscle,
1988
- specificTargetMuscle: exerciseDbSchema.shape.specificTargetMuscle
1989
- });
1990
- var exerciseTrackingPrMaxQueryDtoSchema = z18.object({
1991
- exercise: exerciseDbSchema.shape.name,
1992
- weight: trackingSetDbSchema.shape.weight,
1993
- reps: trackingSetDbSchema.shape.reps,
1994
- workoutTimeUtc: serializedDateSchema
1995
- });
1996
- var exerciseTrackingAnalysisQueryDtoSchema = z18.object({
1997
- uniqueDays: z18.number(),
1998
- mostFrequentSplit: z18.string().nullable(),
1999
- mostFrequentSplitDays: z18.number().nullable(),
2000
- lastWorkoutDate: z18.string().nullable(),
2001
- splitDaysByName: z18.record(z18.string(), z18.number()),
2002
- prs: z18.object({
2003
- prMax: exerciseTrackingPrMaxQueryDtoSchema.nullable()
2004
- })
2005
- });
2006
- var trackingMapItemQueryDtoSchema = z18.object({
2007
- id: exerciseTrackingDbSchema.shape.id,
2008
- exerciseToSplitId: exerciseToWorkoutSplitDbSchema.shape.id,
2009
- weight: z18.array(trackingSetDbSchema.shape.weight),
2010
- reps: z18.array(trackingSetDbSchema.shape.reps),
2011
- notes: exerciseTrackingDbSchema.shape.notes,
2012
- exerciseId: exerciseDbSchema.shape.id,
2013
- workoutSplitId: workoutSplitDbSchema.shape.id,
2014
- splitName: workoutSplitDbSchema.shape.name,
2015
- exercise: exerciseDbSchema.shape.name,
2016
- workoutDate: serializedDateSchema,
2017
- orderIndex: exerciseToWorkoutSplitDbSchema.shape.orderIndex,
2018
- exerciseToWorkoutSplit: z18.object({
2019
- sets: z18.array(workoutSetDbSchema.shape.reps),
2020
- exercises: exerciseMetadataQueryDtoSchema
2021
- })
2022
- });
2023
- var trackingByDateItemQueryDtoSchema = trackingMapItemQueryDtoSchema.omit({
2024
- workoutDate: true
2025
- });
2026
- var trackingBySplitNameItemQueryDtoSchema = trackingMapItemQueryDtoSchema.omit({
2027
- splitName: true
2028
- });
2029
- var groupedTrackingItemQueryDtoSchema = z18.object({
2030
- exerciseTracking: z18.object({
2031
- exerciseTrackingId: exerciseTrackingDbSchema.shape.id,
2032
- sets: z18.array(z18.object({
2033
- setIndex: trackingSetDbSchema.shape.setIndex,
2034
- weight: trackingSetDbSchema.shape.weight,
2035
- reps: trackingSetDbSchema.shape.reps
2036
- })),
2037
- notes: exerciseTrackingDbSchema.shape.notes,
2038
- exerciseAssignment: z18.object({
2039
- exerciseToSplitId: exerciseTrackingDbSchema.shape.exerciseToSplitId,
2040
- orderIndex: exerciseToWorkoutSplitDbSchema.shape.orderIndex.nullable(),
2041
- exerciseId: exerciseDbSchema.shape.id,
2042
- workoutSplitId: workoutSplitDbSchema.shape.id,
2043
- workoutSplitName: workoutSplitDbSchema.shape.name,
2044
- exerciseName: exerciseDbSchema.shape.name,
2045
- targetMuscle: exerciseDbSchema.shape.targetMuscle,
2046
- specificTargetMuscle: exerciseDbSchema.shape.specificTargetMuscle
2047
- })
2048
- })
2049
- });
2050
- var exerciseTrackingStatsQueryDtoSchema = z18.object({
2051
- workoutCount: z18.coerce.number(),
2052
- hasExerciseTracking: z18.boolean(),
2053
- nextWorkoutSplit: z18.object({
2054
- id: workoutSplitDbSchema.shape.id,
2055
- name: workoutSplitDbSchema.shape.name,
2056
- orderIndex: workoutSplitDbSchema.shape.orderIndex,
2057
- muscleGroup: z18.string().nullable()
2058
- }).nullable(),
2059
- workoutTargets: z18.object({
2060
- workoutCountThisWeek: z18.coerce.number(),
2061
- workoutCountScheduledPerWeek: z18.coerce.number(),
2062
- weekStreak: z18.coerce.number()
2063
- }),
2064
- lastWorkoutStats: z18.object({
2065
- workoutDate: z18.string().nullable(),
2066
- workoutSplitName: workoutSplitDbSchema.shape.name.nullable(),
2067
- exerciseTrackedCount: z18.coerce.number().nullable(),
2068
- setTrackedCount: z18.coerce.number().nullable()
2069
- }),
2070
- prs: z18.array(z18.object({
2071
- exerciseToSplitId: exerciseTrackingDbSchema.shape.exerciseToSplitId,
2072
- exerciseId: exerciseDbSchema.shape.id,
2073
- exerciseName: exerciseDbSchema.shape.name,
2074
- prWeight: trackingSetDbSchema.shape.weight,
2075
- prReps: trackingSetDbSchema.shape.reps,
2076
- prSetIndex: trackingSetDbSchema.shape.setIndex,
2077
- estimatedOneRepMax: z18.number().nullable()
2078
- }))
2079
- });
2080
- var exerciseTrackingMapsQueryDtoSchema = z18.object({
2081
- byDate: z18.record(z18.string(), z18.array(groupedTrackingItemQueryDtoSchema)),
2082
- byExerciseToSplitId: z18.record(z18.string(), z18.array(groupedTrackingItemQueryDtoSchema)),
2083
- bySplitName: z18.record(z18.string(), z18.array(groupedTrackingItemQueryDtoSchema))
2084
- });
2085
- var exerciseTrackingAndStatsQueryDtoSchema = z18.object({
2086
- trackingStats: exerciseTrackingStatsQueryDtoSchema,
2087
- trackingMaps: exerciseTrackingMapsQueryDtoSchema
2088
- });
2089
- var exerciseTrackingAndStatsRowQueryDtoSchema = z18.object({
2090
- data: exerciseTrackingAndStatsQueryDtoSchema
2091
- });
2092
- var exerciseTrackingStatsRowQueryDtoSchema = z18.object({
2093
- data: exerciseTrackingStatsQueryDtoSchema
2094
- });
2095
- var exerciseTrackingMapsRowQueryDtoSchema = z18.object({
2096
- data: exerciseTrackingMapsQueryDtoSchema
2097
- });
2098
- var workoutSplitLookupQueryDtoSchema = z18.object({
2099
- workoutSplitId: workoutSplitDbSchema.shape.id
2100
- });
2101
- var workoutSummaryIdQueryDtoSchema = z18.object({
2102
- id: z18.string().uuid()
2103
- });
2104
- var exerciseTrackingIdQueryDtoSchema = z18.object({
2105
- id: exerciseTrackingDbSchema.shape.id
2106
- });
2107
-
2108
- // src/modules/bootstrap/bootstrap.contracts.ts
2109
- var bootstrapRequestSchema = z19.object({
2110
- query: z19.object({
2111
- tz: z19.string().optional()
2112
- })
2113
- });
2114
- var bootstrapResponseSchema = z19.object({
2115
- user: userDataQueryDtoSchema,
2116
- workout: getWholeUserWorkoutPlanResponseSchema,
2117
- tracking: exerciseTrackingAndStatsQueryDtoSchema,
2118
- messages: getAllUserMessagesResponseSchema,
2119
- aerobics: userAerobicsResponseSchema
2120
- });
2121
- var bootstrapContract = {
2122
- request: bootstrapRequestSchema,
2123
- response: bootstrapResponseSchema
2124
- };
2125
-
2126
- // src/modules/exercises/exercises.dtos.ts
2127
- import { z as z20 } from "zod/v4";
2128
- var getAllExercisesExerciseQueryDtoSchema = z20.object({
2129
- id: exerciseDbSchema.shape.id,
2130
- name: exerciseDbSchema.shape.name,
2131
- specificTargetMuscle: exerciseDbSchema.shape.specificTargetMuscle
2132
- });
2133
- var exercisesMapByMuscleQueryDtoSchema = z20.record(z20.string(), z20.array(getAllExercisesExerciseQueryDtoSchema));
2134
- var exerciseMapByMuscleRowQueryDtoSchema = z20.object({
2135
- result: z20.object({
2136
- map: exercisesMapByMuscleQueryDtoSchema.nullable()
2137
- }).nullable()
2138
- });
2139
-
2140
- // src/modules/exercises/exercises.contracts.ts
2141
- var getAllExercisesResponseSchema = exercisesMapByMuscleQueryDtoSchema;
2142
- var getAllExercisesContract = {
2143
- response: getAllExercisesResponseSchema
2144
- };
2145
-
2146
- // src/modules/oauth/apple/apple.contracts.ts
2147
- import { z as z21 } from "zod/v4";
2148
- var appleNameInputSchema = z21.object({
2149
- givenName: z21.string().nullable(),
2150
- familyName: z21.string().nullable()
2151
- });
2152
- var appleOAuthRequestSchema = z21.object({
2153
- body: z21.object({
2154
- idToken: z21.string({
1904
+ idToken: z17.string({
2155
1905
  error: "Missing or invalid Apple identityToken"
2156
1906
  }),
2157
- rawNonce: z21.string(),
1907
+ rawNonce: z17.string(),
2158
1908
  name: appleNameInputSchema.optional(),
2159
1909
  email: userDbSchema.shape.email.email().nullable()
2160
1910
  })
@@ -2164,19 +1914,19 @@ var appleOAuthContract = {
2164
1914
  };
2165
1915
 
2166
1916
  // src/modules/oauth/apple/apple.dtos.ts
2167
- import { z as z22 } from "zod/v4";
2168
- var appleTokenVerificationResultDtoSchema = z22.object({
2169
- appleSub: z22.string(),
1917
+ import { z as z18 } from "zod/v4";
1918
+ var appleTokenVerificationResultDtoSchema = z18.object({
1919
+ appleSub: z18.string(),
2170
1920
  email: userDbSchema.shape.email.nullable(),
2171
- emailVerified: z22.boolean(),
1921
+ emailVerified: z18.boolean(),
2172
1922
  fullName: userDbSchema.shape.name
2173
1923
  });
2174
1924
 
2175
1925
  // src/modules/oauth/google/google.contracts.ts
2176
- import { z as z23 } from "zod/v4";
2177
- var googleOAuthRequestSchema = z23.object({
2178
- body: z23.object({
2179
- idToken: z23.string().optional()
1926
+ import { z as z19 } from "zod/v4";
1927
+ var googleOAuthRequestSchema = z19.object({
1928
+ body: z19.object({
1929
+ idToken: z19.string().optional()
2180
1930
  })
2181
1931
  });
2182
1932
  var googleOAuthContract = {
@@ -2184,22 +1934,22 @@ var googleOAuthContract = {
2184
1934
  };
2185
1935
 
2186
1936
  // src/modules/oauth/google/google.dtos.ts
2187
- import { z as z24 } from "zod/v4";
2188
- var googleTokenVerificationResultDtoSchema = z24.object({
2189
- googleSub: z24.string(),
1937
+ import { z as z20 } from "zod/v4";
1938
+ var googleTokenVerificationResultDtoSchema = z20.object({
1939
+ googleSub: z20.string(),
2190
1940
  email: userDbSchema.shape.email.nullable(),
2191
- emailVerified: z24.boolean(),
1941
+ emailVerified: z20.boolean(),
2192
1942
  fullName: userDbSchema.shape.name
2193
1943
  });
2194
1944
 
2195
1945
  // src/modules/oauth/oauth.contracts.ts
2196
- import { z as z25 } from "zod/v4";
2197
- var oAuthLoginResponseSchema = z25.object({
2198
- message: z25.string(),
1946
+ import { z as z21 } from "zod/v4";
1947
+ var oAuthLoginResponseSchema = z21.object({
1948
+ message: z21.string(),
2199
1949
  user: userDbSchema.shape.id,
2200
- accessToken: z25.string(),
2201
- refreshToken: z25.string(),
2202
- missingFields: z25.array(z25.string()).nullable()
1950
+ accessToken: z21.string(),
1951
+ refreshToken: z21.string(),
1952
+ missingFields: z21.array(z21.string()).nullable()
2203
1953
  });
2204
1954
  var proceedLoginResponseSchema = loginResponseSchema;
2205
1955
  var oAuthLoginContract = {
@@ -2207,50 +1957,50 @@ var oAuthLoginContract = {
2207
1957
  };
2208
1958
 
2209
1959
  // src/modules/oauth/oauth.dtos.ts
2210
- import { z as z26 } from "zod/v4";
2211
- var oAuthLookupQueryDtoSchema = z26.object({
1960
+ import { z as z22 } from "zod/v4";
1961
+ var oAuthLookupQueryDtoSchema = z22.object({
2212
1962
  userId: userDbSchema.shape.id.nullable(),
2213
- missingFields: z26.string().nullable()
1963
+ missingFields: z22.string().nullable()
2214
1964
  });
2215
- var oAuthLookupRawQueryDtoSchema = z26.object({
1965
+ var oAuthLookupRawQueryDtoSchema = z22.object({
2216
1966
  user_id: userDbSchema.shape.id,
2217
- missing_fields: z26.string().nullable()
1967
+ missing_fields: z22.string().nullable()
2218
1968
  });
2219
- var oAuthLookupRowQueryDtoSchema = z26.object({
1969
+ var oAuthLookupRowQueryDtoSchema = z22.object({
2220
1970
  oauth_data: oAuthLookupRawQueryDtoSchema.nullable()
2221
1971
  });
2222
- var oAuthLinkQueryDtoSchema = z26.object({
1972
+ var oAuthLinkQueryDtoSchema = z22.object({
2223
1973
  userId: userDbSchema.shape.id.nullable()
2224
1974
  });
2225
- var oAuthLinkRowQueryDtoSchema = z26.object({
1975
+ var oAuthLinkRowQueryDtoSchema = z22.object({
2226
1976
  user_id: userDbSchema.shape.id.nullable()
2227
1977
  });
2228
- var oAuthCreatedUserRowQueryDtoSchema = z26.object({
1978
+ var oAuthCreatedUserRowQueryDtoSchema = z22.object({
2229
1979
  user_id: userDbSchema.shape.id
2230
1980
  });
2231
1981
 
2232
1982
  // src/modules/push/push.dtos.ts
2233
- import { z as z27 } from "zod/v4";
2234
- var userWithNotificationsEnabledQueryDtoSchema = z27.object({
1983
+ import { z as z23 } from "zod/v4";
1984
+ var userWithNotificationsEnabledQueryDtoSchema = z23.object({
2235
1985
  pushToken: userDbSchema.shape.pushToken,
2236
1986
  name: userDbSchema.shape.name
2237
1987
  });
2238
- var userToHourlyReminderQueryDtoSchema = z27.object({
1988
+ var userToHourlyReminderQueryDtoSchema = z23.object({
2239
1989
  userId: userDbSchema.shape.id,
2240
1990
  name: userDbSchema.shape.name,
2241
1991
  pushToken: userDbSchema.shape.pushToken,
2242
- reminderOffsetMinutes: z27.number(),
1992
+ reminderOffsetMinutes: z23.number(),
2243
1993
  splitId: workoutSplitDbSchema.shape.id,
2244
1994
  splitName: workoutSplitDbSchema.shape.name.nullable(),
2245
- estimatedTimeUtc: z27.string()
1995
+ estimatedTimeUtc: z23.string()
2246
1996
  });
2247
1997
 
2248
1998
  // src/modules/user/create/create.contracts.ts
2249
- import { z as z29 } from "zod/v4";
1999
+ import { z as z25 } from "zod/v4";
2250
2000
 
2251
2001
  // src/modules/user/create/create.dtos.ts
2252
- import { z as z28 } from "zod/v4";
2253
- var createdUserQueryDtoSchema = z28.object({
2002
+ import { z as z24 } from "zod/v4";
2003
+ var createdUserQueryDtoSchema = z24.object({
2254
2004
  id: userDbSchema.shape.id,
2255
2005
  username: userDbSchema.shape.username,
2256
2006
  name: userDbSchema.shape.name,
@@ -2264,23 +2014,23 @@ var createdUserRawQueryDtoSchema = createdUserQueryDtoSchema.omit({
2264
2014
  }).extend({
2265
2015
  created_at: serializedDateSchema
2266
2016
  });
2267
- var createdUserRowQueryDtoSchema = z28.object({
2017
+ var createdUserRowQueryDtoSchema = z24.object({
2268
2018
  userData: createdUserRawQueryDtoSchema
2269
2019
  });
2270
- var userExistsQueryDtoSchema = z28.object({
2020
+ var userExistsQueryDtoSchema = z24.object({
2271
2021
  id: userDbSchema.shape.id.nullable()
2272
2022
  });
2273
2023
 
2274
2024
  // src/modules/user/create/create.contracts.ts
2275
2025
  var usernameSchema = userDbSchema.shape.username.trim().min(3, "Username must be at least 3 characters").max(15, "Username must be at most 15 characters").regex(/^[a-zA-Z0-9_]+$/, "Username may contain letters, numbers, and underscore only");
2276
2026
  var fullNameSchema = userDbSchema.shape.name.trim().max(20, "Full name is too long").regex(/^[a-zA-Z\s]+$/, "Full name may contain letters and spaces only");
2277
- var createUserRequestSchema = z29.object({
2278
- body: z29.object({
2027
+ var createUserRequestSchema = z25.object({
2028
+ body: z25.object({
2279
2029
  username: usernameSchema,
2280
- fullName: z29.preprocess((value) => value == null || typeof value === "string" && value.trim() === "" ? "User" : value, fullNameSchema),
2030
+ fullName: z25.preprocess((value) => value == null || typeof value === "string" && value.trim() === "" ? "User" : value, fullNameSchema),
2281
2031
  email: userDbSchema.shape.email.trim().toLowerCase().email("Invalid email format"),
2282
- password: z29.string().min(8, "Password must be at least 8 characters long"),
2283
- gender: z29.preprocess((value) => value === "" || value == null ? "Unknown" : value, z29.enum([
2032
+ password: z25.string().min(8, "Password must be at least 8 characters long"),
2033
+ gender: z25.preprocess((value) => value === "" || value == null ? "Unknown" : value, z25.enum([
2284
2034
  "Male",
2285
2035
  "Female",
2286
2036
  "Other",
@@ -2289,8 +2039,8 @@ var createUserRequestSchema = z29.object({
2289
2039
  })
2290
2040
  });
2291
2041
  var createUserUserSchema = createdUserQueryDtoSchema;
2292
- var createUserResponseSchema = z29.object({
2293
- message: z29.string(),
2042
+ var createUserResponseSchema = z25.object({
2043
+ message: z25.string(),
2294
2044
  user: createdUserQueryDtoSchema
2295
2045
  });
2296
2046
  var createUserContract = {
@@ -2299,9 +2049,9 @@ var createUserContract = {
2299
2049
  };
2300
2050
 
2301
2051
  // src/modules/user/push-tokens/push-tokens.contracts.ts
2302
- import { z as z30 } from "zod/v4";
2303
- var saveUserPushTokenRequestSchema = z30.object({
2304
- body: z30.object({
2052
+ import { z as z26 } from "zod/v4";
2053
+ var saveUserPushTokenRequestSchema = z26.object({
2054
+ body: z26.object({
2305
2055
  token: userDbSchema.shape.pushToken.unwrap()
2306
2056
  })
2307
2057
  });
@@ -2310,20 +2060,20 @@ var saveUserPushTokenContract = {
2310
2060
  };
2311
2061
 
2312
2062
  // src/modules/user/update/update.contracts.ts
2313
- import { z as z31 } from "zod/v4";
2314
- var updateUserRequestSchema = z31.object({
2063
+ import { z as z27 } from "zod/v4";
2064
+ var updateUserRequestSchema = z27.object({
2315
2065
  body: authenticatedUserForUpdateQueryDtoSchema
2316
2066
  });
2317
- var updateAuthenticatedUserResponseSchema = z31.object({
2318
- message: z31.string(),
2319
- emailChanged: z31.boolean(),
2067
+ var updateAuthenticatedUserResponseSchema = z27.object({
2068
+ message: z27.string(),
2069
+ emailChanged: z27.boolean(),
2320
2070
  user: userDataQueryDtoSchema
2321
2071
  });
2322
2072
  var updateAuthenticatedUserContract = {
2323
2073
  request: updateUserRequestSchema,
2324
2074
  response: updateAuthenticatedUserResponseSchema
2325
2075
  };
2326
- var userDataResponseSchema = z31.object({
2076
+ var userDataResponseSchema = z27.object({
2327
2077
  userData: userDataQueryDtoSchema
2328
2078
  });
2329
2079
  var userDataContract = {
@@ -2333,36 +2083,36 @@ var getAuthenticatedUserByIdResponseSchema = userDataQueryDtoSchema;
2333
2083
  var getAuthenticatedUserByIdContract = {
2334
2084
  response: getAuthenticatedUserByIdResponseSchema
2335
2085
  };
2336
- var deleteProfilePicRequestSchema = z31.object({
2337
- body: z31.object({
2338
- profilePicPath: z31.string()
2086
+ var deleteProfilePicRequestSchema = z27.object({
2087
+ body: z27.object({
2088
+ profilePicPath: z27.string()
2339
2089
  })
2340
2090
  });
2341
2091
  var deleteUserProfilePicContract = {
2342
2092
  request: deleteProfilePicRequestSchema
2343
2093
  };
2344
- var setProfilePicAndUpdateDBResponseSchema = z31.object({
2345
- profilePicPath: z31.string(),
2346
- url: z31.string(),
2347
- message: z31.string()
2094
+ var setProfilePicAndUpdateDBResponseSchema = z27.object({
2095
+ profilePicPath: z27.string(),
2096
+ url: z27.string(),
2097
+ message: z27.string()
2348
2098
  });
2349
2099
  var setProfilePicAndUpdateDBContract = {
2350
2100
  response: setProfilePicAndUpdateDBResponseSchema
2351
2101
  };
2352
2102
 
2353
2103
  // src/modules/video-analysis/video-analysis.contracts.ts
2354
- import { z as z32 } from "zod/v4";
2355
- var getPresignedUrlFromS3RequestSchema = z32.object({
2356
- body: z32.object({
2104
+ import { z as z28 } from "zod/v4";
2105
+ var getPresignedUrlFromS3RequestSchema = z28.object({
2106
+ body: z28.object({
2357
2107
  exercise: exerciseDbSchema.shape.name,
2358
- fileType: z32.string(),
2359
- jobId: z32.string()
2108
+ fileType: z28.string(),
2109
+ jobId: z28.string()
2360
2110
  })
2361
2111
  });
2362
- var getPresignedUrlFromS3ResponseSchema = z32.object({
2363
- uploadUrl: z32.string(),
2364
- fileKey: z32.string(),
2365
- requestId: z32.string()
2112
+ var getPresignedUrlFromS3ResponseSchema = z28.object({
2113
+ uploadUrl: z28.string(),
2114
+ fileKey: z28.string(),
2115
+ requestId: z28.string()
2366
2116
  });
2367
2117
  var getPresignedUrlFromS3Contract = {
2368
2118
  request: getPresignedUrlFromS3RequestSchema,
@@ -2370,75 +2120,308 @@ var getPresignedUrlFromS3Contract = {
2370
2120
  };
2371
2121
 
2372
2122
  // src/modules/video-analysis/video-analysis.dtos.ts
2373
- import { z as z33 } from "zod/v4";
2374
- var enqueueAnalyzeVideoParamsDtoSchema = z33.object({
2375
- fileKey: z33.string(),
2376
- exercise: z33.string(),
2123
+ import { z as z29 } from "zod/v4";
2124
+ var enqueueAnalyzeVideoParamsDtoSchema = z29.object({
2125
+ fileKey: z29.string(),
2126
+ exercise: z29.string(),
2377
2127
  userId: userDbSchema.shape.id,
2378
- requestId: z33.string(),
2379
- sentryTrace: z33.string().optional(),
2380
- baggage: z33.string().optional()
2128
+ requestId: z29.string(),
2129
+ sentryTrace: z29.string().optional(),
2130
+ baggage: z29.string().optional()
2381
2131
  });
2382
2132
  var analyzeVideoPayloadDtoSchema = enqueueAnalyzeVideoParamsDtoSchema.extend({
2383
- expiresAt: z33.number()
2133
+ expiresAt: z29.number()
2384
2134
  });
2385
- var squatRepetitionDtoSchema = z33.object({
2386
- depth: z33.object({
2387
- value: z33.number(),
2388
- status: z33.string(),
2389
- confidence: z33.number()
2135
+ var squatRepetitionDtoSchema = z29.object({
2136
+ depth: z29.object({
2137
+ value: z29.number(),
2138
+ status: z29.string(),
2139
+ confidence: z29.number()
2390
2140
  }),
2391
- backLean: z33.object({
2392
- value: z33.number(),
2393
- excessive: z33.boolean(),
2394
- confidence: z33.number()
2141
+ backLean: z29.object({
2142
+ value: z29.number(),
2143
+ excessive: z29.boolean(),
2144
+ confidence: z29.number()
2395
2145
  }),
2396
- audit: z33.object({
2397
- framesAnalyzed: z33.number(),
2398
- validFrames: z33.number(),
2399
- cameraAngle: z33.string(),
2400
- rawBottomAngle: z33.number(),
2401
- samplingRate: z33.string()
2146
+ audit: z29.object({
2147
+ framesAnalyzed: z29.number(),
2148
+ validFrames: z29.number(),
2149
+ cameraAngle: z29.string(),
2150
+ rawBottomAngle: z29.number(),
2151
+ samplingRate: z29.string()
2402
2152
  })
2403
2153
  });
2404
- var analyzeVideoResultPayloadDtoSchema = /* @__PURE__ */ __name((resultSchema) => z33.intersection(z33.object({
2405
- jobId: z33.string(),
2154
+ var analyzeVideoResultPayloadDtoSchema = /* @__PURE__ */ __name((resultSchema) => z29.intersection(z29.object({
2155
+ jobId: z29.string(),
2406
2156
  userId: userDbSchema.shape.id,
2407
- exercise: z33.string(),
2408
- requestId: z33.string().optional()
2409
- }), z33.discriminatedUnion("status", [
2410
- z33.object({
2411
- status: z33.literal("completed"),
2412
- result: z33.array(resultSchema),
2413
- error: z33.null()
2157
+ exercise: z29.string(),
2158
+ requestId: z29.string().optional()
2159
+ }), z29.discriminatedUnion("status", [
2160
+ z29.object({
2161
+ status: z29.literal("completed"),
2162
+ result: z29.array(resultSchema),
2163
+ error: z29.null()
2414
2164
  }),
2415
- z33.object({
2416
- status: z33.literal("failed"),
2417
- result: z33.null(),
2418
- error: z33.string()
2165
+ z29.object({
2166
+ status: z29.literal("failed"),
2167
+ result: z29.null(),
2168
+ error: z29.string()
2419
2169
  })
2420
2170
  ])), "analyzeVideoResultPayloadDtoSchema");
2421
2171
 
2422
2172
  // src/modules/web-sockets/web-sockets.contracts.ts
2423
- import { z as z34 } from "zod/v4";
2424
- var generateTicketRequestSchema = z34.object({
2425
- body: z34.object({
2173
+ import { z as z30 } from "zod/v4";
2174
+ var generateTicketRequestSchema = z30.object({
2175
+ body: z30.object({
2426
2176
  username: userDbSchema.shape.username
2427
2177
  })
2428
2178
  });
2429
- var generateTicketResponseSchema = z34.object({
2430
- ticket: z34.string()
2179
+ var generateTicketResponseSchema = z30.object({
2180
+ ticket: z30.string()
2431
2181
  });
2432
2182
  var generateTicketContract = {
2433
2183
  request: generateTicketRequestSchema,
2434
2184
  response: generateTicketResponseSchema
2435
2185
  };
2436
2186
 
2187
+ // src/modules/workout/plan/plan.contracts.ts
2188
+ import { z as z32 } from "zod/v4";
2189
+
2190
+ // src/modules/workout/plan/plan.dtos.ts
2191
+ import { z as z31 } from "zod/v4";
2192
+ var workoutExerciseInputQueryDtoSchema = z31.object({
2193
+ exerciseId: exerciseDbSchema.shape.id,
2194
+ sets: z31.array(workoutSetDbSchema.shape.reps),
2195
+ orderIndex: exerciseToWorkoutSplitDbSchema.shape.orderIndex
2196
+ });
2197
+ var workoutSplitInputBaseQueryDtoSchema = z31.object({
2198
+ name: workoutSplitDbSchema.shape.name.min(1, "Split name is required"),
2199
+ orderIndex: z31.number().int().nonnegative(),
2200
+ exercises: z31.array(workoutExerciseInputQueryDtoSchema).min(1, "Each split must include at least one exercise")
2201
+ });
2202
+ var saveWorkoutSplitInputQueryDtoSchema = workoutSplitInputBaseQueryDtoSchema.extend({
2203
+ id: workoutSplitDbSchema.shape.id.optional()
2204
+ });
2205
+ var saveWorkoutSplitPayloadQueryDtoSchema = z31.array(saveWorkoutSplitInputQueryDtoSchema).min(1, "Workout must include at least one split");
2206
+ var exerciseInPlanQueryDtoSchema = z31.object({
2207
+ exerciseToSplitId: exerciseToWorkoutSplitDbSchema.shape.id,
2208
+ exerciseId: exerciseDbSchema.shape.id,
2209
+ name: exerciseDbSchema.shape.name,
2210
+ sets: z31.array(z31.object({
2211
+ orderIndex: workoutSetDbSchema.shape.orderIndex,
2212
+ reps: workoutSetDbSchema.shape.reps
2213
+ })),
2214
+ orderIndex: exerciseToWorkoutSplitDbSchema.shape.orderIndex,
2215
+ isActive: exerciseToWorkoutSplitDbSchema.shape.isActive,
2216
+ targetMuscle: exerciseDbSchema.shape.targetMuscle,
2217
+ specificTargetMuscle: exerciseDbSchema.shape.specificTargetMuscle
2218
+ });
2219
+ var workoutSplitQueryDtoSchema = z31.object({
2220
+ id: workoutSplitDbSchema.shape.id,
2221
+ workoutId: workoutSplitDbSchema.shape.workoutId,
2222
+ name: workoutSplitDbSchema.shape.name,
2223
+ orderIndex: workoutSplitDbSchema.shape.orderIndex,
2224
+ createdAt: serializedDateSchema,
2225
+ muscleGroup: z31.string().nullable(),
2226
+ estimatedDurationMinutes: z31.number().nullable(),
2227
+ isActive: workoutSplitDbSchema.shape.isActive,
2228
+ exercises: z31.array(exerciseInPlanQueryDtoSchema)
2229
+ });
2230
+ var wholeUserWorkoutPlanQueryDtoSchema = z31.object({
2231
+ id: workoutPlanDbSchema.shape.id,
2232
+ numberOfSplits: z31.number(),
2233
+ createdAt: serializedDateSchema,
2234
+ userId: userDbSchema.shape.id,
2235
+ isActive: workoutPlanDbSchema.shape.isActive,
2236
+ updatedAt: serializedDateSchema,
2237
+ workoutSplits: z31.array(workoutSplitQueryDtoSchema).nullable()
2238
+ });
2239
+ var workoutPlanIdQueryDtoSchema = z31.object({
2240
+ id: workoutPlanDbSchema.shape.id
2241
+ });
2242
+ var workoutSplitIdQueryDtoSchema = z31.object({
2243
+ id: workoutSplitDbSchema.shape.id
2244
+ });
2245
+ var exerciseAssignmentIdQueryDtoSchema = z31.object({
2246
+ id: exerciseToWorkoutSplitDbSchema.shape.id
2247
+ });
2248
+
2249
+ // src/modules/workout/plan/plan.contracts.ts
2250
+ var getWholeWorkoutPlanRequestSchema = z32.object({
2251
+ query: z32.object({
2252
+ tz: z32.string().optional()
2253
+ })
2254
+ });
2255
+ var getWholeUserWorkoutPlanResponseSchema = z32.object({
2256
+ workoutPlan: wholeUserWorkoutPlanQueryDtoSchema.nullable()
2257
+ });
2258
+ var getWholeUserWorkoutPlanContract = {
2259
+ request: getWholeWorkoutPlanRequestSchema,
2260
+ response: getWholeUserWorkoutPlanResponseSchema
2261
+ };
2262
+ var workoutMutationResponseSchema = z32.object({
2263
+ message: z32.string(),
2264
+ workoutPlan: wholeUserWorkoutPlanQueryDtoSchema
2265
+ });
2266
+ var addWorkoutRequestSchema = z32.object({
2267
+ body: z32.object({
2268
+ workoutData: saveWorkoutSplitPayloadQueryDtoSchema,
2269
+ workoutName: z32.string().optional(),
2270
+ tz: z32.string()
2271
+ })
2272
+ });
2273
+ var addWorkoutResponseSchema = workoutMutationResponseSchema;
2274
+ var addWorkoutContract = {
2275
+ request: addWorkoutRequestSchema,
2276
+ response: addWorkoutResponseSchema
2277
+ };
2278
+
2437
2279
  // src/modules/workout/tracking/tracking.contracts.ts
2438
- import { z as z35 } from "zod/v4";
2439
- var getExerciseTrackingRequestSchema = z35.object({
2440
- query: z35.object({
2441
- tz: z35.string().optional()
2280
+ import { z as z34 } from "zod/v4";
2281
+
2282
+ // src/modules/workout/tracking/tracking.dtos.ts
2283
+ import { z as z33 } from "zod/v4";
2284
+ var trackedSetQueryDtoSchema = z33.object({
2285
+ reps: trackingSetDbSchema.shape.reps,
2286
+ weight: trackingSetDbSchema.shape.weight,
2287
+ setIndex: trackingSetDbSchema.shape.setIndex
2288
+ });
2289
+ var finishedWorkoutEntryBaseQueryDtoSchema = z33.object({
2290
+ trackedSets: z33.array(trackedSetQueryDtoSchema),
2291
+ notes: exerciseTrackingDbSchema.shape.notes.optional()
2292
+ });
2293
+ var finishedWorkoutEntryQueryDtoSchema = finishedWorkoutEntryBaseQueryDtoSchema.extend({
2294
+ isExerciseAssignedToSplit: z33.boolean(),
2295
+ exerciseToSplitId: exerciseTrackingDbSchema.shape.exerciseToSplitId,
2296
+ exerciseId: exerciseTrackingDbSchema.shape.exerciseId
2297
+ });
2298
+ var exerciseMetadataQueryDtoSchema = z33.object({
2299
+ targetMuscle: exerciseDbSchema.shape.targetMuscle,
2300
+ specificTargetMuscle: exerciseDbSchema.shape.specificTargetMuscle
2301
+ });
2302
+ var exerciseTrackingPrMaxQueryDtoSchema = z33.object({
2303
+ exercise: exerciseDbSchema.shape.name,
2304
+ weight: trackingSetDbSchema.shape.weight,
2305
+ reps: trackingSetDbSchema.shape.reps,
2306
+ workoutTimeUtc: serializedDateSchema
2307
+ });
2308
+ var exerciseTrackingAnalysisQueryDtoSchema = z33.object({
2309
+ uniqueDays: z33.number(),
2310
+ mostFrequentSplit: z33.string().nullable(),
2311
+ mostFrequentSplitDays: z33.number().nullable(),
2312
+ lastWorkoutDate: z33.string().nullable(),
2313
+ splitDaysByName: z33.record(z33.string(), z33.number()),
2314
+ prs: z33.object({
2315
+ prMax: exerciseTrackingPrMaxQueryDtoSchema.nullable()
2316
+ })
2317
+ });
2318
+ var trackingMapItemQueryDtoSchema = z33.object({
2319
+ id: exerciseTrackingDbSchema.shape.id,
2320
+ exerciseToSplitId: exerciseToWorkoutSplitDbSchema.shape.id,
2321
+ weight: z33.array(trackingSetDbSchema.shape.weight),
2322
+ reps: z33.array(trackingSetDbSchema.shape.reps),
2323
+ notes: exerciseTrackingDbSchema.shape.notes,
2324
+ exerciseId: exerciseDbSchema.shape.id,
2325
+ workoutSplitId: workoutSplitDbSchema.shape.id,
2326
+ splitName: workoutSplitDbSchema.shape.name,
2327
+ exercise: exerciseDbSchema.shape.name,
2328
+ workoutDate: serializedDateSchema,
2329
+ orderIndex: exerciseToWorkoutSplitDbSchema.shape.orderIndex,
2330
+ exerciseToWorkoutSplit: z33.object({
2331
+ sets: z33.array(workoutSetDbSchema.shape.reps),
2332
+ exercises: exerciseMetadataQueryDtoSchema
2333
+ })
2334
+ });
2335
+ var trackingByDateItemQueryDtoSchema = trackingMapItemQueryDtoSchema.omit({
2336
+ workoutDate: true
2337
+ });
2338
+ var trackingBySplitNameItemQueryDtoSchema = trackingMapItemQueryDtoSchema.omit({
2339
+ splitName: true
2340
+ });
2341
+ var groupedTrackingItemQueryDtoSchema = z33.object({
2342
+ exerciseTracking: z33.object({
2343
+ exerciseTrackingId: exerciseTrackingDbSchema.shape.id,
2344
+ sets: z33.array(z33.object({
2345
+ setIndex: trackingSetDbSchema.shape.setIndex,
2346
+ weight: trackingSetDbSchema.shape.weight,
2347
+ reps: trackingSetDbSchema.shape.reps
2348
+ })),
2349
+ notes: exerciseTrackingDbSchema.shape.notes,
2350
+ exerciseAssignment: z33.object({
2351
+ exerciseToSplitId: exerciseTrackingDbSchema.shape.exerciseToSplitId,
2352
+ orderIndex: exerciseToWorkoutSplitDbSchema.shape.orderIndex.nullable(),
2353
+ exerciseId: exerciseDbSchema.shape.id,
2354
+ workoutSplitId: workoutSplitDbSchema.shape.id,
2355
+ workoutSplitName: workoutSplitDbSchema.shape.name,
2356
+ exerciseName: exerciseDbSchema.shape.name,
2357
+ targetMuscle: exerciseDbSchema.shape.targetMuscle,
2358
+ specificTargetMuscle: exerciseDbSchema.shape.specificTargetMuscle
2359
+ })
2360
+ })
2361
+ });
2362
+ var exerciseTrackingStatsQueryDtoSchema = z33.object({
2363
+ workoutCount: z33.coerce.number(),
2364
+ hasExerciseTracking: z33.boolean(),
2365
+ nextWorkoutSplit: z33.object({
2366
+ id: workoutSplitDbSchema.shape.id,
2367
+ name: workoutSplitDbSchema.shape.name,
2368
+ orderIndex: workoutSplitDbSchema.shape.orderIndex,
2369
+ muscleGroup: z33.string().nullable()
2370
+ }).nullable(),
2371
+ workoutTargets: z33.object({
2372
+ workoutCountThisWeek: z33.coerce.number(),
2373
+ workoutCountScheduledPerWeek: z33.coerce.number(),
2374
+ weekStreak: z33.coerce.number()
2375
+ }),
2376
+ lastWorkoutStats: z33.object({
2377
+ workoutDate: z33.string().nullable(),
2378
+ workoutSplitName: workoutSplitDbSchema.shape.name.nullable(),
2379
+ exerciseTrackedCount: z33.coerce.number().nullable(),
2380
+ setTrackedCount: z33.coerce.number().nullable()
2381
+ }),
2382
+ prs: z33.array(z33.object({
2383
+ exerciseToSplitId: exerciseTrackingDbSchema.shape.exerciseToSplitId,
2384
+ exerciseId: exerciseDbSchema.shape.id,
2385
+ exerciseName: exerciseDbSchema.shape.name,
2386
+ prWeight: trackingSetDbSchema.shape.weight,
2387
+ prReps: trackingSetDbSchema.shape.reps,
2388
+ prSetIndex: trackingSetDbSchema.shape.setIndex,
2389
+ estimatedOneRepMax: z33.number().nullable()
2390
+ }))
2391
+ });
2392
+ var exerciseTrackingMapsQueryDtoSchema = z33.object({
2393
+ byDate: z33.record(z33.string(), z33.object({
2394
+ durationMins: z33.number(),
2395
+ exerciseTracked: z33.array(groupedTrackingItemQueryDtoSchema)
2396
+ }))
2397
+ });
2398
+ var exerciseTrackingAndStatsQueryDtoSchema = z33.object({
2399
+ trackingStats: exerciseTrackingStatsQueryDtoSchema,
2400
+ trackingMaps: exerciseTrackingMapsQueryDtoSchema
2401
+ });
2402
+ var exerciseTrackingAndStatsRowQueryDtoSchema = z33.object({
2403
+ data: exerciseTrackingAndStatsQueryDtoSchema
2404
+ });
2405
+ var exerciseTrackingStatsRowQueryDtoSchema = z33.object({
2406
+ data: exerciseTrackingStatsQueryDtoSchema
2407
+ });
2408
+ var exerciseTrackingMapsRowQueryDtoSchema = z33.object({
2409
+ data: exerciseTrackingMapsQueryDtoSchema
2410
+ });
2411
+ var workoutSplitLookupQueryDtoSchema = z33.object({
2412
+ workoutSplitId: workoutSplitDbSchema.shape.id
2413
+ });
2414
+ var workoutSummaryIdQueryDtoSchema = z33.object({
2415
+ id: z33.string().uuid()
2416
+ });
2417
+ var exerciseTrackingIdQueryDtoSchema = z33.object({
2418
+ id: exerciseTrackingDbSchema.shape.id
2419
+ });
2420
+
2421
+ // src/modules/workout/tracking/tracking.contracts.ts
2422
+ var getExerciseTrackingRequestSchema = z34.object({
2423
+ query: z34.object({
2424
+ tz: z34.string().optional()
2442
2425
  })
2443
2426
  });
2444
2427
  var getExerciseTrackingResponseSchema = exerciseTrackingMapsQueryDtoSchema;
@@ -2451,12 +2434,12 @@ var getExerciseTrackingStatsContract = {
2451
2434
  request: getExerciseTrackingRequestSchema,
2452
2435
  response: getExerciseTrackingStatsResponseSchema
2453
2436
  };
2454
- var finishWorkoutRequestSchema = z35.object({
2455
- body: z35.object({
2456
- workout: z35.array(finishedWorkoutEntryQueryDtoSchema),
2457
- tz: z35.string().optional(),
2458
- workoutStartUtc: z35.string().datetime("workoutStartUtc must be a valid ISO datetime"),
2459
- workoutEndUtc: z35.string().datetime("workoutEndUtc must be a valid ISO datetime").optional().nullable()
2437
+ var finishWorkoutRequestSchema = z34.object({
2438
+ body: z34.object({
2439
+ workout: z34.array(finishedWorkoutEntryQueryDtoSchema),
2440
+ tz: z34.string().optional(),
2441
+ workoutStartUtc: z34.string().datetime("workoutStartUtc must be a valid ISO datetime"),
2442
+ workoutEndUtc: z34.string().datetime("workoutEndUtc must be a valid ISO datetime").optional().nullable()
2460
2443
  })
2461
2444
  });
2462
2445
  var finishUserWorkoutResponseSchema = exerciseTrackingAndStatsQueryDtoSchema;
@@ -2483,9 +2466,6 @@ export {
2483
2466
  appleOAuthRequestSchema,
2484
2467
  appleTokenVerificationResultDtoSchema,
2485
2468
  authenticatedUserForUpdateQueryDtoSchema,
2486
- bootstrapContract,
2487
- bootstrapRequestSchema,
2488
- bootstrapResponseSchema,
2489
2469
  changeEmailAndVerifyContract,
2490
2470
  changeEmailAndVerifyRequestSchema,
2491
2471
  changeEmailTokenPayloadDtoSchema,