@sunsteel/contracts 0.23.0 → 0.25.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 +48 -0
- package/dist/index.d.cts +91 -1
- package/dist/index.d.ts +91 -1
- package/dist/index.js +39 -0
- package/package.json +40 -40
package/dist/index.cjs
CHANGED
|
@@ -20,6 +20,9 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/index.ts
|
|
21
21
|
var index_exports = {};
|
|
22
22
|
__export(index_exports, {
|
|
23
|
+
FOLLOW_SUGGESTIONS_DEFAULT_LIMIT: () => FOLLOW_SUGGESTIONS_DEFAULT_LIMIT,
|
|
24
|
+
FOLLOW_SUGGESTIONS_MAX_LIMIT: () => FOLLOW_SUGGESTIONS_MAX_LIMIT,
|
|
25
|
+
FOLLOW_SUGGESTION_REASONS: () => FOLLOW_SUGGESTION_REASONS,
|
|
23
26
|
MUSCLE_GROUPS: () => MUSCLE_GROUPS,
|
|
24
27
|
PREFERRED_TRAINING_STYLE_VALUES: () => PREFERRED_TRAINING_STYLE_VALUES,
|
|
25
28
|
PROFILE_BIO_MAX_LENGTH: () => PROFILE_BIO_MAX_LENGTH,
|
|
@@ -30,8 +33,14 @@ __export(index_exports, {
|
|
|
30
33
|
PROFILE_VISIBILITY_VALUES: () => PROFILE_VISIBILITY_VALUES,
|
|
31
34
|
PROGRESSION_SCHEMES: () => PROGRESSION_SCHEMES,
|
|
32
35
|
PROGRESS_TIMELINE_EVENT_TYPES: () => PROGRESS_TIMELINE_EVENT_TYPES,
|
|
36
|
+
RELATIONSHIP_LIST_DEFAULT_LIMIT: () => RELATIONSHIP_LIST_DEFAULT_LIMIT,
|
|
37
|
+
RELATIONSHIP_LIST_KINDS: () => RELATIONSHIP_LIST_KINDS,
|
|
38
|
+
RELATIONSHIP_LIST_MAX_LIMIT: () => RELATIONSHIP_LIST_MAX_LIMIT,
|
|
33
39
|
REP_TYPES: () => REP_TYPES,
|
|
34
40
|
RESERVED_USERNAMES: () => RESERVED_USERNAMES,
|
|
41
|
+
SESSION_SHARE_DEFAULT_FIELDS: () => SESSION_SHARE_DEFAULT_FIELDS,
|
|
42
|
+
SESSION_SHARE_FIELDS: () => SESSION_SHARE_FIELDS,
|
|
43
|
+
SESSION_SHARE_MAX_ACTIVE_LINKS: () => SESSION_SHARE_MAX_ACTIVE_LINKS,
|
|
35
44
|
SEXES: () => SEXES,
|
|
36
45
|
TRAINING_DISCIPLINE_VALUES: () => TRAINING_DISCIPLINE_VALUES,
|
|
37
46
|
TRAINING_EVENT_TYPES: () => TRAINING_EVENT_TYPES,
|
|
@@ -155,6 +164,36 @@ var PREFERRED_TRAINING_STYLE_VALUES = [
|
|
|
155
164
|
"BODY_PART_SPLIT",
|
|
156
165
|
"CIRCUIT"
|
|
157
166
|
];
|
|
167
|
+
var RELATIONSHIP_LIST_KINDS = [
|
|
168
|
+
"followers",
|
|
169
|
+
"following",
|
|
170
|
+
"mutuals"
|
|
171
|
+
];
|
|
172
|
+
var RELATIONSHIP_LIST_DEFAULT_LIMIT = 20;
|
|
173
|
+
var RELATIONSHIP_LIST_MAX_LIMIT = 50;
|
|
174
|
+
var FOLLOW_SUGGESTIONS_DEFAULT_LIMIT = 10;
|
|
175
|
+
var FOLLOW_SUGGESTIONS_MAX_LIMIT = 20;
|
|
176
|
+
var FOLLOW_SUGGESTION_REASONS = [
|
|
177
|
+
"FOLLOWS_YOU",
|
|
178
|
+
"FOLLOWED_BY_PEOPLE_YOU_FOLLOW"
|
|
179
|
+
];
|
|
180
|
+
|
|
181
|
+
// src/workout.ts
|
|
182
|
+
var SESSION_SHARE_FIELDS = [
|
|
183
|
+
"duration",
|
|
184
|
+
"volume",
|
|
185
|
+
"completedSets",
|
|
186
|
+
"records",
|
|
187
|
+
"progression",
|
|
188
|
+
"notes"
|
|
189
|
+
];
|
|
190
|
+
var SESSION_SHARE_DEFAULT_FIELDS = [
|
|
191
|
+
"duration",
|
|
192
|
+
"volume",
|
|
193
|
+
"completedSets",
|
|
194
|
+
"records"
|
|
195
|
+
];
|
|
196
|
+
var SESSION_SHARE_MAX_ACTIVE_LINKS = 10;
|
|
158
197
|
|
|
159
198
|
// src/analytics.ts
|
|
160
199
|
var TRAINING_EVENT_TYPES = [
|
|
@@ -168,6 +207,9 @@ var PROGRESS_TIMELINE_EVENT_TYPES = [
|
|
|
168
207
|
];
|
|
169
208
|
// Annotate the CommonJS export names for ESM import in node:
|
|
170
209
|
0 && (module.exports = {
|
|
210
|
+
FOLLOW_SUGGESTIONS_DEFAULT_LIMIT,
|
|
211
|
+
FOLLOW_SUGGESTIONS_MAX_LIMIT,
|
|
212
|
+
FOLLOW_SUGGESTION_REASONS,
|
|
171
213
|
MUSCLE_GROUPS,
|
|
172
214
|
PREFERRED_TRAINING_STYLE_VALUES,
|
|
173
215
|
PROFILE_BIO_MAX_LENGTH,
|
|
@@ -178,8 +220,14 @@ var PROGRESS_TIMELINE_EVENT_TYPES = [
|
|
|
178
220
|
PROFILE_VISIBILITY_VALUES,
|
|
179
221
|
PROGRESSION_SCHEMES,
|
|
180
222
|
PROGRESS_TIMELINE_EVENT_TYPES,
|
|
223
|
+
RELATIONSHIP_LIST_DEFAULT_LIMIT,
|
|
224
|
+
RELATIONSHIP_LIST_KINDS,
|
|
225
|
+
RELATIONSHIP_LIST_MAX_LIMIT,
|
|
181
226
|
REP_TYPES,
|
|
182
227
|
RESERVED_USERNAMES,
|
|
228
|
+
SESSION_SHARE_DEFAULT_FIELDS,
|
|
229
|
+
SESSION_SHARE_FIELDS,
|
|
230
|
+
SESSION_SHARE_MAX_ACTIVE_LINKS,
|
|
183
231
|
SEXES,
|
|
184
232
|
TRAINING_DISCIPLINE_VALUES,
|
|
185
233
|
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;
|
|
@@ -688,6 +736,48 @@ interface UserSearchResponse {
|
|
|
688
736
|
lastName?: string | null;
|
|
689
737
|
avatarUrl?: string | null;
|
|
690
738
|
}
|
|
739
|
+
/**
|
|
740
|
+
* `followers` and `following` are the profile's own relations. `mutuals` is
|
|
741
|
+
* relative to the viewer: accounts that follow the profile and that the viewer
|
|
742
|
+
* follows. On the viewer's own profile that is the set of mutual follows.
|
|
743
|
+
*/
|
|
744
|
+
declare const RELATIONSHIP_LIST_KINDS: readonly ["followers", "following", "mutuals"];
|
|
745
|
+
type RelationshipListKind = (typeof RELATIONSHIP_LIST_KINDS)[number];
|
|
746
|
+
declare const RELATIONSHIP_LIST_DEFAULT_LIMIT = 20;
|
|
747
|
+
declare const RELATIONSHIP_LIST_MAX_LIMIT = 50;
|
|
748
|
+
declare const FOLLOW_SUGGESTIONS_DEFAULT_LIMIT = 10;
|
|
749
|
+
declare const FOLLOW_SUGGESTIONS_MAX_LIMIT = 20;
|
|
750
|
+
/** A member as seen by the signed-in viewer. Never carries email. */
|
|
751
|
+
interface RelationshipMember extends UserSearchResponse {
|
|
752
|
+
isFollowedByMe: boolean;
|
|
753
|
+
followsMe: boolean;
|
|
754
|
+
}
|
|
755
|
+
interface RelationshipListQuery {
|
|
756
|
+
/** Opaque value returned as `nextCursor` by the previous page. */
|
|
757
|
+
cursor?: string;
|
|
758
|
+
limit?: number;
|
|
759
|
+
}
|
|
760
|
+
/**
|
|
761
|
+
* Stable successful response of GET /users/:identifier/followers, /following
|
|
762
|
+
* and /mutuals. Items are ordered by the date the relation was created, newest
|
|
763
|
+
* first.
|
|
764
|
+
*/
|
|
765
|
+
interface RelationshipListResponse {
|
|
766
|
+
kind: RelationshipListKind;
|
|
767
|
+
items: RelationshipMember[];
|
|
768
|
+
nextCursor?: string;
|
|
769
|
+
}
|
|
770
|
+
declare const FOLLOW_SUGGESTION_REASONS: readonly ["FOLLOWS_YOU", "FOLLOWED_BY_PEOPLE_YOU_FOLLOW"];
|
|
771
|
+
type FollowSuggestionReason = (typeof FOLLOW_SUGGESTION_REASONS)[number];
|
|
772
|
+
interface FollowSuggestion extends RelationshipMember {
|
|
773
|
+
reason: FollowSuggestionReason;
|
|
774
|
+
/** How many accounts the viewer follows also follow this member. */
|
|
775
|
+
mutualCount: number;
|
|
776
|
+
}
|
|
777
|
+
/** Stable successful response of GET /users/me/suggestions. */
|
|
778
|
+
interface FollowSuggestionsResponse {
|
|
779
|
+
items: FollowSuggestion[];
|
|
780
|
+
}
|
|
691
781
|
|
|
692
782
|
interface SupabaseAuthUser {
|
|
693
783
|
id: string;
|
|
@@ -783,4 +873,4 @@ interface CreateRoutineRequest {
|
|
|
783
873
|
}
|
|
784
874
|
type UpdateRoutineRequest = Partial<CreateRoutineRequest>;
|
|
785
875
|
|
|
786
|
-
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, type FinishStatus, type FinishWorkoutRequest, type FinishWorkoutResponse, 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, REP_TYPES, RESERVED_USERNAMES, type RecentActivityEntry, 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 };
|
|
876
|
+
export { type Brand, type CreateRoutineDayInput, type CreateRoutineExerciseInput, type CreateRoutineRequest, type CreateSessionShareRequest, 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, 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;
|
|
@@ -688,6 +736,48 @@ interface UserSearchResponse {
|
|
|
688
736
|
lastName?: string | null;
|
|
689
737
|
avatarUrl?: string | null;
|
|
690
738
|
}
|
|
739
|
+
/**
|
|
740
|
+
* `followers` and `following` are the profile's own relations. `mutuals` is
|
|
741
|
+
* relative to the viewer: accounts that follow the profile and that the viewer
|
|
742
|
+
* follows. On the viewer's own profile that is the set of mutual follows.
|
|
743
|
+
*/
|
|
744
|
+
declare const RELATIONSHIP_LIST_KINDS: readonly ["followers", "following", "mutuals"];
|
|
745
|
+
type RelationshipListKind = (typeof RELATIONSHIP_LIST_KINDS)[number];
|
|
746
|
+
declare const RELATIONSHIP_LIST_DEFAULT_LIMIT = 20;
|
|
747
|
+
declare const RELATIONSHIP_LIST_MAX_LIMIT = 50;
|
|
748
|
+
declare const FOLLOW_SUGGESTIONS_DEFAULT_LIMIT = 10;
|
|
749
|
+
declare const FOLLOW_SUGGESTIONS_MAX_LIMIT = 20;
|
|
750
|
+
/** A member as seen by the signed-in viewer. Never carries email. */
|
|
751
|
+
interface RelationshipMember extends UserSearchResponse {
|
|
752
|
+
isFollowedByMe: boolean;
|
|
753
|
+
followsMe: boolean;
|
|
754
|
+
}
|
|
755
|
+
interface RelationshipListQuery {
|
|
756
|
+
/** Opaque value returned as `nextCursor` by the previous page. */
|
|
757
|
+
cursor?: string;
|
|
758
|
+
limit?: number;
|
|
759
|
+
}
|
|
760
|
+
/**
|
|
761
|
+
* Stable successful response of GET /users/:identifier/followers, /following
|
|
762
|
+
* and /mutuals. Items are ordered by the date the relation was created, newest
|
|
763
|
+
* first.
|
|
764
|
+
*/
|
|
765
|
+
interface RelationshipListResponse {
|
|
766
|
+
kind: RelationshipListKind;
|
|
767
|
+
items: RelationshipMember[];
|
|
768
|
+
nextCursor?: string;
|
|
769
|
+
}
|
|
770
|
+
declare const FOLLOW_SUGGESTION_REASONS: readonly ["FOLLOWS_YOU", "FOLLOWED_BY_PEOPLE_YOU_FOLLOW"];
|
|
771
|
+
type FollowSuggestionReason = (typeof FOLLOW_SUGGESTION_REASONS)[number];
|
|
772
|
+
interface FollowSuggestion extends RelationshipMember {
|
|
773
|
+
reason: FollowSuggestionReason;
|
|
774
|
+
/** How many accounts the viewer follows also follow this member. */
|
|
775
|
+
mutualCount: number;
|
|
776
|
+
}
|
|
777
|
+
/** Stable successful response of GET /users/me/suggestions. */
|
|
778
|
+
interface FollowSuggestionsResponse {
|
|
779
|
+
items: FollowSuggestion[];
|
|
780
|
+
}
|
|
691
781
|
|
|
692
782
|
interface SupabaseAuthUser {
|
|
693
783
|
id: string;
|
|
@@ -783,4 +873,4 @@ interface CreateRoutineRequest {
|
|
|
783
873
|
}
|
|
784
874
|
type UpdateRoutineRequest = Partial<CreateRoutineRequest>;
|
|
785
875
|
|
|
786
|
-
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, type FinishStatus, type FinishWorkoutRequest, type FinishWorkoutResponse, 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, REP_TYPES, RESERVED_USERNAMES, type RecentActivityEntry, 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 };
|
|
876
|
+
export { type Brand, type CreateRoutineDayInput, type CreateRoutineExerciseInput, type CreateRoutineRequest, type CreateSessionShareRequest, 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, 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
|
@@ -108,6 +108,36 @@ var PREFERRED_TRAINING_STYLE_VALUES = [
|
|
|
108
108
|
"BODY_PART_SPLIT",
|
|
109
109
|
"CIRCUIT"
|
|
110
110
|
];
|
|
111
|
+
var RELATIONSHIP_LIST_KINDS = [
|
|
112
|
+
"followers",
|
|
113
|
+
"following",
|
|
114
|
+
"mutuals"
|
|
115
|
+
];
|
|
116
|
+
var RELATIONSHIP_LIST_DEFAULT_LIMIT = 20;
|
|
117
|
+
var RELATIONSHIP_LIST_MAX_LIMIT = 50;
|
|
118
|
+
var FOLLOW_SUGGESTIONS_DEFAULT_LIMIT = 10;
|
|
119
|
+
var FOLLOW_SUGGESTIONS_MAX_LIMIT = 20;
|
|
120
|
+
var FOLLOW_SUGGESTION_REASONS = [
|
|
121
|
+
"FOLLOWS_YOU",
|
|
122
|
+
"FOLLOWED_BY_PEOPLE_YOU_FOLLOW"
|
|
123
|
+
];
|
|
124
|
+
|
|
125
|
+
// src/workout.ts
|
|
126
|
+
var SESSION_SHARE_FIELDS = [
|
|
127
|
+
"duration",
|
|
128
|
+
"volume",
|
|
129
|
+
"completedSets",
|
|
130
|
+
"records",
|
|
131
|
+
"progression",
|
|
132
|
+
"notes"
|
|
133
|
+
];
|
|
134
|
+
var SESSION_SHARE_DEFAULT_FIELDS = [
|
|
135
|
+
"duration",
|
|
136
|
+
"volume",
|
|
137
|
+
"completedSets",
|
|
138
|
+
"records"
|
|
139
|
+
];
|
|
140
|
+
var SESSION_SHARE_MAX_ACTIVE_LINKS = 10;
|
|
111
141
|
|
|
112
142
|
// src/analytics.ts
|
|
113
143
|
var TRAINING_EVENT_TYPES = [
|
|
@@ -120,6 +150,9 @@ var PROGRESS_TIMELINE_EVENT_TYPES = [
|
|
|
120
150
|
"PROGRESSION_CHANGED"
|
|
121
151
|
];
|
|
122
152
|
export {
|
|
153
|
+
FOLLOW_SUGGESTIONS_DEFAULT_LIMIT,
|
|
154
|
+
FOLLOW_SUGGESTIONS_MAX_LIMIT,
|
|
155
|
+
FOLLOW_SUGGESTION_REASONS,
|
|
123
156
|
MUSCLE_GROUPS,
|
|
124
157
|
PREFERRED_TRAINING_STYLE_VALUES,
|
|
125
158
|
PROFILE_BIO_MAX_LENGTH,
|
|
@@ -130,8 +163,14 @@ export {
|
|
|
130
163
|
PROFILE_VISIBILITY_VALUES,
|
|
131
164
|
PROGRESSION_SCHEMES,
|
|
132
165
|
PROGRESS_TIMELINE_EVENT_TYPES,
|
|
166
|
+
RELATIONSHIP_LIST_DEFAULT_LIMIT,
|
|
167
|
+
RELATIONSHIP_LIST_KINDS,
|
|
168
|
+
RELATIONSHIP_LIST_MAX_LIMIT,
|
|
133
169
|
REP_TYPES,
|
|
134
170
|
RESERVED_USERNAMES,
|
|
171
|
+
SESSION_SHARE_DEFAULT_FIELDS,
|
|
172
|
+
SESSION_SHARE_FIELDS,
|
|
173
|
+
SESSION_SHARE_MAX_ACTIVE_LINKS,
|
|
135
174
|
SEXES,
|
|
136
175
|
TRAINING_DISCIPLINE_VALUES,
|
|
137
176
|
TRAINING_EVENT_TYPES,
|
package/package.json
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@sunsteel/contracts",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"repository": {
|
|
5
|
-
"type": "git",
|
|
6
|
-
"url": "git+https://github.com/ezee969/sunsteel-contracts.git"
|
|
7
|
-
},
|
|
8
|
-
"private": false,
|
|
9
|
-
"engines": {
|
|
10
|
-
"node": ">=20.11"
|
|
11
|
-
},
|
|
12
|
-
"type": "module",
|
|
13
|
-
"sideEffects": false,
|
|
14
|
-
"main": "./dist/index.cjs",
|
|
15
|
-
"module": "./dist/index.js",
|
|
16
|
-
"types": "./dist/index.d.ts",
|
|
17
|
-
"exports": {
|
|
18
|
-
".": {
|
|
19
|
-
"types": "./dist/index.d.ts",
|
|
20
|
-
"import": "./dist/index.js",
|
|
21
|
-
"require": "./dist/index.cjs"
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
"files": [
|
|
25
|
-
"dist"
|
|
26
|
-
],
|
|
27
|
-
"scripts": {
|
|
28
|
-
"build": "tsup src/index.ts --format esm,cjs --dts --clean",
|
|
29
|
-
"dev": "tsup src/index.ts --format esm,cjs --dts --watch",
|
|
30
|
-
"typecheck": "tsc --noEmit",
|
|
31
|
-
"lint": "npm run typecheck",
|
|
32
|
-
"verify": "npm run typecheck && npm run build",
|
|
33
|
-
"verify:security": "npm audit",
|
|
34
|
-
"prepublishOnly": "npm run build"
|
|
35
|
-
},
|
|
36
|
-
"devDependencies": {
|
|
37
|
-
"tsup": "^8.3.5",
|
|
38
|
-
"typescript": "^5.7.3"
|
|
39
|
-
}
|
|
40
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@sunsteel/contracts",
|
|
3
|
+
"version": "0.25.0",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "git+https://github.com/ezee969/sunsteel-contracts.git"
|
|
7
|
+
},
|
|
8
|
+
"private": false,
|
|
9
|
+
"engines": {
|
|
10
|
+
"node": ">=20.11"
|
|
11
|
+
},
|
|
12
|
+
"type": "module",
|
|
13
|
+
"sideEffects": false,
|
|
14
|
+
"main": "./dist/index.cjs",
|
|
15
|
+
"module": "./dist/index.js",
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"import": "./dist/index.js",
|
|
21
|
+
"require": "./dist/index.cjs"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"dist"
|
|
26
|
+
],
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "tsup src/index.ts --format esm,cjs --dts --clean",
|
|
29
|
+
"dev": "tsup src/index.ts --format esm,cjs --dts --watch",
|
|
30
|
+
"typecheck": "tsc --noEmit",
|
|
31
|
+
"lint": "npm run typecheck",
|
|
32
|
+
"verify": "npm run typecheck && npm run build",
|
|
33
|
+
"verify:security": "npm audit",
|
|
34
|
+
"prepublishOnly": "npm run build"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"tsup": "^8.3.5",
|
|
38
|
+
"typescript": "^5.7.3"
|
|
39
|
+
}
|
|
40
|
+
}
|