@sunsteel/contracts 0.13.0 → 0.14.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.cjs CHANGED
@@ -21,6 +21,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
23
  MUSCLE_GROUPS: () => MUSCLE_GROUPS,
24
+ PROFILE_VISIBILITY_VALUES: () => PROFILE_VISIBILITY_VALUES,
24
25
  PROGRESSION_SCHEMES: () => PROGRESSION_SCHEMES,
25
26
  REP_TYPES: () => REP_TYPES,
26
27
  RESERVED_USERNAMES: () => RESERVED_USERNAMES,
@@ -104,6 +105,11 @@ var RESERVED_USERNAMES = [
104
105
  "users",
105
106
  "workouts"
106
107
  ];
108
+ var PROFILE_VISIBILITY_VALUES = [
109
+ "PUBLIC",
110
+ "FOLLOWERS",
111
+ "PRIVATE"
112
+ ];
107
113
 
108
114
  // src/analytics.ts
109
115
  var TRAINING_EVENT_TYPES = [
@@ -114,6 +120,7 @@ var TRAINING_EVENT_TYPES = [
114
120
  // Annotate the CommonJS export names for ESM import in node:
115
121
  0 && (module.exports = {
116
122
  MUSCLE_GROUPS,
123
+ PROFILE_VISIBILITY_VALUES,
117
124
  PROGRESSION_SCHEMES,
118
125
  REP_TYPES,
119
126
  RESERVED_USERNAMES,
package/dist/index.d.cts CHANGED
@@ -24,178 +24,6 @@ interface PaginatedResponse<T> {
24
24
  nextCursor?: string;
25
25
  }
26
26
 
27
- declare const USERNAME_MIN_LENGTH = 3;
28
- declare const USERNAME_MAX_LENGTH = 30;
29
- declare const USERNAME_PATTERN_SOURCE = "^[a-z0-9][a-z0-9_-]{1,28}[a-z0-9]$";
30
- declare const RESERVED_USERNAMES: readonly ["achievements", "admin", "api", "auth", "dashboard", "edit", "exercises", "help", "login", "logout", "me", "new", "notifications", "privacy", "profile", "profiles", "progress", "register", "routines", "schedule", "search", "settings", "signup", "sunnsteel", "sunsteel", "support", "system", "terms", "users", "workouts"];
31
- interface UserProfile {
32
- timeZone?: string | null;
33
- id: string;
34
- email: string;
35
- username: string;
36
- name: string;
37
- lastName?: string | null;
38
- avatarUrl?: string | null;
39
- age?: number | null;
40
- sex?: Sex | null;
41
- weight?: number | null;
42
- height?: number | null;
43
- weightUnit: WeightUnit;
44
- followerCount: number;
45
- followingCount: number;
46
- createdAt: IsoDateString;
47
- updatedAt: IsoDateString;
48
- }
49
- interface PublicUserProfile {
50
- id: string;
51
- username: string;
52
- name: string;
53
- lastName?: string | null;
54
- avatarUrl?: string | null;
55
- createdAt: IsoDateString;
56
- updatedAt: IsoDateString;
57
- followerCount: number;
58
- followingCount: number;
59
- isFollowedByMe: boolean;
60
- }
61
- interface UpdateProfileRequest {
62
- username?: string;
63
- name?: string;
64
- lastName?: string | null;
65
- avatarUrl?: string | null;
66
- age?: number | null;
67
- sex?: Sex | null;
68
- weight?: number | null;
69
- height?: number | null;
70
- weightUnit?: WeightUnit;
71
- }
72
- interface PlatePairInventory {
73
- weightKg: number;
74
- pairCount: number;
75
- }
76
- interface TrainingLocationPreference {
77
- id: string;
78
- name: string;
79
- isDefault: boolean;
80
- barWeightKg: number;
81
- availablePlatePairs: PlatePairInventory[];
82
- equipment: string[];
83
- createdAt: IsoDateString;
84
- updatedAt: IsoDateString;
85
- }
86
- interface TrainingLocationPreferenceInput {
87
- id?: string;
88
- name: string;
89
- isDefault: boolean;
90
- barWeightKg: number;
91
- availablePlatePairs: PlatePairInventory[];
92
- equipment: string[];
93
- }
94
- interface ReplaceTrainingLocationsRequest {
95
- locations: TrainingLocationPreferenceInput[];
96
- }
97
- interface UserSearchResponse {
98
- id: string;
99
- username: string;
100
- name: string;
101
- lastName?: string | null;
102
- avatarUrl?: string | null;
103
- }
104
-
105
- interface SupabaseAuthUser {
106
- id: string;
107
- email: string;
108
- name: string;
109
- supabaseUserId?: string | null;
110
- weightUnit: WeightUnit;
111
- createdAt?: IsoDateString;
112
- updatedAt?: IsoDateString;
113
- }
114
- interface SupabaseAuthResponse {
115
- user: SupabaseAuthUser;
116
- message?: string;
117
- requiresEmailVerification?: boolean;
118
- }
119
- interface SupabaseMigrationResponse {
120
- message: string;
121
- userId: string;
122
- email: string;
123
- }
124
-
125
- interface Exercise {
126
- id: string;
127
- name: string;
128
- primaryMuscles: MuscleGroup[];
129
- secondaryMuscles: MuscleGroup[];
130
- equipment: string;
131
- createdAt: IsoDateString;
132
- updatedAt: IsoDateString;
133
- }
134
-
135
- interface RoutineSet {
136
- setNumber: number;
137
- repType: RepType;
138
- reps?: number | null;
139
- minReps?: number | null;
140
- maxReps?: number | null;
141
- weight?: number | null;
142
- rir?: number | null;
143
- }
144
- interface RoutineExercise {
145
- id: string;
146
- order: number;
147
- restSeconds: number;
148
- note?: string | null;
149
- progressionScheme: ProgressionScheme;
150
- minWeightIncrement: number;
151
- exercise: {
152
- id: string;
153
- name: string;
154
- primaryMuscles?: MuscleGroup[];
155
- secondaryMuscles?: MuscleGroup[];
156
- };
157
- sets: RoutineSet[];
158
- }
159
- interface CreateRoutineExerciseInput {
160
- exerciseId: string;
161
- order?: number;
162
- restSeconds: number;
163
- note?: string;
164
- progressionScheme: ProgressionScheme;
165
- minWeightIncrement: number;
166
- sets: RoutineSet[];
167
- }
168
- interface RoutineDay {
169
- id: string;
170
- dayOfWeek: number;
171
- order: number;
172
- exercises: RoutineExercise[];
173
- }
174
- interface CreateRoutineDayInput {
175
- dayOfWeek: number;
176
- order?: number;
177
- exercises: CreateRoutineExerciseInput[];
178
- }
179
- interface Routine {
180
- id: string;
181
- userId: string;
182
- name: string;
183
- description?: string | null;
184
- isPeriodized: boolean;
185
- isFavorite: boolean;
186
- isCompleted: boolean;
187
- days: RoutineDay[];
188
- createdAt: IsoDateString;
189
- updatedAt: IsoDateString;
190
- }
191
- interface CreateRoutineRequest {
192
- name: string;
193
- description?: string;
194
- isPeriodized: boolean;
195
- days: CreateRoutineDayInput[];
196
- }
197
- type UpdateRoutineRequest = Partial<CreateRoutineRequest>;
198
-
199
27
  interface SetLog {
200
28
  id: string;
201
29
  sessionId: string;
@@ -468,4 +296,210 @@ interface WorkoutAnalyticsStatus {
468
296
  generationId: string | null;
469
297
  }
470
298
 
471
- export { type Brand, type CreateRoutineDayInput, type CreateRoutineExerciseInput, type CreateRoutineRequest, type EarnedPersonalRecord, type Exercise, type ExerciseId, type FinishStatus, type FinishWorkoutRequest, type FinishWorkoutResponse, type IsoDateString, type ListSessionsParams, MUSCLE_GROUPS, type MuscleGroup, PROGRESSION_SCHEMES, type PaginatedResponse, type PersonalRecordEntry, type PersonalRecordKind, type PlatePairInventory, type PreviousPerformanceResponse, type PreviousSessionRecap, type PreviousSetPerformance, type ProgressionChange, type ProgressionRule, type ProgressionScheme, type ProgressionSetChange, type PublicUserProfile, REP_TYPES, RESERVED_USERNAMES, type RecentActivityEntry, type RepType, type ReplaceTrainingLocationsRequest, type Routine, type RoutineDay, type RoutineDayId, type RoutineExercise, type RoutineId, type RoutineSet, SEXES, type SessionRecapRecord, type SetAccountTimeZoneRequest, type SetLog, type Sex, type StartWorkoutRequest, type StartWorkoutResponse, type SupabaseAuthResponse, type SupabaseAuthUser, type SupabaseMigrationResponse, TRAINING_EVENT_TYPES, type TrainingEventType, type TrainingLocationPreference, type TrainingLocationPreferenceInput, USERNAME_MAX_LENGTH, USERNAME_MIN_LENGTH, USERNAME_PATTERN_SOURCE, type UpdateProfileRequest, type UpdateRoutineRequest, type UpsertSetLogRequest, type UpsertSetLogResponse, type UserId, type UserProfile, type UserSearchResponse, WEIGHT_UNITS, WORKOUT_SESSION_STATUSES, type WeightUnit, type WorkoutAnalyticsStatus, type WorkoutProgressQuery, type WorkoutProgressResponse, type WorkoutSession, type WorkoutSessionId, type WorkoutSessionListResponse, type WorkoutSessionRecap, type WorkoutSessionSnapshotV1, type WorkoutSessionStatus, type WorkoutSessionSummary, type WorkoutStatsQuery, type WorkoutStatsResponse };
299
+ declare const USERNAME_MIN_LENGTH = 3;
300
+ declare const USERNAME_MAX_LENGTH = 30;
301
+ declare const USERNAME_PATTERN_SOURCE = "^[a-z0-9][a-z0-9_-]{1,28}[a-z0-9]$";
302
+ declare const RESERVED_USERNAMES: readonly ["achievements", "admin", "api", "auth", "dashboard", "edit", "exercises", "help", "login", "logout", "me", "new", "notifications", "privacy", "profile", "profiles", "progress", "register", "routines", "schedule", "search", "settings", "signup", "sunnsteel", "sunsteel", "support", "system", "terms", "users", "workouts"];
303
+ declare const PROFILE_VISIBILITY_VALUES: readonly ["PUBLIC", "FOLLOWERS", "PRIVATE"];
304
+ type ProfileVisibility = (typeof PROFILE_VISIBILITY_VALUES)[number];
305
+ interface ProfilePrivacySettings {
306
+ workoutHistory: ProfileVisibility;
307
+ records: ProfileVisibility;
308
+ routines: ProfileVisibility;
309
+ achievements: ProfileVisibility;
310
+ bodyMetrics: ProfileVisibility;
311
+ }
312
+ interface ProfileViewerAccess {
313
+ workoutHistory: boolean;
314
+ records: boolean;
315
+ routines: boolean;
316
+ achievements: boolean;
317
+ bodyMetrics: boolean;
318
+ }
319
+ interface PublicTrainingSummary {
320
+ completedWorkouts: number;
321
+ totalVolumeKg: number;
322
+ currentStreakDays: number;
323
+ bestStreakDays: number;
324
+ }
325
+ interface PublicBodyMetrics {
326
+ age?: number | null;
327
+ sex?: Sex | null;
328
+ weightKg?: number | null;
329
+ heightCm?: number | null;
330
+ }
331
+ interface UserProfile {
332
+ timeZone?: string | null;
333
+ id: string;
334
+ email: string;
335
+ username: string;
336
+ name: string;
337
+ lastName?: string | null;
338
+ avatarUrl?: string | null;
339
+ age?: number | null;
340
+ sex?: Sex | null;
341
+ weight?: number | null;
342
+ height?: number | null;
343
+ weightUnit: WeightUnit;
344
+ privacySettings: ProfilePrivacySettings;
345
+ followerCount: number;
346
+ followingCount: number;
347
+ createdAt: IsoDateString;
348
+ updatedAt: IsoDateString;
349
+ }
350
+ interface PublicUserProfile {
351
+ id: string;
352
+ username: string;
353
+ name: string;
354
+ lastName?: string | null;
355
+ avatarUrl?: string | null;
356
+ createdAt: IsoDateString;
357
+ updatedAt: IsoDateString;
358
+ followerCount: number;
359
+ followingCount: number;
360
+ isFollowedByMe: boolean;
361
+ viewerAccess: ProfileViewerAccess;
362
+ trainingSummary?: PublicTrainingSummary;
363
+ personalRecords?: PersonalRecordEntry[];
364
+ bodyMetrics?: PublicBodyMetrics;
365
+ }
366
+ interface UpdateProfileRequest {
367
+ username?: string;
368
+ name?: string;
369
+ lastName?: string | null;
370
+ avatarUrl?: string | null;
371
+ age?: number | null;
372
+ sex?: Sex | null;
373
+ weight?: number | null;
374
+ height?: number | null;
375
+ weightUnit?: WeightUnit;
376
+ }
377
+ type UpdateProfilePrivacyRequest = ProfilePrivacySettings;
378
+ interface PlatePairInventory {
379
+ weightKg: number;
380
+ pairCount: number;
381
+ }
382
+ interface TrainingLocationPreference {
383
+ id: string;
384
+ name: string;
385
+ isDefault: boolean;
386
+ barWeightKg: number;
387
+ availablePlatePairs: PlatePairInventory[];
388
+ equipment: string[];
389
+ createdAt: IsoDateString;
390
+ updatedAt: IsoDateString;
391
+ }
392
+ interface TrainingLocationPreferenceInput {
393
+ id?: string;
394
+ name: string;
395
+ isDefault: boolean;
396
+ barWeightKg: number;
397
+ availablePlatePairs: PlatePairInventory[];
398
+ equipment: string[];
399
+ }
400
+ interface ReplaceTrainingLocationsRequest {
401
+ locations: TrainingLocationPreferenceInput[];
402
+ }
403
+ interface UserSearchResponse {
404
+ id: string;
405
+ username: string;
406
+ name: string;
407
+ lastName?: string | null;
408
+ avatarUrl?: string | null;
409
+ }
410
+
411
+ interface SupabaseAuthUser {
412
+ id: string;
413
+ email: string;
414
+ name: string;
415
+ supabaseUserId?: string | null;
416
+ weightUnit: WeightUnit;
417
+ createdAt?: IsoDateString;
418
+ updatedAt?: IsoDateString;
419
+ }
420
+ interface SupabaseAuthResponse {
421
+ user: SupabaseAuthUser;
422
+ message?: string;
423
+ requiresEmailVerification?: boolean;
424
+ }
425
+ interface SupabaseMigrationResponse {
426
+ message: string;
427
+ userId: string;
428
+ email: string;
429
+ }
430
+
431
+ interface Exercise {
432
+ id: string;
433
+ name: string;
434
+ primaryMuscles: MuscleGroup[];
435
+ secondaryMuscles: MuscleGroup[];
436
+ equipment: string;
437
+ createdAt: IsoDateString;
438
+ updatedAt: IsoDateString;
439
+ }
440
+
441
+ interface RoutineSet {
442
+ setNumber: number;
443
+ repType: RepType;
444
+ reps?: number | null;
445
+ minReps?: number | null;
446
+ maxReps?: number | null;
447
+ weight?: number | null;
448
+ rir?: number | null;
449
+ }
450
+ interface RoutineExercise {
451
+ id: string;
452
+ order: number;
453
+ restSeconds: number;
454
+ note?: string | null;
455
+ progressionScheme: ProgressionScheme;
456
+ minWeightIncrement: number;
457
+ exercise: {
458
+ id: string;
459
+ name: string;
460
+ primaryMuscles?: MuscleGroup[];
461
+ secondaryMuscles?: MuscleGroup[];
462
+ };
463
+ sets: RoutineSet[];
464
+ }
465
+ interface CreateRoutineExerciseInput {
466
+ exerciseId: string;
467
+ order?: number;
468
+ restSeconds: number;
469
+ note?: string;
470
+ progressionScheme: ProgressionScheme;
471
+ minWeightIncrement: number;
472
+ sets: RoutineSet[];
473
+ }
474
+ interface RoutineDay {
475
+ id: string;
476
+ dayOfWeek: number;
477
+ order: number;
478
+ exercises: RoutineExercise[];
479
+ }
480
+ interface CreateRoutineDayInput {
481
+ dayOfWeek: number;
482
+ order?: number;
483
+ exercises: CreateRoutineExerciseInput[];
484
+ }
485
+ interface Routine {
486
+ id: string;
487
+ userId: string;
488
+ name: string;
489
+ description?: string | null;
490
+ isPeriodized: boolean;
491
+ isFavorite: boolean;
492
+ isCompleted: boolean;
493
+ days: RoutineDay[];
494
+ createdAt: IsoDateString;
495
+ updatedAt: IsoDateString;
496
+ }
497
+ interface CreateRoutineRequest {
498
+ name: string;
499
+ description?: string;
500
+ isPeriodized: boolean;
501
+ days: CreateRoutineDayInput[];
502
+ }
503
+ type UpdateRoutineRequest = Partial<CreateRoutineRequest>;
504
+
505
+ export { type Brand, type CreateRoutineDayInput, type CreateRoutineExerciseInput, type CreateRoutineRequest, type EarnedPersonalRecord, type Exercise, type ExerciseId, type FinishStatus, type FinishWorkoutRequest, type FinishWorkoutResponse, type IsoDateString, type ListSessionsParams, MUSCLE_GROUPS, type MuscleGroup, PROFILE_VISIBILITY_VALUES, PROGRESSION_SCHEMES, type PaginatedResponse, type PersonalRecordEntry, type PersonalRecordKind, type PlatePairInventory, type PreviousPerformanceResponse, type PreviousSessionRecap, type PreviousSetPerformance, type ProfilePrivacySettings, type ProfileViewerAccess, type ProfileVisibility, type ProgressionChange, type ProgressionRule, type ProgressionScheme, type ProgressionSetChange, type PublicBodyMetrics, type PublicTrainingSummary, type PublicUserProfile, REP_TYPES, RESERVED_USERNAMES, type RecentActivityEntry, type RepType, type ReplaceTrainingLocationsRequest, type Routine, type RoutineDay, type RoutineDayId, type RoutineExercise, type RoutineId, type RoutineSet, SEXES, type SessionRecapRecord, type SetAccountTimeZoneRequest, type SetLog, type Sex, type StartWorkoutRequest, type StartWorkoutResponse, type SupabaseAuthResponse, type SupabaseAuthUser, type SupabaseMigrationResponse, TRAINING_EVENT_TYPES, type TrainingEventType, type TrainingLocationPreference, type TrainingLocationPreferenceInput, USERNAME_MAX_LENGTH, USERNAME_MIN_LENGTH, USERNAME_PATTERN_SOURCE, type UpdateProfilePrivacyRequest, type UpdateProfileRequest, type UpdateRoutineRequest, type UpsertSetLogRequest, type UpsertSetLogResponse, type UserId, type UserProfile, type UserSearchResponse, WEIGHT_UNITS, WORKOUT_SESSION_STATUSES, type WeightUnit, type WorkoutAnalyticsStatus, type WorkoutProgressQuery, type WorkoutProgressResponse, type WorkoutSession, type WorkoutSessionId, type WorkoutSessionListResponse, type WorkoutSessionRecap, type WorkoutSessionSnapshotV1, type WorkoutSessionStatus, type WorkoutSessionSummary, type WorkoutStatsQuery, type WorkoutStatsResponse };
package/dist/index.d.ts CHANGED
@@ -24,178 +24,6 @@ interface PaginatedResponse<T> {
24
24
  nextCursor?: string;
25
25
  }
26
26
 
27
- declare const USERNAME_MIN_LENGTH = 3;
28
- declare const USERNAME_MAX_LENGTH = 30;
29
- declare const USERNAME_PATTERN_SOURCE = "^[a-z0-9][a-z0-9_-]{1,28}[a-z0-9]$";
30
- declare const RESERVED_USERNAMES: readonly ["achievements", "admin", "api", "auth", "dashboard", "edit", "exercises", "help", "login", "logout", "me", "new", "notifications", "privacy", "profile", "profiles", "progress", "register", "routines", "schedule", "search", "settings", "signup", "sunnsteel", "sunsteel", "support", "system", "terms", "users", "workouts"];
31
- interface UserProfile {
32
- timeZone?: string | null;
33
- id: string;
34
- email: string;
35
- username: string;
36
- name: string;
37
- lastName?: string | null;
38
- avatarUrl?: string | null;
39
- age?: number | null;
40
- sex?: Sex | null;
41
- weight?: number | null;
42
- height?: number | null;
43
- weightUnit: WeightUnit;
44
- followerCount: number;
45
- followingCount: number;
46
- createdAt: IsoDateString;
47
- updatedAt: IsoDateString;
48
- }
49
- interface PublicUserProfile {
50
- id: string;
51
- username: string;
52
- name: string;
53
- lastName?: string | null;
54
- avatarUrl?: string | null;
55
- createdAt: IsoDateString;
56
- updatedAt: IsoDateString;
57
- followerCount: number;
58
- followingCount: number;
59
- isFollowedByMe: boolean;
60
- }
61
- interface UpdateProfileRequest {
62
- username?: string;
63
- name?: string;
64
- lastName?: string | null;
65
- avatarUrl?: string | null;
66
- age?: number | null;
67
- sex?: Sex | null;
68
- weight?: number | null;
69
- height?: number | null;
70
- weightUnit?: WeightUnit;
71
- }
72
- interface PlatePairInventory {
73
- weightKg: number;
74
- pairCount: number;
75
- }
76
- interface TrainingLocationPreference {
77
- id: string;
78
- name: string;
79
- isDefault: boolean;
80
- barWeightKg: number;
81
- availablePlatePairs: PlatePairInventory[];
82
- equipment: string[];
83
- createdAt: IsoDateString;
84
- updatedAt: IsoDateString;
85
- }
86
- interface TrainingLocationPreferenceInput {
87
- id?: string;
88
- name: string;
89
- isDefault: boolean;
90
- barWeightKg: number;
91
- availablePlatePairs: PlatePairInventory[];
92
- equipment: string[];
93
- }
94
- interface ReplaceTrainingLocationsRequest {
95
- locations: TrainingLocationPreferenceInput[];
96
- }
97
- interface UserSearchResponse {
98
- id: string;
99
- username: string;
100
- name: string;
101
- lastName?: string | null;
102
- avatarUrl?: string | null;
103
- }
104
-
105
- interface SupabaseAuthUser {
106
- id: string;
107
- email: string;
108
- name: string;
109
- supabaseUserId?: string | null;
110
- weightUnit: WeightUnit;
111
- createdAt?: IsoDateString;
112
- updatedAt?: IsoDateString;
113
- }
114
- interface SupabaseAuthResponse {
115
- user: SupabaseAuthUser;
116
- message?: string;
117
- requiresEmailVerification?: boolean;
118
- }
119
- interface SupabaseMigrationResponse {
120
- message: string;
121
- userId: string;
122
- email: string;
123
- }
124
-
125
- interface Exercise {
126
- id: string;
127
- name: string;
128
- primaryMuscles: MuscleGroup[];
129
- secondaryMuscles: MuscleGroup[];
130
- equipment: string;
131
- createdAt: IsoDateString;
132
- updatedAt: IsoDateString;
133
- }
134
-
135
- interface RoutineSet {
136
- setNumber: number;
137
- repType: RepType;
138
- reps?: number | null;
139
- minReps?: number | null;
140
- maxReps?: number | null;
141
- weight?: number | null;
142
- rir?: number | null;
143
- }
144
- interface RoutineExercise {
145
- id: string;
146
- order: number;
147
- restSeconds: number;
148
- note?: string | null;
149
- progressionScheme: ProgressionScheme;
150
- minWeightIncrement: number;
151
- exercise: {
152
- id: string;
153
- name: string;
154
- primaryMuscles?: MuscleGroup[];
155
- secondaryMuscles?: MuscleGroup[];
156
- };
157
- sets: RoutineSet[];
158
- }
159
- interface CreateRoutineExerciseInput {
160
- exerciseId: string;
161
- order?: number;
162
- restSeconds: number;
163
- note?: string;
164
- progressionScheme: ProgressionScheme;
165
- minWeightIncrement: number;
166
- sets: RoutineSet[];
167
- }
168
- interface RoutineDay {
169
- id: string;
170
- dayOfWeek: number;
171
- order: number;
172
- exercises: RoutineExercise[];
173
- }
174
- interface CreateRoutineDayInput {
175
- dayOfWeek: number;
176
- order?: number;
177
- exercises: CreateRoutineExerciseInput[];
178
- }
179
- interface Routine {
180
- id: string;
181
- userId: string;
182
- name: string;
183
- description?: string | null;
184
- isPeriodized: boolean;
185
- isFavorite: boolean;
186
- isCompleted: boolean;
187
- days: RoutineDay[];
188
- createdAt: IsoDateString;
189
- updatedAt: IsoDateString;
190
- }
191
- interface CreateRoutineRequest {
192
- name: string;
193
- description?: string;
194
- isPeriodized: boolean;
195
- days: CreateRoutineDayInput[];
196
- }
197
- type UpdateRoutineRequest = Partial<CreateRoutineRequest>;
198
-
199
27
  interface SetLog {
200
28
  id: string;
201
29
  sessionId: string;
@@ -468,4 +296,210 @@ interface WorkoutAnalyticsStatus {
468
296
  generationId: string | null;
469
297
  }
470
298
 
471
- export { type Brand, type CreateRoutineDayInput, type CreateRoutineExerciseInput, type CreateRoutineRequest, type EarnedPersonalRecord, type Exercise, type ExerciseId, type FinishStatus, type FinishWorkoutRequest, type FinishWorkoutResponse, type IsoDateString, type ListSessionsParams, MUSCLE_GROUPS, type MuscleGroup, PROGRESSION_SCHEMES, type PaginatedResponse, type PersonalRecordEntry, type PersonalRecordKind, type PlatePairInventory, type PreviousPerformanceResponse, type PreviousSessionRecap, type PreviousSetPerformance, type ProgressionChange, type ProgressionRule, type ProgressionScheme, type ProgressionSetChange, type PublicUserProfile, REP_TYPES, RESERVED_USERNAMES, type RecentActivityEntry, type RepType, type ReplaceTrainingLocationsRequest, type Routine, type RoutineDay, type RoutineDayId, type RoutineExercise, type RoutineId, type RoutineSet, SEXES, type SessionRecapRecord, type SetAccountTimeZoneRequest, type SetLog, type Sex, type StartWorkoutRequest, type StartWorkoutResponse, type SupabaseAuthResponse, type SupabaseAuthUser, type SupabaseMigrationResponse, TRAINING_EVENT_TYPES, type TrainingEventType, type TrainingLocationPreference, type TrainingLocationPreferenceInput, USERNAME_MAX_LENGTH, USERNAME_MIN_LENGTH, USERNAME_PATTERN_SOURCE, type UpdateProfileRequest, type UpdateRoutineRequest, type UpsertSetLogRequest, type UpsertSetLogResponse, type UserId, type UserProfile, type UserSearchResponse, WEIGHT_UNITS, WORKOUT_SESSION_STATUSES, type WeightUnit, type WorkoutAnalyticsStatus, type WorkoutProgressQuery, type WorkoutProgressResponse, type WorkoutSession, type WorkoutSessionId, type WorkoutSessionListResponse, type WorkoutSessionRecap, type WorkoutSessionSnapshotV1, type WorkoutSessionStatus, type WorkoutSessionSummary, type WorkoutStatsQuery, type WorkoutStatsResponse };
299
+ declare const USERNAME_MIN_LENGTH = 3;
300
+ declare const USERNAME_MAX_LENGTH = 30;
301
+ declare const USERNAME_PATTERN_SOURCE = "^[a-z0-9][a-z0-9_-]{1,28}[a-z0-9]$";
302
+ declare const RESERVED_USERNAMES: readonly ["achievements", "admin", "api", "auth", "dashboard", "edit", "exercises", "help", "login", "logout", "me", "new", "notifications", "privacy", "profile", "profiles", "progress", "register", "routines", "schedule", "search", "settings", "signup", "sunnsteel", "sunsteel", "support", "system", "terms", "users", "workouts"];
303
+ declare const PROFILE_VISIBILITY_VALUES: readonly ["PUBLIC", "FOLLOWERS", "PRIVATE"];
304
+ type ProfileVisibility = (typeof PROFILE_VISIBILITY_VALUES)[number];
305
+ interface ProfilePrivacySettings {
306
+ workoutHistory: ProfileVisibility;
307
+ records: ProfileVisibility;
308
+ routines: ProfileVisibility;
309
+ achievements: ProfileVisibility;
310
+ bodyMetrics: ProfileVisibility;
311
+ }
312
+ interface ProfileViewerAccess {
313
+ workoutHistory: boolean;
314
+ records: boolean;
315
+ routines: boolean;
316
+ achievements: boolean;
317
+ bodyMetrics: boolean;
318
+ }
319
+ interface PublicTrainingSummary {
320
+ completedWorkouts: number;
321
+ totalVolumeKg: number;
322
+ currentStreakDays: number;
323
+ bestStreakDays: number;
324
+ }
325
+ interface PublicBodyMetrics {
326
+ age?: number | null;
327
+ sex?: Sex | null;
328
+ weightKg?: number | null;
329
+ heightCm?: number | null;
330
+ }
331
+ interface UserProfile {
332
+ timeZone?: string | null;
333
+ id: string;
334
+ email: string;
335
+ username: string;
336
+ name: string;
337
+ lastName?: string | null;
338
+ avatarUrl?: string | null;
339
+ age?: number | null;
340
+ sex?: Sex | null;
341
+ weight?: number | null;
342
+ height?: number | null;
343
+ weightUnit: WeightUnit;
344
+ privacySettings: ProfilePrivacySettings;
345
+ followerCount: number;
346
+ followingCount: number;
347
+ createdAt: IsoDateString;
348
+ updatedAt: IsoDateString;
349
+ }
350
+ interface PublicUserProfile {
351
+ id: string;
352
+ username: string;
353
+ name: string;
354
+ lastName?: string | null;
355
+ avatarUrl?: string | null;
356
+ createdAt: IsoDateString;
357
+ updatedAt: IsoDateString;
358
+ followerCount: number;
359
+ followingCount: number;
360
+ isFollowedByMe: boolean;
361
+ viewerAccess: ProfileViewerAccess;
362
+ trainingSummary?: PublicTrainingSummary;
363
+ personalRecords?: PersonalRecordEntry[];
364
+ bodyMetrics?: PublicBodyMetrics;
365
+ }
366
+ interface UpdateProfileRequest {
367
+ username?: string;
368
+ name?: string;
369
+ lastName?: string | null;
370
+ avatarUrl?: string | null;
371
+ age?: number | null;
372
+ sex?: Sex | null;
373
+ weight?: number | null;
374
+ height?: number | null;
375
+ weightUnit?: WeightUnit;
376
+ }
377
+ type UpdateProfilePrivacyRequest = ProfilePrivacySettings;
378
+ interface PlatePairInventory {
379
+ weightKg: number;
380
+ pairCount: number;
381
+ }
382
+ interface TrainingLocationPreference {
383
+ id: string;
384
+ name: string;
385
+ isDefault: boolean;
386
+ barWeightKg: number;
387
+ availablePlatePairs: PlatePairInventory[];
388
+ equipment: string[];
389
+ createdAt: IsoDateString;
390
+ updatedAt: IsoDateString;
391
+ }
392
+ interface TrainingLocationPreferenceInput {
393
+ id?: string;
394
+ name: string;
395
+ isDefault: boolean;
396
+ barWeightKg: number;
397
+ availablePlatePairs: PlatePairInventory[];
398
+ equipment: string[];
399
+ }
400
+ interface ReplaceTrainingLocationsRequest {
401
+ locations: TrainingLocationPreferenceInput[];
402
+ }
403
+ interface UserSearchResponse {
404
+ id: string;
405
+ username: string;
406
+ name: string;
407
+ lastName?: string | null;
408
+ avatarUrl?: string | null;
409
+ }
410
+
411
+ interface SupabaseAuthUser {
412
+ id: string;
413
+ email: string;
414
+ name: string;
415
+ supabaseUserId?: string | null;
416
+ weightUnit: WeightUnit;
417
+ createdAt?: IsoDateString;
418
+ updatedAt?: IsoDateString;
419
+ }
420
+ interface SupabaseAuthResponse {
421
+ user: SupabaseAuthUser;
422
+ message?: string;
423
+ requiresEmailVerification?: boolean;
424
+ }
425
+ interface SupabaseMigrationResponse {
426
+ message: string;
427
+ userId: string;
428
+ email: string;
429
+ }
430
+
431
+ interface Exercise {
432
+ id: string;
433
+ name: string;
434
+ primaryMuscles: MuscleGroup[];
435
+ secondaryMuscles: MuscleGroup[];
436
+ equipment: string;
437
+ createdAt: IsoDateString;
438
+ updatedAt: IsoDateString;
439
+ }
440
+
441
+ interface RoutineSet {
442
+ setNumber: number;
443
+ repType: RepType;
444
+ reps?: number | null;
445
+ minReps?: number | null;
446
+ maxReps?: number | null;
447
+ weight?: number | null;
448
+ rir?: number | null;
449
+ }
450
+ interface RoutineExercise {
451
+ id: string;
452
+ order: number;
453
+ restSeconds: number;
454
+ note?: string | null;
455
+ progressionScheme: ProgressionScheme;
456
+ minWeightIncrement: number;
457
+ exercise: {
458
+ id: string;
459
+ name: string;
460
+ primaryMuscles?: MuscleGroup[];
461
+ secondaryMuscles?: MuscleGroup[];
462
+ };
463
+ sets: RoutineSet[];
464
+ }
465
+ interface CreateRoutineExerciseInput {
466
+ exerciseId: string;
467
+ order?: number;
468
+ restSeconds: number;
469
+ note?: string;
470
+ progressionScheme: ProgressionScheme;
471
+ minWeightIncrement: number;
472
+ sets: RoutineSet[];
473
+ }
474
+ interface RoutineDay {
475
+ id: string;
476
+ dayOfWeek: number;
477
+ order: number;
478
+ exercises: RoutineExercise[];
479
+ }
480
+ interface CreateRoutineDayInput {
481
+ dayOfWeek: number;
482
+ order?: number;
483
+ exercises: CreateRoutineExerciseInput[];
484
+ }
485
+ interface Routine {
486
+ id: string;
487
+ userId: string;
488
+ name: string;
489
+ description?: string | null;
490
+ isPeriodized: boolean;
491
+ isFavorite: boolean;
492
+ isCompleted: boolean;
493
+ days: RoutineDay[];
494
+ createdAt: IsoDateString;
495
+ updatedAt: IsoDateString;
496
+ }
497
+ interface CreateRoutineRequest {
498
+ name: string;
499
+ description?: string;
500
+ isPeriodized: boolean;
501
+ days: CreateRoutineDayInput[];
502
+ }
503
+ type UpdateRoutineRequest = Partial<CreateRoutineRequest>;
504
+
505
+ export { type Brand, type CreateRoutineDayInput, type CreateRoutineExerciseInput, type CreateRoutineRequest, type EarnedPersonalRecord, type Exercise, type ExerciseId, type FinishStatus, type FinishWorkoutRequest, type FinishWorkoutResponse, type IsoDateString, type ListSessionsParams, MUSCLE_GROUPS, type MuscleGroup, PROFILE_VISIBILITY_VALUES, PROGRESSION_SCHEMES, type PaginatedResponse, type PersonalRecordEntry, type PersonalRecordKind, type PlatePairInventory, type PreviousPerformanceResponse, type PreviousSessionRecap, type PreviousSetPerformance, type ProfilePrivacySettings, type ProfileViewerAccess, type ProfileVisibility, type ProgressionChange, type ProgressionRule, type ProgressionScheme, type ProgressionSetChange, type PublicBodyMetrics, type PublicTrainingSummary, type PublicUserProfile, REP_TYPES, RESERVED_USERNAMES, type RecentActivityEntry, type RepType, type ReplaceTrainingLocationsRequest, type Routine, type RoutineDay, type RoutineDayId, type RoutineExercise, type RoutineId, type RoutineSet, SEXES, type SessionRecapRecord, type SetAccountTimeZoneRequest, type SetLog, type Sex, type StartWorkoutRequest, type StartWorkoutResponse, type SupabaseAuthResponse, type SupabaseAuthUser, type SupabaseMigrationResponse, TRAINING_EVENT_TYPES, type TrainingEventType, type TrainingLocationPreference, type TrainingLocationPreferenceInput, USERNAME_MAX_LENGTH, USERNAME_MIN_LENGTH, USERNAME_PATTERN_SOURCE, type UpdateProfilePrivacyRequest, type UpdateProfileRequest, type UpdateRoutineRequest, type UpsertSetLogRequest, type UpsertSetLogResponse, type UserId, type UserProfile, type UserSearchResponse, WEIGHT_UNITS, WORKOUT_SESSION_STATUSES, type WeightUnit, type WorkoutAnalyticsStatus, type WorkoutProgressQuery, type WorkoutProgressResponse, type WorkoutSession, type WorkoutSessionId, type WorkoutSessionListResponse, type WorkoutSessionRecap, type WorkoutSessionSnapshotV1, type WorkoutSessionStatus, type WorkoutSessionSummary, type WorkoutStatsQuery, type WorkoutStatsResponse };
package/dist/index.js CHANGED
@@ -68,6 +68,11 @@ var RESERVED_USERNAMES = [
68
68
  "users",
69
69
  "workouts"
70
70
  ];
71
+ var PROFILE_VISIBILITY_VALUES = [
72
+ "PUBLIC",
73
+ "FOLLOWERS",
74
+ "PRIVATE"
75
+ ];
71
76
 
72
77
  // src/analytics.ts
73
78
  var TRAINING_EVENT_TYPES = [
@@ -77,6 +82,7 @@ var TRAINING_EVENT_TYPES = [
77
82
  ];
78
83
  export {
79
84
  MUSCLE_GROUPS,
85
+ PROFILE_VISIBILITY_VALUES,
80
86
  PROGRESSION_SCHEMES,
81
87
  REP_TYPES,
82
88
  RESERVED_USERNAMES,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sunsteel/contracts",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/ezee969/sunsteel-contracts.git"