@sunsteel/contracts 0.24.0 → 0.26.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 +71 -0
- package/dist/index.d.cts +77 -1
- package/dist/index.d.ts +77 -1
- package/dist/index.js +65 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -20,9 +20,12 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/index.ts
|
|
21
21
|
var index_exports = {};
|
|
22
22
|
__export(index_exports, {
|
|
23
|
+
EXERCISE_EQUIPMENT: () => EXERCISE_EQUIPMENT,
|
|
24
|
+
EXERCISE_MECHANICS: () => EXERCISE_MECHANICS,
|
|
23
25
|
FOLLOW_SUGGESTIONS_DEFAULT_LIMIT: () => FOLLOW_SUGGESTIONS_DEFAULT_LIMIT,
|
|
24
26
|
FOLLOW_SUGGESTIONS_MAX_LIMIT: () => FOLLOW_SUGGESTIONS_MAX_LIMIT,
|
|
25
27
|
FOLLOW_SUGGESTION_REASONS: () => FOLLOW_SUGGESTION_REASONS,
|
|
28
|
+
MOVEMENT_PATTERNS: () => MOVEMENT_PATTERNS,
|
|
26
29
|
MUSCLE_GROUPS: () => MUSCLE_GROUPS,
|
|
27
30
|
PREFERRED_TRAINING_STYLE_VALUES: () => PREFERRED_TRAINING_STYLE_VALUES,
|
|
28
31
|
PROFILE_BIO_MAX_LENGTH: () => PROFILE_BIO_MAX_LENGTH,
|
|
@@ -38,6 +41,9 @@ __export(index_exports, {
|
|
|
38
41
|
RELATIONSHIP_LIST_MAX_LIMIT: () => RELATIONSHIP_LIST_MAX_LIMIT,
|
|
39
42
|
REP_TYPES: () => REP_TYPES,
|
|
40
43
|
RESERVED_USERNAMES: () => RESERVED_USERNAMES,
|
|
44
|
+
SESSION_SHARE_DEFAULT_FIELDS: () => SESSION_SHARE_DEFAULT_FIELDS,
|
|
45
|
+
SESSION_SHARE_FIELDS: () => SESSION_SHARE_FIELDS,
|
|
46
|
+
SESSION_SHARE_MAX_ACTIVE_LINKS: () => SESSION_SHARE_MAX_ACTIVE_LINKS,
|
|
41
47
|
SEXES: () => SEXES,
|
|
42
48
|
TRAINING_DISCIPLINE_VALUES: () => TRAINING_DISCIPLINE_VALUES,
|
|
43
49
|
TRAINING_EVENT_TYPES: () => TRAINING_EVENT_TYPES,
|
|
@@ -175,6 +181,65 @@ var FOLLOW_SUGGESTION_REASONS = [
|
|
|
175
181
|
"FOLLOWED_BY_PEOPLE_YOU_FOLLOW"
|
|
176
182
|
];
|
|
177
183
|
|
|
184
|
+
// src/exercise.ts
|
|
185
|
+
var MOVEMENT_PATTERNS = [
|
|
186
|
+
"HORIZONTAL_PUSH",
|
|
187
|
+
"VERTICAL_PUSH",
|
|
188
|
+
"HORIZONTAL_PULL",
|
|
189
|
+
"VERTICAL_PULL",
|
|
190
|
+
"SQUAT",
|
|
191
|
+
"HINGE",
|
|
192
|
+
"LUNGE",
|
|
193
|
+
"CHEST_FLY",
|
|
194
|
+
"SHOULDER_ABDUCTION",
|
|
195
|
+
"SHOULDER_FLEXION",
|
|
196
|
+
"SHOULDER_HORIZONTAL_ABDUCTION",
|
|
197
|
+
"SHOULDER_EXTENSION",
|
|
198
|
+
"SCAPULAR_ELEVATION",
|
|
199
|
+
"ELBOW_FLEXION",
|
|
200
|
+
"ELBOW_EXTENSION",
|
|
201
|
+
"KNEE_EXTENSION",
|
|
202
|
+
"KNEE_FLEXION",
|
|
203
|
+
"HIP_EXTENSION",
|
|
204
|
+
"PLANTAR_FLEXION",
|
|
205
|
+
"CORE_FLEXION",
|
|
206
|
+
"CORE_ROTATION",
|
|
207
|
+
"CORE_STABILITY"
|
|
208
|
+
];
|
|
209
|
+
var EXERCISE_MECHANICS = ["COMPOUND", "ISOLATION"];
|
|
210
|
+
var EXERCISE_EQUIPMENT = [
|
|
211
|
+
"barbell",
|
|
212
|
+
"ez-bar",
|
|
213
|
+
"dumbbell",
|
|
214
|
+
"cable",
|
|
215
|
+
"machine",
|
|
216
|
+
"smith-machine",
|
|
217
|
+
"bench",
|
|
218
|
+
"incline-bench",
|
|
219
|
+
"preacher-bench",
|
|
220
|
+
"rack",
|
|
221
|
+
"pull-up-bar",
|
|
222
|
+
"dip-station",
|
|
223
|
+
"bodyweight"
|
|
224
|
+
];
|
|
225
|
+
|
|
226
|
+
// src/workout.ts
|
|
227
|
+
var SESSION_SHARE_FIELDS = [
|
|
228
|
+
"duration",
|
|
229
|
+
"volume",
|
|
230
|
+
"completedSets",
|
|
231
|
+
"records",
|
|
232
|
+
"progression",
|
|
233
|
+
"notes"
|
|
234
|
+
];
|
|
235
|
+
var SESSION_SHARE_DEFAULT_FIELDS = [
|
|
236
|
+
"duration",
|
|
237
|
+
"volume",
|
|
238
|
+
"completedSets",
|
|
239
|
+
"records"
|
|
240
|
+
];
|
|
241
|
+
var SESSION_SHARE_MAX_ACTIVE_LINKS = 10;
|
|
242
|
+
|
|
178
243
|
// src/analytics.ts
|
|
179
244
|
var TRAINING_EVENT_TYPES = [
|
|
180
245
|
"SESSION_COMPLETED",
|
|
@@ -187,9 +252,12 @@ var PROGRESS_TIMELINE_EVENT_TYPES = [
|
|
|
187
252
|
];
|
|
188
253
|
// Annotate the CommonJS export names for ESM import in node:
|
|
189
254
|
0 && (module.exports = {
|
|
255
|
+
EXERCISE_EQUIPMENT,
|
|
256
|
+
EXERCISE_MECHANICS,
|
|
190
257
|
FOLLOW_SUGGESTIONS_DEFAULT_LIMIT,
|
|
191
258
|
FOLLOW_SUGGESTIONS_MAX_LIMIT,
|
|
192
259
|
FOLLOW_SUGGESTION_REASONS,
|
|
260
|
+
MOVEMENT_PATTERNS,
|
|
193
261
|
MUSCLE_GROUPS,
|
|
194
262
|
PREFERRED_TRAINING_STYLE_VALUES,
|
|
195
263
|
PROFILE_BIO_MAX_LENGTH,
|
|
@@ -205,6 +273,9 @@ var PROGRESS_TIMELINE_EVENT_TYPES = [
|
|
|
205
273
|
RELATIONSHIP_LIST_MAX_LIMIT,
|
|
206
274
|
REP_TYPES,
|
|
207
275
|
RESERVED_USERNAMES,
|
|
276
|
+
SESSION_SHARE_DEFAULT_FIELDS,
|
|
277
|
+
SESSION_SHARE_FIELDS,
|
|
278
|
+
SESSION_SHARE_MAX_ACTIVE_LINKS,
|
|
208
279
|
SEXES,
|
|
209
280
|
TRAINING_DISCIPLINE_VALUES,
|
|
210
281
|
TRAINING_EVENT_TYPES,
|
package/dist/index.d.cts
CHANGED
|
@@ -201,6 +201,54 @@ interface WorkoutSessionRecap {
|
|
|
201
201
|
progressionChanges: ProgressionChange[];
|
|
202
202
|
previousSession: PreviousSessionRecap | null;
|
|
203
203
|
}
|
|
204
|
+
/** Parts of a completed session's recap the owner may choose to share. */
|
|
205
|
+
declare const SESSION_SHARE_FIELDS: readonly ["duration", "volume", "completedSets", "records", "progression", "notes"];
|
|
206
|
+
type SessionShareField = (typeof SESSION_SHARE_FIELDS)[number];
|
|
207
|
+
/** Pre-selected when creating a link; notes and prescriptions are opt-in. */
|
|
208
|
+
declare const SESSION_SHARE_DEFAULT_FIELDS: SessionShareField[];
|
|
209
|
+
declare const SESSION_SHARE_MAX_ACTIVE_LINKS = 10;
|
|
210
|
+
interface CreateSessionShareRequest {
|
|
211
|
+
fields: SessionShareField[];
|
|
212
|
+
}
|
|
213
|
+
/** An active share link, visible only to the session owner. */
|
|
214
|
+
interface SessionShare {
|
|
215
|
+
id: string;
|
|
216
|
+
sessionId: string;
|
|
217
|
+
/** Unguessable identifier used in the public `/shared/sessions/:token` URL. */
|
|
218
|
+
token: string;
|
|
219
|
+
fields: SessionShareField[];
|
|
220
|
+
createdAt: IsoDateString;
|
|
221
|
+
}
|
|
222
|
+
/** Stable successful response of GET /workouts/sessions/:id/shares. */
|
|
223
|
+
interface SessionShareListResponse {
|
|
224
|
+
items: SessionShare[];
|
|
225
|
+
}
|
|
226
|
+
interface SharedSessionOwner {
|
|
227
|
+
username: string;
|
|
228
|
+
name: string;
|
|
229
|
+
lastName?: string | null;
|
|
230
|
+
avatarUrl?: string | null;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Stable successful response of the unauthenticated
|
|
234
|
+
* GET /shared/sessions/:token. Only the fields named in `fields` are present;
|
|
235
|
+
* everything else is omitted rather than nulled. Weights are canonical kg and
|
|
236
|
+
* `weightUnit` is the owner's display preference.
|
|
237
|
+
*/
|
|
238
|
+
interface SharedSessionRecap {
|
|
239
|
+
fields: SessionShareField[];
|
|
240
|
+
owner: SharedSessionOwner;
|
|
241
|
+
weightUnit: WeightUnit;
|
|
242
|
+
routineName: string;
|
|
243
|
+
dayName?: string | null;
|
|
244
|
+
endedAt: IsoDateString;
|
|
245
|
+
durationSec?: number;
|
|
246
|
+
totalVolumeKg?: number;
|
|
247
|
+
completedSets?: number;
|
|
248
|
+
records?: SessionRecapRecord[];
|
|
249
|
+
progressionChanges?: ProgressionChange[];
|
|
250
|
+
notes?: string | null;
|
|
251
|
+
}
|
|
204
252
|
interface WorkoutSessionSummary {
|
|
205
253
|
id: string;
|
|
206
254
|
status: WorkoutSessionStatus;
|
|
@@ -751,12 +799,40 @@ interface SupabaseMigrationResponse {
|
|
|
751
799
|
email: string;
|
|
752
800
|
}
|
|
753
801
|
|
|
802
|
+
/**
|
|
803
|
+
* How an exercise moves (EXER-09). Compound patterns first, then the
|
|
804
|
+
* single-joint actions the catalog uses. Alternatives start from this plus
|
|
805
|
+
* primary muscles; `substitutionGroup` is the narrower, near-identical set.
|
|
806
|
+
*/
|
|
807
|
+
declare const MOVEMENT_PATTERNS: readonly ["HORIZONTAL_PUSH", "VERTICAL_PUSH", "HORIZONTAL_PULL", "VERTICAL_PULL", "SQUAT", "HINGE", "LUNGE", "CHEST_FLY", "SHOULDER_ABDUCTION", "SHOULDER_FLEXION", "SHOULDER_HORIZONTAL_ABDUCTION", "SHOULDER_EXTENSION", "SCAPULAR_ELEVATION", "ELBOW_FLEXION", "ELBOW_EXTENSION", "KNEE_EXTENSION", "KNEE_FLEXION", "HIP_EXTENSION", "PLANTAR_FLEXION", "CORE_FLEXION", "CORE_ROTATION", "CORE_STABILITY"];
|
|
808
|
+
type MovementPattern = (typeof MOVEMENT_PATTERNS)[number];
|
|
809
|
+
declare const EXERCISE_MECHANICS: readonly ["COMPOUND", "ISOLATION"];
|
|
810
|
+
type ExerciseMechanic = (typeof EXERCISE_MECHANICS)[number];
|
|
811
|
+
/**
|
|
812
|
+
* Closed, lowercase vocabulary for what an exercise needs. Lowercase so it can
|
|
813
|
+
* be compared with the free-text equipment users list on a training location
|
|
814
|
+
* (PREF-01), which is normalized to lowercase.
|
|
815
|
+
*/
|
|
816
|
+
declare const EXERCISE_EQUIPMENT: readonly ["barbell", "ez-bar", "dumbbell", "cable", "machine", "smith-machine", "bench", "incline-bench", "preacher-bench", "rack", "pull-up-bar", "dip-station", "bodyweight"];
|
|
817
|
+
type ExerciseEquipment = (typeof EXERCISE_EQUIPMENT)[number];
|
|
754
818
|
interface Exercise {
|
|
755
819
|
id: string;
|
|
756
820
|
name: string;
|
|
757
821
|
primaryMuscles: MuscleGroup[];
|
|
758
822
|
secondaryMuscles: MuscleGroup[];
|
|
823
|
+
/** The primary implement, kept for existing displays. */
|
|
759
824
|
equipment: string;
|
|
825
|
+
/** Null only for entries without catalog metadata (e.g. future custom exercises). */
|
|
826
|
+
movementPattern: MovementPattern | null;
|
|
827
|
+
mechanic: ExerciseMechanic | null;
|
|
828
|
+
/** Everything needed to perform the exercise, from `EXERCISE_EQUIPMENT`. */
|
|
829
|
+
equipmentRequired: ExerciseEquipment[];
|
|
830
|
+
/** Near-identical exercises share a group and can replace each other. */
|
|
831
|
+
substitutionGroup: string | null;
|
|
832
|
+
/** Ordered cues; empty until the content work in EXER-03 lands. */
|
|
833
|
+
instructions: string[];
|
|
834
|
+
/** Demonstration asset; null until EXER-04 supplies licensed media. */
|
|
835
|
+
mediaUrl: string | null;
|
|
760
836
|
createdAt: IsoDateString;
|
|
761
837
|
updatedAt: IsoDateString;
|
|
762
838
|
}
|
|
@@ -825,4 +901,4 @@ interface CreateRoutineRequest {
|
|
|
825
901
|
}
|
|
826
902
|
type UpdateRoutineRequest = Partial<CreateRoutineRequest>;
|
|
827
903
|
|
|
828
|
-
export { type Brand, type CreateRoutineDayInput, type CreateRoutineExerciseInput, type CreateRoutineRequest, type EarnedPersonalRecord, type Exercise, type ExerciseId, type ExercisePerformanceHistoryQuery, type ExercisePerformanceHistoryResponse, type ExercisePerformancePrescription, type ExercisePerformancePrescriptionSet, type ExercisePerformanceSession, type ExercisePerformanceSet, type ExercisePerformanceSummary, type ExerciseStrengthSummary, type ExerciseStrengthTrendPoint, type ExerciseStrengthTrendQuery, type ExerciseStrengthTrendResponse, FOLLOW_SUGGESTIONS_DEFAULT_LIMIT, FOLLOW_SUGGESTIONS_MAX_LIMIT, FOLLOW_SUGGESTION_REASONS, type FinishStatus, type FinishWorkoutRequest, type FinishWorkoutResponse, type FollowSuggestion, type FollowSuggestionReason, type FollowSuggestionsResponse, type IsoDateString, type ListSessionsParams, MUSCLE_GROUPS, type MuscleGroup, type MuscleGroupHeatmapQuery, type MuscleGroupHeatmapResponse, type MuscleGroupHeatmapValue, type MuscleGroupHeatmapWeek, type MuscleVolumeTrendSeries, PREFERRED_TRAINING_STYLE_VALUES, PROFILE_BIO_MAX_LENGTH, PROFILE_FAVORITE_EXERCISES_MAX, PROFILE_LOCATION_MAX_LENGTH, PROFILE_TRAINING_DISCIPLINES_MAX, PROFILE_TRAINING_GOALS_MAX, PROFILE_VISIBILITY_VALUES, PROGRESSION_SCHEMES, PROGRESS_TIMELINE_EVENT_TYPES, type PaginatedResponse, type PersonalRecordEntry, type PersonalRecordKind, type PlatePairInventory, type PreferredTrainingStyle, type PreviousPerformanceResponse, type PreviousSessionRecap, type PreviousSetPerformance, type ProfileDiscoverySettings, type ProfileFavoriteExercise, type ProfilePrivacySettings, type ProfileViewerAccess, type ProfileVisibility, type ProgressTimelineEventType, type ProgressTimelineItem, type ProgressTimelinePersonalRecordItem, type ProgressTimelineProgressionItem, type ProgressTimelineQuery, type ProgressTimelineRecordPerformance, type ProgressTimelineRecordReason, type ProgressTimelineResponse, type ProgressTimelineSessionContext, type ProgressionChange, type ProgressionRule, type ProgressionScheme, type ProgressionSetChange, type PublicBodyMetrics, type PublicTrainingSummary, type PublicUserProfile, RELATIONSHIP_LIST_DEFAULT_LIMIT, RELATIONSHIP_LIST_KINDS, RELATIONSHIP_LIST_MAX_LIMIT, REP_TYPES, RESERVED_USERNAMES, type RecentActivityEntry, type RelationshipListKind, type RelationshipListQuery, type RelationshipListResponse, type RelationshipMember, type RepType, type ReplaceTrainingLocationsRequest, type Routine, type RoutineDay, type RoutineDayId, type RoutineExercise, type RoutineId, type RoutineSet, SEXES, type SessionComparisonExercise, type SessionComparisonQuery, type SessionComparisonResponse, type SessionComparisonRoutineDay, type SessionComparisonSession, type SessionComparisonSet, type SessionRecapRecord, type SetAccountTimeZoneRequest, type SetLog, type Sex, type StartWorkoutRequest, type StartWorkoutResponse, type SupabaseAuthResponse, type SupabaseAuthUser, type SupabaseMigrationResponse, TRAINING_DISCIPLINE_VALUES, TRAINING_EVENT_TYPES, TRAINING_EXPERIENCE_LEVEL_VALUES, TRAINING_GOAL_VALUES, type TrainingDiscipline, type TrainingEventType, type TrainingExperienceLevel, type TrainingGoal, type TrainingIdentity, type TrainingLocationPreference, type TrainingLocationPreferenceInput, USERNAME_MAX_LENGTH, USERNAME_MIN_LENGTH, USERNAME_PATTERN_SOURCE, type UpdateProfileDiscoveryRequest, type UpdateProfilePrivacyRequest, type UpdateProfileRequest, type UpdateRoutineRequest, type UpsertSetLogRequest, type UpsertSetLogResponse, type UserId, type UserProfile, type UserSearchResponse, type VolumeTrendPoint, type VolumeTrendQuery, type VolumeTrendResponse, type VolumeTrendSeries, 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 };
|
|
904
|
+
export { type Brand, type CreateRoutineDayInput, type CreateRoutineExerciseInput, type CreateRoutineRequest, type CreateSessionShareRequest, EXERCISE_EQUIPMENT, EXERCISE_MECHANICS, type EarnedPersonalRecord, type Exercise, type ExerciseEquipment, type ExerciseId, type ExerciseMechanic, type ExercisePerformanceHistoryQuery, type ExercisePerformanceHistoryResponse, type ExercisePerformancePrescription, type ExercisePerformancePrescriptionSet, type ExercisePerformanceSession, type ExercisePerformanceSet, type ExercisePerformanceSummary, type ExerciseStrengthSummary, type ExerciseStrengthTrendPoint, type ExerciseStrengthTrendQuery, type ExerciseStrengthTrendResponse, FOLLOW_SUGGESTIONS_DEFAULT_LIMIT, FOLLOW_SUGGESTIONS_MAX_LIMIT, FOLLOW_SUGGESTION_REASONS, type FinishStatus, type FinishWorkoutRequest, type FinishWorkoutResponse, type FollowSuggestion, type FollowSuggestionReason, type FollowSuggestionsResponse, type IsoDateString, type ListSessionsParams, MOVEMENT_PATTERNS, MUSCLE_GROUPS, type MovementPattern, type MuscleGroup, type MuscleGroupHeatmapQuery, type MuscleGroupHeatmapResponse, type MuscleGroupHeatmapValue, type MuscleGroupHeatmapWeek, type MuscleVolumeTrendSeries, PREFERRED_TRAINING_STYLE_VALUES, PROFILE_BIO_MAX_LENGTH, PROFILE_FAVORITE_EXERCISES_MAX, PROFILE_LOCATION_MAX_LENGTH, PROFILE_TRAINING_DISCIPLINES_MAX, PROFILE_TRAINING_GOALS_MAX, PROFILE_VISIBILITY_VALUES, PROGRESSION_SCHEMES, PROGRESS_TIMELINE_EVENT_TYPES, type PaginatedResponse, type PersonalRecordEntry, type PersonalRecordKind, type PlatePairInventory, type PreferredTrainingStyle, type PreviousPerformanceResponse, type PreviousSessionRecap, type PreviousSetPerformance, type ProfileDiscoverySettings, type ProfileFavoriteExercise, type ProfilePrivacySettings, type ProfileViewerAccess, type ProfileVisibility, type ProgressTimelineEventType, type ProgressTimelineItem, type ProgressTimelinePersonalRecordItem, type ProgressTimelineProgressionItem, type ProgressTimelineQuery, type ProgressTimelineRecordPerformance, type ProgressTimelineRecordReason, type ProgressTimelineResponse, type ProgressTimelineSessionContext, type ProgressionChange, type ProgressionRule, type ProgressionScheme, type ProgressionSetChange, type PublicBodyMetrics, type PublicTrainingSummary, type PublicUserProfile, RELATIONSHIP_LIST_DEFAULT_LIMIT, RELATIONSHIP_LIST_KINDS, RELATIONSHIP_LIST_MAX_LIMIT, REP_TYPES, RESERVED_USERNAMES, type RecentActivityEntry, type RelationshipListKind, type RelationshipListQuery, type RelationshipListResponse, type RelationshipMember, type RepType, type ReplaceTrainingLocationsRequest, type Routine, type RoutineDay, type RoutineDayId, type RoutineExercise, type RoutineId, type RoutineSet, SESSION_SHARE_DEFAULT_FIELDS, SESSION_SHARE_FIELDS, SESSION_SHARE_MAX_ACTIVE_LINKS, SEXES, type SessionComparisonExercise, type SessionComparisonQuery, type SessionComparisonResponse, type SessionComparisonRoutineDay, type SessionComparisonSession, type SessionComparisonSet, type SessionRecapRecord, type SessionShare, type SessionShareField, type SessionShareListResponse, type SetAccountTimeZoneRequest, type SetLog, type Sex, type SharedSessionOwner, type SharedSessionRecap, type StartWorkoutRequest, type StartWorkoutResponse, type SupabaseAuthResponse, type SupabaseAuthUser, type SupabaseMigrationResponse, TRAINING_DISCIPLINE_VALUES, TRAINING_EVENT_TYPES, TRAINING_EXPERIENCE_LEVEL_VALUES, TRAINING_GOAL_VALUES, type TrainingDiscipline, type TrainingEventType, type TrainingExperienceLevel, type TrainingGoal, type TrainingIdentity, type TrainingLocationPreference, type TrainingLocationPreferenceInput, USERNAME_MAX_LENGTH, USERNAME_MIN_LENGTH, USERNAME_PATTERN_SOURCE, type UpdateProfileDiscoveryRequest, type UpdateProfilePrivacyRequest, type UpdateProfileRequest, type UpdateRoutineRequest, type UpsertSetLogRequest, type UpsertSetLogResponse, type UserId, type UserProfile, type UserSearchResponse, type VolumeTrendPoint, type VolumeTrendQuery, type VolumeTrendResponse, type VolumeTrendSeries, 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
|
@@ -201,6 +201,54 @@ interface WorkoutSessionRecap {
|
|
|
201
201
|
progressionChanges: ProgressionChange[];
|
|
202
202
|
previousSession: PreviousSessionRecap | null;
|
|
203
203
|
}
|
|
204
|
+
/** Parts of a completed session's recap the owner may choose to share. */
|
|
205
|
+
declare const SESSION_SHARE_FIELDS: readonly ["duration", "volume", "completedSets", "records", "progression", "notes"];
|
|
206
|
+
type SessionShareField = (typeof SESSION_SHARE_FIELDS)[number];
|
|
207
|
+
/** Pre-selected when creating a link; notes and prescriptions are opt-in. */
|
|
208
|
+
declare const SESSION_SHARE_DEFAULT_FIELDS: SessionShareField[];
|
|
209
|
+
declare const SESSION_SHARE_MAX_ACTIVE_LINKS = 10;
|
|
210
|
+
interface CreateSessionShareRequest {
|
|
211
|
+
fields: SessionShareField[];
|
|
212
|
+
}
|
|
213
|
+
/** An active share link, visible only to the session owner. */
|
|
214
|
+
interface SessionShare {
|
|
215
|
+
id: string;
|
|
216
|
+
sessionId: string;
|
|
217
|
+
/** Unguessable identifier used in the public `/shared/sessions/:token` URL. */
|
|
218
|
+
token: string;
|
|
219
|
+
fields: SessionShareField[];
|
|
220
|
+
createdAt: IsoDateString;
|
|
221
|
+
}
|
|
222
|
+
/** Stable successful response of GET /workouts/sessions/:id/shares. */
|
|
223
|
+
interface SessionShareListResponse {
|
|
224
|
+
items: SessionShare[];
|
|
225
|
+
}
|
|
226
|
+
interface SharedSessionOwner {
|
|
227
|
+
username: string;
|
|
228
|
+
name: string;
|
|
229
|
+
lastName?: string | null;
|
|
230
|
+
avatarUrl?: string | null;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Stable successful response of the unauthenticated
|
|
234
|
+
* GET /shared/sessions/:token. Only the fields named in `fields` are present;
|
|
235
|
+
* everything else is omitted rather than nulled. Weights are canonical kg and
|
|
236
|
+
* `weightUnit` is the owner's display preference.
|
|
237
|
+
*/
|
|
238
|
+
interface SharedSessionRecap {
|
|
239
|
+
fields: SessionShareField[];
|
|
240
|
+
owner: SharedSessionOwner;
|
|
241
|
+
weightUnit: WeightUnit;
|
|
242
|
+
routineName: string;
|
|
243
|
+
dayName?: string | null;
|
|
244
|
+
endedAt: IsoDateString;
|
|
245
|
+
durationSec?: number;
|
|
246
|
+
totalVolumeKg?: number;
|
|
247
|
+
completedSets?: number;
|
|
248
|
+
records?: SessionRecapRecord[];
|
|
249
|
+
progressionChanges?: ProgressionChange[];
|
|
250
|
+
notes?: string | null;
|
|
251
|
+
}
|
|
204
252
|
interface WorkoutSessionSummary {
|
|
205
253
|
id: string;
|
|
206
254
|
status: WorkoutSessionStatus;
|
|
@@ -751,12 +799,40 @@ interface SupabaseMigrationResponse {
|
|
|
751
799
|
email: string;
|
|
752
800
|
}
|
|
753
801
|
|
|
802
|
+
/**
|
|
803
|
+
* How an exercise moves (EXER-09). Compound patterns first, then the
|
|
804
|
+
* single-joint actions the catalog uses. Alternatives start from this plus
|
|
805
|
+
* primary muscles; `substitutionGroup` is the narrower, near-identical set.
|
|
806
|
+
*/
|
|
807
|
+
declare const MOVEMENT_PATTERNS: readonly ["HORIZONTAL_PUSH", "VERTICAL_PUSH", "HORIZONTAL_PULL", "VERTICAL_PULL", "SQUAT", "HINGE", "LUNGE", "CHEST_FLY", "SHOULDER_ABDUCTION", "SHOULDER_FLEXION", "SHOULDER_HORIZONTAL_ABDUCTION", "SHOULDER_EXTENSION", "SCAPULAR_ELEVATION", "ELBOW_FLEXION", "ELBOW_EXTENSION", "KNEE_EXTENSION", "KNEE_FLEXION", "HIP_EXTENSION", "PLANTAR_FLEXION", "CORE_FLEXION", "CORE_ROTATION", "CORE_STABILITY"];
|
|
808
|
+
type MovementPattern = (typeof MOVEMENT_PATTERNS)[number];
|
|
809
|
+
declare const EXERCISE_MECHANICS: readonly ["COMPOUND", "ISOLATION"];
|
|
810
|
+
type ExerciseMechanic = (typeof EXERCISE_MECHANICS)[number];
|
|
811
|
+
/**
|
|
812
|
+
* Closed, lowercase vocabulary for what an exercise needs. Lowercase so it can
|
|
813
|
+
* be compared with the free-text equipment users list on a training location
|
|
814
|
+
* (PREF-01), which is normalized to lowercase.
|
|
815
|
+
*/
|
|
816
|
+
declare const EXERCISE_EQUIPMENT: readonly ["barbell", "ez-bar", "dumbbell", "cable", "machine", "smith-machine", "bench", "incline-bench", "preacher-bench", "rack", "pull-up-bar", "dip-station", "bodyweight"];
|
|
817
|
+
type ExerciseEquipment = (typeof EXERCISE_EQUIPMENT)[number];
|
|
754
818
|
interface Exercise {
|
|
755
819
|
id: string;
|
|
756
820
|
name: string;
|
|
757
821
|
primaryMuscles: MuscleGroup[];
|
|
758
822
|
secondaryMuscles: MuscleGroup[];
|
|
823
|
+
/** The primary implement, kept for existing displays. */
|
|
759
824
|
equipment: string;
|
|
825
|
+
/** Null only for entries without catalog metadata (e.g. future custom exercises). */
|
|
826
|
+
movementPattern: MovementPattern | null;
|
|
827
|
+
mechanic: ExerciseMechanic | null;
|
|
828
|
+
/** Everything needed to perform the exercise, from `EXERCISE_EQUIPMENT`. */
|
|
829
|
+
equipmentRequired: ExerciseEquipment[];
|
|
830
|
+
/** Near-identical exercises share a group and can replace each other. */
|
|
831
|
+
substitutionGroup: string | null;
|
|
832
|
+
/** Ordered cues; empty until the content work in EXER-03 lands. */
|
|
833
|
+
instructions: string[];
|
|
834
|
+
/** Demonstration asset; null until EXER-04 supplies licensed media. */
|
|
835
|
+
mediaUrl: string | null;
|
|
760
836
|
createdAt: IsoDateString;
|
|
761
837
|
updatedAt: IsoDateString;
|
|
762
838
|
}
|
|
@@ -825,4 +901,4 @@ interface CreateRoutineRequest {
|
|
|
825
901
|
}
|
|
826
902
|
type UpdateRoutineRequest = Partial<CreateRoutineRequest>;
|
|
827
903
|
|
|
828
|
-
export { type Brand, type CreateRoutineDayInput, type CreateRoutineExerciseInput, type CreateRoutineRequest, type EarnedPersonalRecord, type Exercise, type ExerciseId, type ExercisePerformanceHistoryQuery, type ExercisePerformanceHistoryResponse, type ExercisePerformancePrescription, type ExercisePerformancePrescriptionSet, type ExercisePerformanceSession, type ExercisePerformanceSet, type ExercisePerformanceSummary, type ExerciseStrengthSummary, type ExerciseStrengthTrendPoint, type ExerciseStrengthTrendQuery, type ExerciseStrengthTrendResponse, FOLLOW_SUGGESTIONS_DEFAULT_LIMIT, FOLLOW_SUGGESTIONS_MAX_LIMIT, FOLLOW_SUGGESTION_REASONS, type FinishStatus, type FinishWorkoutRequest, type FinishWorkoutResponse, type FollowSuggestion, type FollowSuggestionReason, type FollowSuggestionsResponse, type IsoDateString, type ListSessionsParams, MUSCLE_GROUPS, type MuscleGroup, type MuscleGroupHeatmapQuery, type MuscleGroupHeatmapResponse, type MuscleGroupHeatmapValue, type MuscleGroupHeatmapWeek, type MuscleVolumeTrendSeries, PREFERRED_TRAINING_STYLE_VALUES, PROFILE_BIO_MAX_LENGTH, PROFILE_FAVORITE_EXERCISES_MAX, PROFILE_LOCATION_MAX_LENGTH, PROFILE_TRAINING_DISCIPLINES_MAX, PROFILE_TRAINING_GOALS_MAX, PROFILE_VISIBILITY_VALUES, PROGRESSION_SCHEMES, PROGRESS_TIMELINE_EVENT_TYPES, type PaginatedResponse, type PersonalRecordEntry, type PersonalRecordKind, type PlatePairInventory, type PreferredTrainingStyle, type PreviousPerformanceResponse, type PreviousSessionRecap, type PreviousSetPerformance, type ProfileDiscoverySettings, type ProfileFavoriteExercise, type ProfilePrivacySettings, type ProfileViewerAccess, type ProfileVisibility, type ProgressTimelineEventType, type ProgressTimelineItem, type ProgressTimelinePersonalRecordItem, type ProgressTimelineProgressionItem, type ProgressTimelineQuery, type ProgressTimelineRecordPerformance, type ProgressTimelineRecordReason, type ProgressTimelineResponse, type ProgressTimelineSessionContext, type ProgressionChange, type ProgressionRule, type ProgressionScheme, type ProgressionSetChange, type PublicBodyMetrics, type PublicTrainingSummary, type PublicUserProfile, RELATIONSHIP_LIST_DEFAULT_LIMIT, RELATIONSHIP_LIST_KINDS, RELATIONSHIP_LIST_MAX_LIMIT, REP_TYPES, RESERVED_USERNAMES, type RecentActivityEntry, type RelationshipListKind, type RelationshipListQuery, type RelationshipListResponse, type RelationshipMember, type RepType, type ReplaceTrainingLocationsRequest, type Routine, type RoutineDay, type RoutineDayId, type RoutineExercise, type RoutineId, type RoutineSet, SEXES, type SessionComparisonExercise, type SessionComparisonQuery, type SessionComparisonResponse, type SessionComparisonRoutineDay, type SessionComparisonSession, type SessionComparisonSet, type SessionRecapRecord, type SetAccountTimeZoneRequest, type SetLog, type Sex, type StartWorkoutRequest, type StartWorkoutResponse, type SupabaseAuthResponse, type SupabaseAuthUser, type SupabaseMigrationResponse, TRAINING_DISCIPLINE_VALUES, TRAINING_EVENT_TYPES, TRAINING_EXPERIENCE_LEVEL_VALUES, TRAINING_GOAL_VALUES, type TrainingDiscipline, type TrainingEventType, type TrainingExperienceLevel, type TrainingGoal, type TrainingIdentity, type TrainingLocationPreference, type TrainingLocationPreferenceInput, USERNAME_MAX_LENGTH, USERNAME_MIN_LENGTH, USERNAME_PATTERN_SOURCE, type UpdateProfileDiscoveryRequest, type UpdateProfilePrivacyRequest, type UpdateProfileRequest, type UpdateRoutineRequest, type UpsertSetLogRequest, type UpsertSetLogResponse, type UserId, type UserProfile, type UserSearchResponse, type VolumeTrendPoint, type VolumeTrendQuery, type VolumeTrendResponse, type VolumeTrendSeries, 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 };
|
|
904
|
+
export { type Brand, type CreateRoutineDayInput, type CreateRoutineExerciseInput, type CreateRoutineRequest, type CreateSessionShareRequest, EXERCISE_EQUIPMENT, EXERCISE_MECHANICS, type EarnedPersonalRecord, type Exercise, type ExerciseEquipment, type ExerciseId, type ExerciseMechanic, type ExercisePerformanceHistoryQuery, type ExercisePerformanceHistoryResponse, type ExercisePerformancePrescription, type ExercisePerformancePrescriptionSet, type ExercisePerformanceSession, type ExercisePerformanceSet, type ExercisePerformanceSummary, type ExerciseStrengthSummary, type ExerciseStrengthTrendPoint, type ExerciseStrengthTrendQuery, type ExerciseStrengthTrendResponse, FOLLOW_SUGGESTIONS_DEFAULT_LIMIT, FOLLOW_SUGGESTIONS_MAX_LIMIT, FOLLOW_SUGGESTION_REASONS, type FinishStatus, type FinishWorkoutRequest, type FinishWorkoutResponse, type FollowSuggestion, type FollowSuggestionReason, type FollowSuggestionsResponse, type IsoDateString, type ListSessionsParams, MOVEMENT_PATTERNS, MUSCLE_GROUPS, type MovementPattern, type MuscleGroup, type MuscleGroupHeatmapQuery, type MuscleGroupHeatmapResponse, type MuscleGroupHeatmapValue, type MuscleGroupHeatmapWeek, type MuscleVolumeTrendSeries, PREFERRED_TRAINING_STYLE_VALUES, PROFILE_BIO_MAX_LENGTH, PROFILE_FAVORITE_EXERCISES_MAX, PROFILE_LOCATION_MAX_LENGTH, PROFILE_TRAINING_DISCIPLINES_MAX, PROFILE_TRAINING_GOALS_MAX, PROFILE_VISIBILITY_VALUES, PROGRESSION_SCHEMES, PROGRESS_TIMELINE_EVENT_TYPES, type PaginatedResponse, type PersonalRecordEntry, type PersonalRecordKind, type PlatePairInventory, type PreferredTrainingStyle, type PreviousPerformanceResponse, type PreviousSessionRecap, type PreviousSetPerformance, type ProfileDiscoverySettings, type ProfileFavoriteExercise, type ProfilePrivacySettings, type ProfileViewerAccess, type ProfileVisibility, type ProgressTimelineEventType, type ProgressTimelineItem, type ProgressTimelinePersonalRecordItem, type ProgressTimelineProgressionItem, type ProgressTimelineQuery, type ProgressTimelineRecordPerformance, type ProgressTimelineRecordReason, type ProgressTimelineResponse, type ProgressTimelineSessionContext, type ProgressionChange, type ProgressionRule, type ProgressionScheme, type ProgressionSetChange, type PublicBodyMetrics, type PublicTrainingSummary, type PublicUserProfile, RELATIONSHIP_LIST_DEFAULT_LIMIT, RELATIONSHIP_LIST_KINDS, RELATIONSHIP_LIST_MAX_LIMIT, REP_TYPES, RESERVED_USERNAMES, type RecentActivityEntry, type RelationshipListKind, type RelationshipListQuery, type RelationshipListResponse, type RelationshipMember, type RepType, type ReplaceTrainingLocationsRequest, type Routine, type RoutineDay, type RoutineDayId, type RoutineExercise, type RoutineId, type RoutineSet, SESSION_SHARE_DEFAULT_FIELDS, SESSION_SHARE_FIELDS, SESSION_SHARE_MAX_ACTIVE_LINKS, SEXES, type SessionComparisonExercise, type SessionComparisonQuery, type SessionComparisonResponse, type SessionComparisonRoutineDay, type SessionComparisonSession, type SessionComparisonSet, type SessionRecapRecord, type SessionShare, type SessionShareField, type SessionShareListResponse, type SetAccountTimeZoneRequest, type SetLog, type Sex, type SharedSessionOwner, type SharedSessionRecap, type StartWorkoutRequest, type StartWorkoutResponse, type SupabaseAuthResponse, type SupabaseAuthUser, type SupabaseMigrationResponse, TRAINING_DISCIPLINE_VALUES, TRAINING_EVENT_TYPES, TRAINING_EXPERIENCE_LEVEL_VALUES, TRAINING_GOAL_VALUES, type TrainingDiscipline, type TrainingEventType, type TrainingExperienceLevel, type TrainingGoal, type TrainingIdentity, type TrainingLocationPreference, type TrainingLocationPreferenceInput, USERNAME_MAX_LENGTH, USERNAME_MIN_LENGTH, USERNAME_PATTERN_SOURCE, type UpdateProfileDiscoveryRequest, type UpdateProfilePrivacyRequest, type UpdateProfileRequest, type UpdateRoutineRequest, type UpsertSetLogRequest, type UpsertSetLogResponse, type UserId, type UserProfile, type UserSearchResponse, type VolumeTrendPoint, type VolumeTrendQuery, type VolumeTrendResponse, type VolumeTrendSeries, 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
|
@@ -122,6 +122,65 @@ var FOLLOW_SUGGESTION_REASONS = [
|
|
|
122
122
|
"FOLLOWED_BY_PEOPLE_YOU_FOLLOW"
|
|
123
123
|
];
|
|
124
124
|
|
|
125
|
+
// src/exercise.ts
|
|
126
|
+
var MOVEMENT_PATTERNS = [
|
|
127
|
+
"HORIZONTAL_PUSH",
|
|
128
|
+
"VERTICAL_PUSH",
|
|
129
|
+
"HORIZONTAL_PULL",
|
|
130
|
+
"VERTICAL_PULL",
|
|
131
|
+
"SQUAT",
|
|
132
|
+
"HINGE",
|
|
133
|
+
"LUNGE",
|
|
134
|
+
"CHEST_FLY",
|
|
135
|
+
"SHOULDER_ABDUCTION",
|
|
136
|
+
"SHOULDER_FLEXION",
|
|
137
|
+
"SHOULDER_HORIZONTAL_ABDUCTION",
|
|
138
|
+
"SHOULDER_EXTENSION",
|
|
139
|
+
"SCAPULAR_ELEVATION",
|
|
140
|
+
"ELBOW_FLEXION",
|
|
141
|
+
"ELBOW_EXTENSION",
|
|
142
|
+
"KNEE_EXTENSION",
|
|
143
|
+
"KNEE_FLEXION",
|
|
144
|
+
"HIP_EXTENSION",
|
|
145
|
+
"PLANTAR_FLEXION",
|
|
146
|
+
"CORE_FLEXION",
|
|
147
|
+
"CORE_ROTATION",
|
|
148
|
+
"CORE_STABILITY"
|
|
149
|
+
];
|
|
150
|
+
var EXERCISE_MECHANICS = ["COMPOUND", "ISOLATION"];
|
|
151
|
+
var EXERCISE_EQUIPMENT = [
|
|
152
|
+
"barbell",
|
|
153
|
+
"ez-bar",
|
|
154
|
+
"dumbbell",
|
|
155
|
+
"cable",
|
|
156
|
+
"machine",
|
|
157
|
+
"smith-machine",
|
|
158
|
+
"bench",
|
|
159
|
+
"incline-bench",
|
|
160
|
+
"preacher-bench",
|
|
161
|
+
"rack",
|
|
162
|
+
"pull-up-bar",
|
|
163
|
+
"dip-station",
|
|
164
|
+
"bodyweight"
|
|
165
|
+
];
|
|
166
|
+
|
|
167
|
+
// src/workout.ts
|
|
168
|
+
var SESSION_SHARE_FIELDS = [
|
|
169
|
+
"duration",
|
|
170
|
+
"volume",
|
|
171
|
+
"completedSets",
|
|
172
|
+
"records",
|
|
173
|
+
"progression",
|
|
174
|
+
"notes"
|
|
175
|
+
];
|
|
176
|
+
var SESSION_SHARE_DEFAULT_FIELDS = [
|
|
177
|
+
"duration",
|
|
178
|
+
"volume",
|
|
179
|
+
"completedSets",
|
|
180
|
+
"records"
|
|
181
|
+
];
|
|
182
|
+
var SESSION_SHARE_MAX_ACTIVE_LINKS = 10;
|
|
183
|
+
|
|
125
184
|
// src/analytics.ts
|
|
126
185
|
var TRAINING_EVENT_TYPES = [
|
|
127
186
|
"SESSION_COMPLETED",
|
|
@@ -133,9 +192,12 @@ var PROGRESS_TIMELINE_EVENT_TYPES = [
|
|
|
133
192
|
"PROGRESSION_CHANGED"
|
|
134
193
|
];
|
|
135
194
|
export {
|
|
195
|
+
EXERCISE_EQUIPMENT,
|
|
196
|
+
EXERCISE_MECHANICS,
|
|
136
197
|
FOLLOW_SUGGESTIONS_DEFAULT_LIMIT,
|
|
137
198
|
FOLLOW_SUGGESTIONS_MAX_LIMIT,
|
|
138
199
|
FOLLOW_SUGGESTION_REASONS,
|
|
200
|
+
MOVEMENT_PATTERNS,
|
|
139
201
|
MUSCLE_GROUPS,
|
|
140
202
|
PREFERRED_TRAINING_STYLE_VALUES,
|
|
141
203
|
PROFILE_BIO_MAX_LENGTH,
|
|
@@ -151,6 +213,9 @@ export {
|
|
|
151
213
|
RELATIONSHIP_LIST_MAX_LIMIT,
|
|
152
214
|
REP_TYPES,
|
|
153
215
|
RESERVED_USERNAMES,
|
|
216
|
+
SESSION_SHARE_DEFAULT_FIELDS,
|
|
217
|
+
SESSION_SHARE_FIELDS,
|
|
218
|
+
SESSION_SHARE_MAX_ACTIVE_LINKS,
|
|
154
219
|
SEXES,
|
|
155
220
|
TRAINING_DISCIPLINE_VALUES,
|
|
156
221
|
TRAINING_EVENT_TYPES,
|