@sunsteel/contracts 0.12.0 → 0.13.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
@@ -23,8 +23,12 @@ __export(index_exports, {
23
23
  MUSCLE_GROUPS: () => MUSCLE_GROUPS,
24
24
  PROGRESSION_SCHEMES: () => PROGRESSION_SCHEMES,
25
25
  REP_TYPES: () => REP_TYPES,
26
+ RESERVED_USERNAMES: () => RESERVED_USERNAMES,
26
27
  SEXES: () => SEXES,
27
28
  TRAINING_EVENT_TYPES: () => TRAINING_EVENT_TYPES,
29
+ USERNAME_MAX_LENGTH: () => USERNAME_MAX_LENGTH,
30
+ USERNAME_MIN_LENGTH: () => USERNAME_MIN_LENGTH,
31
+ USERNAME_PATTERN_SOURCE: () => USERNAME_PATTERN_SOURCE,
28
32
  WEIGHT_UNITS: () => WEIGHT_UNITS,
29
33
  WORKOUT_SESSION_STATUSES: () => WORKOUT_SESSION_STATUSES
30
34
  });
@@ -64,6 +68,43 @@ var MUSCLE_GROUPS = [
64
68
  "ADDUCTOR"
65
69
  ];
66
70
 
71
+ // src/user.ts
72
+ var USERNAME_MIN_LENGTH = 3;
73
+ var USERNAME_MAX_LENGTH = 30;
74
+ var USERNAME_PATTERN_SOURCE = "^[a-z0-9][a-z0-9_-]{1,28}[a-z0-9]$";
75
+ var RESERVED_USERNAMES = [
76
+ "achievements",
77
+ "admin",
78
+ "api",
79
+ "auth",
80
+ "dashboard",
81
+ "edit",
82
+ "exercises",
83
+ "help",
84
+ "login",
85
+ "logout",
86
+ "me",
87
+ "new",
88
+ "notifications",
89
+ "privacy",
90
+ "profile",
91
+ "profiles",
92
+ "progress",
93
+ "register",
94
+ "routines",
95
+ "schedule",
96
+ "search",
97
+ "settings",
98
+ "signup",
99
+ "sunnsteel",
100
+ "sunsteel",
101
+ "support",
102
+ "system",
103
+ "terms",
104
+ "users",
105
+ "workouts"
106
+ ];
107
+
67
108
  // src/analytics.ts
68
109
  var TRAINING_EVENT_TYPES = [
69
110
  "SESSION_COMPLETED",
@@ -75,8 +116,12 @@ var TRAINING_EVENT_TYPES = [
75
116
  MUSCLE_GROUPS,
76
117
  PROGRESSION_SCHEMES,
77
118
  REP_TYPES,
119
+ RESERVED_USERNAMES,
78
120
  SEXES,
79
121
  TRAINING_EVENT_TYPES,
122
+ USERNAME_MAX_LENGTH,
123
+ USERNAME_MIN_LENGTH,
124
+ USERNAME_PATTERN_SOURCE,
80
125
  WEIGHT_UNITS,
81
126
  WORKOUT_SESSION_STATUSES
82
127
  });
package/dist/index.d.cts CHANGED
@@ -24,10 +24,15 @@ 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"];
27
31
  interface UserProfile {
28
32
  timeZone?: string | null;
29
33
  id: string;
30
34
  email: string;
35
+ username: string;
31
36
  name: string;
32
37
  lastName?: string | null;
33
38
  avatarUrl?: string | null;
@@ -43,6 +48,7 @@ interface UserProfile {
43
48
  }
44
49
  interface PublicUserProfile {
45
50
  id: string;
51
+ username: string;
46
52
  name: string;
47
53
  lastName?: string | null;
48
54
  avatarUrl?: string | null;
@@ -53,6 +59,7 @@ interface PublicUserProfile {
53
59
  isFollowedByMe: boolean;
54
60
  }
55
61
  interface UpdateProfileRequest {
62
+ username?: string;
56
63
  name?: string;
57
64
  lastName?: string | null;
58
65
  avatarUrl?: string | null;
@@ -89,7 +96,7 @@ interface ReplaceTrainingLocationsRequest {
89
96
  }
90
97
  interface UserSearchResponse {
91
98
  id: string;
92
- email: string;
99
+ username: string;
93
100
  name: string;
94
101
  lastName?: string | null;
95
102
  avatarUrl?: string | null;
@@ -461,4 +468,4 @@ interface WorkoutAnalyticsStatus {
461
468
  generationId: string | null;
462
469
  }
463
470
 
464
- 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, 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, 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 };
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 };
package/dist/index.d.ts CHANGED
@@ -24,10 +24,15 @@ 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"];
27
31
  interface UserProfile {
28
32
  timeZone?: string | null;
29
33
  id: string;
30
34
  email: string;
35
+ username: string;
31
36
  name: string;
32
37
  lastName?: string | null;
33
38
  avatarUrl?: string | null;
@@ -43,6 +48,7 @@ interface UserProfile {
43
48
  }
44
49
  interface PublicUserProfile {
45
50
  id: string;
51
+ username: string;
46
52
  name: string;
47
53
  lastName?: string | null;
48
54
  avatarUrl?: string | null;
@@ -53,6 +59,7 @@ interface PublicUserProfile {
53
59
  isFollowedByMe: boolean;
54
60
  }
55
61
  interface UpdateProfileRequest {
62
+ username?: string;
56
63
  name?: string;
57
64
  lastName?: string | null;
58
65
  avatarUrl?: string | null;
@@ -89,7 +96,7 @@ interface ReplaceTrainingLocationsRequest {
89
96
  }
90
97
  interface UserSearchResponse {
91
98
  id: string;
92
- email: string;
99
+ username: string;
93
100
  name: string;
94
101
  lastName?: string | null;
95
102
  avatarUrl?: string | null;
@@ -461,4 +468,4 @@ interface WorkoutAnalyticsStatus {
461
468
  generationId: string | null;
462
469
  }
463
470
 
464
- 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, 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, 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 };
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 };
package/dist/index.js CHANGED
@@ -32,6 +32,43 @@ var MUSCLE_GROUPS = [
32
32
  "ADDUCTOR"
33
33
  ];
34
34
 
35
+ // src/user.ts
36
+ var USERNAME_MIN_LENGTH = 3;
37
+ var USERNAME_MAX_LENGTH = 30;
38
+ var USERNAME_PATTERN_SOURCE = "^[a-z0-9][a-z0-9_-]{1,28}[a-z0-9]$";
39
+ var RESERVED_USERNAMES = [
40
+ "achievements",
41
+ "admin",
42
+ "api",
43
+ "auth",
44
+ "dashboard",
45
+ "edit",
46
+ "exercises",
47
+ "help",
48
+ "login",
49
+ "logout",
50
+ "me",
51
+ "new",
52
+ "notifications",
53
+ "privacy",
54
+ "profile",
55
+ "profiles",
56
+ "progress",
57
+ "register",
58
+ "routines",
59
+ "schedule",
60
+ "search",
61
+ "settings",
62
+ "signup",
63
+ "sunnsteel",
64
+ "sunsteel",
65
+ "support",
66
+ "system",
67
+ "terms",
68
+ "users",
69
+ "workouts"
70
+ ];
71
+
35
72
  // src/analytics.ts
36
73
  var TRAINING_EVENT_TYPES = [
37
74
  "SESSION_COMPLETED",
@@ -42,8 +79,12 @@ export {
42
79
  MUSCLE_GROUPS,
43
80
  PROGRESSION_SCHEMES,
44
81
  REP_TYPES,
82
+ RESERVED_USERNAMES,
45
83
  SEXES,
46
84
  TRAINING_EVENT_TYPES,
85
+ USERNAME_MAX_LENGTH,
86
+ USERNAME_MIN_LENGTH,
87
+ USERNAME_PATTERN_SOURCE,
47
88
  WEIGHT_UNITS,
48
89
  WORKOUT_SESSION_STATUSES
49
90
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sunsteel/contracts",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/ezee969/sunsteel-contracts.git"