@sunsteel/contracts 0.47.0 → 0.49.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 +25 -2
- package/dist/index.d.cts +96 -4
- package/dist/index.d.ts +96 -4
- package/dist/index.js +21 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -75,9 +75,11 @@ __export(index_exports, {
|
|
|
75
75
|
ROUTINE_DAYS_MAX: () => ROUTINE_DAYS_MAX,
|
|
76
76
|
ROUTINE_DAY_NAME_MAX: () => ROUTINE_DAY_NAME_MAX,
|
|
77
77
|
ROUTINE_SCHEDULE_MODES: () => ROUTINE_SCHEDULE_MODES,
|
|
78
|
+
ROUTINE_SHARE_MAX_ACTIVE_LINKS: () => ROUTINE_SHARE_MAX_ACTIVE_LINKS,
|
|
78
79
|
ROUTINE_VERSIONS_MAX: () => ROUTINE_VERSIONS_MAX,
|
|
79
80
|
ROUTINE_VERSION_KINDS: () => ROUTINE_VERSION_KINDS,
|
|
80
81
|
ROUTINE_VERSION_NAME_MAX: () => ROUTINE_VERSION_NAME_MAX,
|
|
82
|
+
ROUTINE_VISIBILITY_VALUES: () => ROUTINE_VISIBILITY_VALUES,
|
|
81
83
|
SCHEDULE_MOVE_MAX_DAYS: () => SCHEDULE_MOVE_MAX_DAYS,
|
|
82
84
|
SCHEDULE_OVERRIDES_MAX_RANGE_DAYS: () => SCHEDULE_OVERRIDES_MAX_RANGE_DAYS,
|
|
83
85
|
SCHEDULE_OVERRIDE_KINDS: () => SCHEDULE_OVERRIDE_KINDS,
|
|
@@ -86,7 +88,9 @@ __export(index_exports, {
|
|
|
86
88
|
SESSION_SHARE_FIELDS: () => SESSION_SHARE_FIELDS,
|
|
87
89
|
SESSION_SHARE_MAX_ACTIVE_LINKS: () => SESSION_SHARE_MAX_ACTIVE_LINKS,
|
|
88
90
|
SEXES: () => SEXES,
|
|
91
|
+
SHARED_ROUTINE_SOURCES: () => SHARED_ROUTINE_SOURCES,
|
|
89
92
|
STARRED_EXERCISES_MAX: () => STARRED_EXERCISES_MAX,
|
|
93
|
+
STREAK_MAX_GAP_DAYS: () => STREAK_MAX_GAP_DAYS,
|
|
90
94
|
TRAINING_DISCIPLINE_VALUES: () => TRAINING_DISCIPLINE_VALUES,
|
|
91
95
|
TRAINING_EVENT_TYPES: () => TRAINING_EVENT_TYPES,
|
|
92
96
|
TRAINING_EXPERIENCE_LEVEL_VALUES: () => TRAINING_EXPERIENCE_LEVEL_VALUES,
|
|
@@ -419,6 +423,15 @@ var ROUTINE_VERSIONS_MAX = 20;
|
|
|
419
423
|
var ROUTINE_VERSION_NAME_MAX = 60;
|
|
420
424
|
var ROUTINE_VERSION_KINDS = ["SAVED", "BEFORE_RESTORE"];
|
|
421
425
|
|
|
426
|
+
// src/routine-sharing.ts
|
|
427
|
+
var ROUTINE_VISIBILITY_VALUES = [
|
|
428
|
+
"PRIVATE",
|
|
429
|
+
"FOLLOWERS",
|
|
430
|
+
"PUBLIC"
|
|
431
|
+
];
|
|
432
|
+
var ROUTINE_SHARE_MAX_ACTIVE_LINKS = 10;
|
|
433
|
+
var SHARED_ROUTINE_SOURCES = ["LINK", "VISIBILITY"];
|
|
434
|
+
|
|
422
435
|
// src/schedule.ts
|
|
423
436
|
var SCHEDULE_OVERRIDE_KINDS = ["MOVE", "SKIP"];
|
|
424
437
|
var SCHEDULE_MOVE_MAX_DAYS = 6;
|
|
@@ -473,7 +486,11 @@ var NOTIFICATIONS_LIST_LIMIT = 50;
|
|
|
473
486
|
|
|
474
487
|
// src/push.ts
|
|
475
488
|
var PUSH_SUBSCRIPTIONS_MAX = 10;
|
|
476
|
-
var PUSH_PAYLOAD_KINDS = [
|
|
489
|
+
var PUSH_PAYLOAD_KINDS = [
|
|
490
|
+
"REST_ALERT",
|
|
491
|
+
"TRAINING_REMINDER",
|
|
492
|
+
"STREAK_AT_RISK"
|
|
493
|
+
];
|
|
477
494
|
var REST_ALERT_MAX_LEAD_SECONDS = 3600;
|
|
478
495
|
var REST_ALERT_MIN_LEAD_SECONDS = 5;
|
|
479
496
|
var REST_ALERT_REFUSALS = [
|
|
@@ -492,7 +509,8 @@ var REST_ALERT_REFUSALS = [
|
|
|
492
509
|
// src/notification-preferences.ts
|
|
493
510
|
var NOTIFICATION_CATEGORIES = [
|
|
494
511
|
"REST_ALERT",
|
|
495
|
-
"TRAINING_REMINDER"
|
|
512
|
+
"TRAINING_REMINDER",
|
|
513
|
+
"STREAK_AT_RISK"
|
|
496
514
|
];
|
|
497
515
|
var MINUTES_IN_DAY = 1440;
|
|
498
516
|
function isWithinQuietHours(minuteOfDay, quietHours) {
|
|
@@ -501,6 +519,7 @@ function isWithinQuietHours(minuteOfDay, quietHours) {
|
|
|
501
519
|
if (startMinute === endMinute) return false;
|
|
502
520
|
return startMinute < endMinute ? minuteOfDay >= startMinute && minuteOfDay < endMinute : minuteOfDay >= startMinute || minuteOfDay < endMinute;
|
|
503
521
|
}
|
|
522
|
+
var STREAK_MAX_GAP_DAYS = 3;
|
|
504
523
|
// Annotate the CommonJS export names for ESM import in node:
|
|
505
524
|
0 && (module.exports = {
|
|
506
525
|
ACHIEVEMENT_CATEGORIES,
|
|
@@ -558,9 +577,11 @@ function isWithinQuietHours(minuteOfDay, quietHours) {
|
|
|
558
577
|
ROUTINE_DAYS_MAX,
|
|
559
578
|
ROUTINE_DAY_NAME_MAX,
|
|
560
579
|
ROUTINE_SCHEDULE_MODES,
|
|
580
|
+
ROUTINE_SHARE_MAX_ACTIVE_LINKS,
|
|
561
581
|
ROUTINE_VERSIONS_MAX,
|
|
562
582
|
ROUTINE_VERSION_KINDS,
|
|
563
583
|
ROUTINE_VERSION_NAME_MAX,
|
|
584
|
+
ROUTINE_VISIBILITY_VALUES,
|
|
564
585
|
SCHEDULE_MOVE_MAX_DAYS,
|
|
565
586
|
SCHEDULE_OVERRIDES_MAX_RANGE_DAYS,
|
|
566
587
|
SCHEDULE_OVERRIDE_KINDS,
|
|
@@ -569,7 +590,9 @@ function isWithinQuietHours(minuteOfDay, quietHours) {
|
|
|
569
590
|
SESSION_SHARE_FIELDS,
|
|
570
591
|
SESSION_SHARE_MAX_ACTIVE_LINKS,
|
|
571
592
|
SEXES,
|
|
593
|
+
SHARED_ROUTINE_SOURCES,
|
|
572
594
|
STARRED_EXERCISES_MAX,
|
|
595
|
+
STREAK_MAX_GAP_DAYS,
|
|
573
596
|
TRAINING_DISCIPLINE_VALUES,
|
|
574
597
|
TRAINING_EVENT_TYPES,
|
|
575
598
|
TRAINING_EXPERIENCE_LEVEL_VALUES,
|
package/dist/index.d.cts
CHANGED
|
@@ -1179,6 +1179,73 @@ interface PersonalGoalsResponse {
|
|
|
1179
1179
|
goals: PersonalGoalProgress[];
|
|
1180
1180
|
}
|
|
1181
1181
|
|
|
1182
|
+
/**
|
|
1183
|
+
* Per-routine visibility. The account-level `PROF-06` routines rule is the
|
|
1184
|
+
* upper bound: a routine marked `PUBLIC` inside an account whose routines are
|
|
1185
|
+
* `FOLLOWERS` is visible to followers only, the same way `SOC-04` bounds
|
|
1186
|
+
* activity by the profile section it comes from.
|
|
1187
|
+
*/
|
|
1188
|
+
declare const ROUTINE_VISIBILITY_VALUES: readonly ["PRIVATE", "FOLLOWERS", "PUBLIC"];
|
|
1189
|
+
type RoutineVisibility = (typeof ROUTINE_VISIBILITY_VALUES)[number];
|
|
1190
|
+
/** One routine keeps at most this many active links. */
|
|
1191
|
+
declare const ROUTINE_SHARE_MAX_ACTIVE_LINKS = 10;
|
|
1192
|
+
/** PUT /routines/:id/visibility */
|
|
1193
|
+
interface UpdateRoutineVisibilityRequest {
|
|
1194
|
+
visibility: RoutineVisibility;
|
|
1195
|
+
}
|
|
1196
|
+
/** An active share link, visible only to the routine's owner. */
|
|
1197
|
+
interface RoutineShare {
|
|
1198
|
+
id: string;
|
|
1199
|
+
routineId: string;
|
|
1200
|
+
/** Unguessable identifier used in the public `/shared/routines/:token` URL. */
|
|
1201
|
+
token: string;
|
|
1202
|
+
createdAt: IsoDateString;
|
|
1203
|
+
}
|
|
1204
|
+
/** Stable successful response of GET /routines/:id/shares. */
|
|
1205
|
+
interface RoutineShareListResponse {
|
|
1206
|
+
items: RoutineShare[];
|
|
1207
|
+
}
|
|
1208
|
+
interface SharedRoutineOwner {
|
|
1209
|
+
username: string;
|
|
1210
|
+
name: string;
|
|
1211
|
+
lastName?: string | null;
|
|
1212
|
+
avatarUrl?: string | null;
|
|
1213
|
+
}
|
|
1214
|
+
/**
|
|
1215
|
+
* How a reader reached a routine. A link is the owner's explicit consent for
|
|
1216
|
+
* that one routine and ignores visibility; a visibility read is governed by
|
|
1217
|
+
* both the routine's own rule and the account's.
|
|
1218
|
+
*/
|
|
1219
|
+
declare const SHARED_ROUTINE_SOURCES: readonly ["LINK", "VISIBILITY"];
|
|
1220
|
+
type SharedRoutineSource = (typeof SHARED_ROUTINE_SOURCES)[number];
|
|
1221
|
+
/**
|
|
1222
|
+
* Stable successful response of the unauthenticated
|
|
1223
|
+
* GET /shared/routines/:token, and of the authenticated member read.
|
|
1224
|
+
*/
|
|
1225
|
+
interface SharedRoutine {
|
|
1226
|
+
/** Kept so a future clone (`ROUT-05`) can record what it came from. */
|
|
1227
|
+
routineId: string;
|
|
1228
|
+
setup: RoutineVersionSetup;
|
|
1229
|
+
owner: SharedRoutineOwner;
|
|
1230
|
+
source: SharedRoutineSource;
|
|
1231
|
+
/** When the routine was last changed, not when it was shared. */
|
|
1232
|
+
updatedAt: IsoDateString;
|
|
1233
|
+
}
|
|
1234
|
+
/** A routine in a member's visible list, without loading its whole setup. */
|
|
1235
|
+
interface SharedRoutineSummary {
|
|
1236
|
+
routineId: string;
|
|
1237
|
+
name: string;
|
|
1238
|
+
description: string | null;
|
|
1239
|
+
scheduleMode: RoutineScheduleMode;
|
|
1240
|
+
dayCount: number;
|
|
1241
|
+
exerciseCount: number;
|
|
1242
|
+
updatedAt: IsoDateString;
|
|
1243
|
+
}
|
|
1244
|
+
/** Stable successful response of GET /users/:identifier/routines. */
|
|
1245
|
+
interface MemberRoutinesResponse {
|
|
1246
|
+
routines: SharedRoutineSummary[];
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1182
1249
|
/**
|
|
1183
1250
|
* ROUT-11: a WEEKLY routine ties each day to a weekday; a ROTATION routine
|
|
1184
1251
|
* runs its days in `order`, each after the last completed one, whatever the
|
|
@@ -1274,6 +1341,12 @@ interface Routine {
|
|
|
1274
1341
|
* dates; always empty on a WEEKLY routine.
|
|
1275
1342
|
*/
|
|
1276
1343
|
rotationWeekdays: number[];
|
|
1344
|
+
/**
|
|
1345
|
+
* ROUT-04: who may read this routine, bounded by the account-level
|
|
1346
|
+
* `PROF-06` routines rule. Owner-only field; it never appears in a shared
|
|
1347
|
+
* read, where visibility is the reason the reader is there.
|
|
1348
|
+
*/
|
|
1349
|
+
visibility: RoutineVisibility;
|
|
1277
1350
|
days: RoutineDay[];
|
|
1278
1351
|
createdAt: IsoDateString;
|
|
1279
1352
|
updatedAt: IsoDateString;
|
|
@@ -1539,7 +1612,7 @@ interface DeletePushSubscriptionRequest {
|
|
|
1539
1612
|
* What a delivered push asks the service worker to show. `kind` exists so the
|
|
1540
1613
|
* worker can branch without guessing from the copy.
|
|
1541
1614
|
*/
|
|
1542
|
-
declare const PUSH_PAYLOAD_KINDS: readonly ["REST_ALERT", "TRAINING_REMINDER"];
|
|
1615
|
+
declare const PUSH_PAYLOAD_KINDS: readonly ["REST_ALERT", "TRAINING_REMINDER", "STREAK_AT_RISK"];
|
|
1543
1616
|
type PushPayloadKind = (typeof PUSH_PAYLOAD_KINDS)[number];
|
|
1544
1617
|
interface RestAlertPushPayload {
|
|
1545
1618
|
kind: 'REST_ALERT';
|
|
@@ -1563,7 +1636,19 @@ interface TrainingReminderPushPayload {
|
|
|
1563
1636
|
url: string;
|
|
1564
1637
|
tag: string;
|
|
1565
1638
|
}
|
|
1566
|
-
|
|
1639
|
+
/**
|
|
1640
|
+
* NOTIF-06. Sent on the last day a run can still be saved, in place of that
|
|
1641
|
+
* day's reminder rather than beside it. It states the evidence and never
|
|
1642
|
+
* instructs anyone to train: a rest day ending a streak is the plan working.
|
|
1643
|
+
*/
|
|
1644
|
+
interface StreakAtRiskPushPayload {
|
|
1645
|
+
kind: 'STREAK_AT_RISK';
|
|
1646
|
+
title: string;
|
|
1647
|
+
body: string;
|
|
1648
|
+
url: string;
|
|
1649
|
+
tag: string;
|
|
1650
|
+
}
|
|
1651
|
+
type PushPayload = RestAlertPushPayload | TrainingReminderPushPayload | StreakAtRiskPushPayload;
|
|
1567
1652
|
/** A rest alert is refused beyond this far ahead. */
|
|
1568
1653
|
declare const REST_ALERT_MAX_LEAD_SECONDS = 3600;
|
|
1569
1654
|
/**
|
|
@@ -1600,7 +1685,7 @@ type RestAlertRefusal = (typeof REST_ALERT_REFUSALS)[number];
|
|
|
1600
1685
|
* twice; the NOTIF-01 centre is gathered on read rather than delivered, and is
|
|
1601
1686
|
* not something to turn off.
|
|
1602
1687
|
*/
|
|
1603
|
-
declare const NOTIFICATION_CATEGORIES: readonly ["REST_ALERT", "TRAINING_REMINDER"];
|
|
1688
|
+
declare const NOTIFICATION_CATEGORIES: readonly ["REST_ALERT", "TRAINING_REMINDER", "STREAK_AT_RISK"];
|
|
1604
1689
|
type NotificationCategory = (typeof NOTIFICATION_CATEGORIES)[number];
|
|
1605
1690
|
/**
|
|
1606
1691
|
* A local-clock window in which nothing is delivered, as minutes from
|
|
@@ -1626,6 +1711,13 @@ interface TrainingReminderPreference {
|
|
|
1626
1711
|
/** Null switches reminders off without discarding the chosen time. */
|
|
1627
1712
|
minuteOfDay: number | null;
|
|
1628
1713
|
}
|
|
1714
|
+
/**
|
|
1715
|
+
* NOTIF-06. A streak survives a gap of `STREAK_MAX_GAP_DAYS` and dies on the
|
|
1716
|
+
* next day, so "at risk" is not a judgement: it is the last local date that
|
|
1717
|
+
* can still save the run. The rule lives here because both halves of the
|
|
1718
|
+
* product state it.
|
|
1719
|
+
*/
|
|
1720
|
+
declare const STREAK_MAX_GAP_DAYS = 3;
|
|
1629
1721
|
interface NotificationPreferences {
|
|
1630
1722
|
/** Every category, so a client never has to assume a default. */
|
|
1631
1723
|
categories: Record<NotificationCategory, boolean>;
|
|
@@ -1668,4 +1760,4 @@ interface PlannedReminder {
|
|
|
1668
1760
|
routineNames: string[];
|
|
1669
1761
|
}
|
|
1670
1762
|
|
|
1671
|
-
export { ACHIEVEMENT_CATEGORIES, ACHIEVEMENT_DEFINITIONS, type AchievementCategory, type AchievementCategoryProgress, type AchievementDefinition, type AchievementNotification, type AchievementUnlockedEventPayload, type AchievementsResponse, type AppNotification, type Brand, COMEBACK_MIN_INACTIVE_DAYS, COMEBACK_RECOGNITION_LIMIT, COMEBACK_REQUIRED_ACTIVE_DAYS, COMEBACK_SESSION_LOOKBACK, COMEBACK_WINDOW_DAYS, type CalendarDate, type ComebackRecognition, type ComebackRecognitionSummary, type CreateRoutineDayInput, type CreateRoutineExerciseInput, type CreateRoutineRequest, type CreateRoutineVersionRequest, type CreateSessionShareRequest, type DeletePushSubscriptionRequest, EXERCISE_EQUIPMENT, EXERCISE_MECHANICS, type EarnedAchievement, 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 ExercisePlateau, type ExerciseStrengthSummary, type ExerciseStrengthTrendPoint, type ExerciseStrengthTrendQuery, type ExerciseStrengthTrendResponse, FEATURED_PROFILE_ITEMS_MAX, FEATURED_PROFILE_ITEM_KINDS, FEATURED_PROFILE_REFERENCE_MAX_LENGTH, FOLLOW_SUGGESTIONS_DEFAULT_LIMIT, FOLLOW_SUGGESTIONS_MAX_LIMIT, FOLLOW_SUGGESTION_REASONS, type FeaturedProfileAchievementItem, type FeaturedProfileItem, type FeaturedProfileItemKind, type FeaturedProfileRankItem, type FeaturedProfileRecordItem, type FeaturedProfileSelection, type FeaturedProfileSelectionInput, type FeaturedProfileSelectionsResponse, type FinishStatus, type FinishWorkoutRequest, type FinishWorkoutResponse, type FollowSuggestion, type FollowSuggestionReason, type FollowSuggestionsResponse, type IsoDateString, type ListSessionsParams, MEASURABLE_GOALS_MAX, MEASURABLE_GOAL_DIRECTIONS, MEASURABLE_GOAL_TYPES, MINUTES_IN_DAY, MOVEMENT_PATTERNS, MUSCLE_GROUPS, type MarkNotificationsReadRequest, type MarkNotificationsReadResponse, type MeasurableGoal, type MeasurableGoalDirection, type MeasurableGoalExercise, type MeasurableGoalInput, type MeasurableGoalType, type MoveOccurrenceRequest, type MovementPattern, type MuscleGroup, type MuscleGroupHeatmapQuery, type MuscleGroupHeatmapResponse, type MuscleGroupHeatmapValue, type MuscleGroupHeatmapWeek, type MuscleVolumeTrendSeries, NOTIFICATIONS_LIST_LIMIT, NOTIFICATIONS_LOOKBACK_DAYS, NOTIFICATIONS_RETENTION_DAYS, NOTIFICATION_CATEGORIES, NOTIFICATION_KINDS, type NewFollowerNotification, type NotificationCategory, type NotificationKind, type NotificationPreferences, type NotificationPreferencesResponse, type NotificationsResponse, PLATEAU_MIN_DAYS_SINCE_BEST, PLATEAU_MIN_SESSIONS, PLATEAU_MIN_SESSIONS_MAX, PLATEAU_MIN_SESSIONS_MIN, PLATEAU_RECENT_DAYS, PLATEAU_WINDOW_DAYS, 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, PUSH_PAYLOAD_KINDS, PUSH_SUBSCRIPTIONS_MAX, type PaginatedResponse, type PersonalGoalProgress, type PersonalGoalsResponse, type PersonalRecordEntry, type PersonalRecordKind, type PlannedReminder, type PlatePairInventory, type PlateauPreferences, type PlateauSet, type PlateausResponse, 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 PublicProfileAchievements, type PublicTrainingSummary, type PublicUserProfile, type PushPayload, type PushPayloadKind, type PushSubscriptionKeys, type PushSubscriptionSummary, type PushSubscriptionsResponse, type QuietHours, RELATIONSHIP_LIST_DEFAULT_LIMIT, RELATIONSHIP_LIST_KINDS, RELATIONSHIP_LIST_MAX_LIMIT, RENAISSANCE_RANK_DEFINITIONS, REP_TYPES, RESERVED_USERNAMES, REST_ALERT_MAX_LEAD_SECONDS, REST_ALERT_MIN_LEAD_SECONDS, REST_ALERT_REFUSALS, ROUTINE_DAYS_MAX, ROUTINE_DAY_NAME_MAX, ROUTINE_SCHEDULE_MODES, ROUTINE_VERSIONS_MAX, ROUTINE_VERSION_KINDS, ROUTINE_VERSION_NAME_MAX, type RecentActivityEntry, type RegisterPushSubscriptionRequest, type RelationshipListKind, type RelationshipListQuery, type RelationshipListResponse, type RelationshipMember, type RenaissanceRankDefinition, type RenaissanceRankProgress, type RepType, type ReplaceFeaturedProfileItemsRequest, type ReplaceMeasurableGoalsRequest, type ReplaceTrainingLocationsRequest, type RestAlertPushPayload, type RestAlertRefusal, type RestoreRoutineVersionResponse, type Routine, type RoutineDay, type RoutineDayId, type RoutineExercise, type RoutineId, type RoutineScheduleMode, type RoutineSet, type RoutineVersion, type RoutineVersionDay, type RoutineVersionExercise, type RoutineVersionKind, type RoutineVersionSetup, type RoutineVersionsResponse, SCHEDULE_MOVE_MAX_DAYS, SCHEDULE_OVERRIDES_MAX_RANGE_DAYS, SCHEDULE_OVERRIDE_KINDS, SCHEDULE_SKIP_PAST_DAYS, SESSION_SHARE_DEFAULT_FIELDS, SESSION_SHARE_FIELDS, SESSION_SHARE_MAX_ACTIVE_LINKS, SEXES, STARRED_EXERCISES_MAX, type ScheduleOverride, type ScheduleOverrideKind, type ScheduleOverridesQuery, type ScheduleOverridesResponse, type ScheduleRestAlertRequest, type ScheduleRestAlertResponse, type SessionComparisonExercise, type SessionComparisonQuery, type SessionComparisonResponse, type SessionComparisonRoutineDay, type SessionComparisonSession, type SessionComparisonSet, type SessionExerciseSubstitution, type SessionProgressNotification, type SessionRecapRecord, type SessionShare, type SessionShareField, type SessionShareListResponse, type SetAccountTimeZoneRequest, type SetLog, type Sex, type SharedSessionOwner, type SharedSessionRecap, type SkipOccurrenceRequest, type StarredExercise, type StarredExercisesResponse, type StartWorkoutRequest, type StartWorkoutResponse, type StreakMilestoneEventPayload, type SubstituteSessionExerciseRequest, type SubstituteSessionExerciseResponse, 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, type TrainingReminderPreference, type TrainingReminderPushPayload, USERNAME_MAX_LENGTH, USERNAME_MIN_LENGTH, USERNAME_PATTERN_SOURCE, type UpdateNotificationPreferencesRequest, 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, isWithinQuietHours, routineDayLabel };
|
|
1763
|
+
export { ACHIEVEMENT_CATEGORIES, ACHIEVEMENT_DEFINITIONS, type AchievementCategory, type AchievementCategoryProgress, type AchievementDefinition, type AchievementNotification, type AchievementUnlockedEventPayload, type AchievementsResponse, type AppNotification, type Brand, COMEBACK_MIN_INACTIVE_DAYS, COMEBACK_RECOGNITION_LIMIT, COMEBACK_REQUIRED_ACTIVE_DAYS, COMEBACK_SESSION_LOOKBACK, COMEBACK_WINDOW_DAYS, type CalendarDate, type ComebackRecognition, type ComebackRecognitionSummary, type CreateRoutineDayInput, type CreateRoutineExerciseInput, type CreateRoutineRequest, type CreateRoutineVersionRequest, type CreateSessionShareRequest, type DeletePushSubscriptionRequest, EXERCISE_EQUIPMENT, EXERCISE_MECHANICS, type EarnedAchievement, 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 ExercisePlateau, type ExerciseStrengthSummary, type ExerciseStrengthTrendPoint, type ExerciseStrengthTrendQuery, type ExerciseStrengthTrendResponse, FEATURED_PROFILE_ITEMS_MAX, FEATURED_PROFILE_ITEM_KINDS, FEATURED_PROFILE_REFERENCE_MAX_LENGTH, FOLLOW_SUGGESTIONS_DEFAULT_LIMIT, FOLLOW_SUGGESTIONS_MAX_LIMIT, FOLLOW_SUGGESTION_REASONS, type FeaturedProfileAchievementItem, type FeaturedProfileItem, type FeaturedProfileItemKind, type FeaturedProfileRankItem, type FeaturedProfileRecordItem, type FeaturedProfileSelection, type FeaturedProfileSelectionInput, type FeaturedProfileSelectionsResponse, type FinishStatus, type FinishWorkoutRequest, type FinishWorkoutResponse, type FollowSuggestion, type FollowSuggestionReason, type FollowSuggestionsResponse, type IsoDateString, type ListSessionsParams, MEASURABLE_GOALS_MAX, MEASURABLE_GOAL_DIRECTIONS, MEASURABLE_GOAL_TYPES, MINUTES_IN_DAY, MOVEMENT_PATTERNS, MUSCLE_GROUPS, type MarkNotificationsReadRequest, type MarkNotificationsReadResponse, type MeasurableGoal, type MeasurableGoalDirection, type MeasurableGoalExercise, type MeasurableGoalInput, type MeasurableGoalType, type MemberRoutinesResponse, type MoveOccurrenceRequest, type MovementPattern, type MuscleGroup, type MuscleGroupHeatmapQuery, type MuscleGroupHeatmapResponse, type MuscleGroupHeatmapValue, type MuscleGroupHeatmapWeek, type MuscleVolumeTrendSeries, NOTIFICATIONS_LIST_LIMIT, NOTIFICATIONS_LOOKBACK_DAYS, NOTIFICATIONS_RETENTION_DAYS, NOTIFICATION_CATEGORIES, NOTIFICATION_KINDS, type NewFollowerNotification, type NotificationCategory, type NotificationKind, type NotificationPreferences, type NotificationPreferencesResponse, type NotificationsResponse, PLATEAU_MIN_DAYS_SINCE_BEST, PLATEAU_MIN_SESSIONS, PLATEAU_MIN_SESSIONS_MAX, PLATEAU_MIN_SESSIONS_MIN, PLATEAU_RECENT_DAYS, PLATEAU_WINDOW_DAYS, 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, PUSH_PAYLOAD_KINDS, PUSH_SUBSCRIPTIONS_MAX, type PaginatedResponse, type PersonalGoalProgress, type PersonalGoalsResponse, type PersonalRecordEntry, type PersonalRecordKind, type PlannedReminder, type PlatePairInventory, type PlateauPreferences, type PlateauSet, type PlateausResponse, 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 PublicProfileAchievements, type PublicTrainingSummary, type PublicUserProfile, type PushPayload, type PushPayloadKind, type PushSubscriptionKeys, type PushSubscriptionSummary, type PushSubscriptionsResponse, type QuietHours, RELATIONSHIP_LIST_DEFAULT_LIMIT, RELATIONSHIP_LIST_KINDS, RELATIONSHIP_LIST_MAX_LIMIT, RENAISSANCE_RANK_DEFINITIONS, REP_TYPES, RESERVED_USERNAMES, REST_ALERT_MAX_LEAD_SECONDS, REST_ALERT_MIN_LEAD_SECONDS, REST_ALERT_REFUSALS, ROUTINE_DAYS_MAX, ROUTINE_DAY_NAME_MAX, ROUTINE_SCHEDULE_MODES, ROUTINE_SHARE_MAX_ACTIVE_LINKS, ROUTINE_VERSIONS_MAX, ROUTINE_VERSION_KINDS, ROUTINE_VERSION_NAME_MAX, ROUTINE_VISIBILITY_VALUES, type RecentActivityEntry, type RegisterPushSubscriptionRequest, type RelationshipListKind, type RelationshipListQuery, type RelationshipListResponse, type RelationshipMember, type RenaissanceRankDefinition, type RenaissanceRankProgress, type RepType, type ReplaceFeaturedProfileItemsRequest, type ReplaceMeasurableGoalsRequest, type ReplaceTrainingLocationsRequest, type RestAlertPushPayload, type RestAlertRefusal, type RestoreRoutineVersionResponse, type Routine, type RoutineDay, type RoutineDayId, type RoutineExercise, type RoutineId, type RoutineScheduleMode, type RoutineSet, type RoutineShare, type RoutineShareListResponse, type RoutineVersion, type RoutineVersionDay, type RoutineVersionExercise, type RoutineVersionKind, type RoutineVersionSetup, type RoutineVersionsResponse, type RoutineVisibility, SCHEDULE_MOVE_MAX_DAYS, SCHEDULE_OVERRIDES_MAX_RANGE_DAYS, SCHEDULE_OVERRIDE_KINDS, SCHEDULE_SKIP_PAST_DAYS, SESSION_SHARE_DEFAULT_FIELDS, SESSION_SHARE_FIELDS, SESSION_SHARE_MAX_ACTIVE_LINKS, SEXES, SHARED_ROUTINE_SOURCES, STARRED_EXERCISES_MAX, STREAK_MAX_GAP_DAYS, type ScheduleOverride, type ScheduleOverrideKind, type ScheduleOverridesQuery, type ScheduleOverridesResponse, type ScheduleRestAlertRequest, type ScheduleRestAlertResponse, type SessionComparisonExercise, type SessionComparisonQuery, type SessionComparisonResponse, type SessionComparisonRoutineDay, type SessionComparisonSession, type SessionComparisonSet, type SessionExerciseSubstitution, type SessionProgressNotification, type SessionRecapRecord, type SessionShare, type SessionShareField, type SessionShareListResponse, type SetAccountTimeZoneRequest, type SetLog, type Sex, type SharedRoutine, type SharedRoutineOwner, type SharedRoutineSource, type SharedRoutineSummary, type SharedSessionOwner, type SharedSessionRecap, type SkipOccurrenceRequest, type StarredExercise, type StarredExercisesResponse, type StartWorkoutRequest, type StartWorkoutResponse, type StreakAtRiskPushPayload, type StreakMilestoneEventPayload, type SubstituteSessionExerciseRequest, type SubstituteSessionExerciseResponse, 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, type TrainingReminderPreference, type TrainingReminderPushPayload, USERNAME_MAX_LENGTH, USERNAME_MIN_LENGTH, USERNAME_PATTERN_SOURCE, type UpdateNotificationPreferencesRequest, type UpdateProfileDiscoveryRequest, type UpdateProfilePrivacyRequest, type UpdateProfileRequest, type UpdateRoutineRequest, type UpdateRoutineVisibilityRequest, 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, isWithinQuietHours, routineDayLabel };
|
package/dist/index.d.ts
CHANGED
|
@@ -1179,6 +1179,73 @@ interface PersonalGoalsResponse {
|
|
|
1179
1179
|
goals: PersonalGoalProgress[];
|
|
1180
1180
|
}
|
|
1181
1181
|
|
|
1182
|
+
/**
|
|
1183
|
+
* Per-routine visibility. The account-level `PROF-06` routines rule is the
|
|
1184
|
+
* upper bound: a routine marked `PUBLIC` inside an account whose routines are
|
|
1185
|
+
* `FOLLOWERS` is visible to followers only, the same way `SOC-04` bounds
|
|
1186
|
+
* activity by the profile section it comes from.
|
|
1187
|
+
*/
|
|
1188
|
+
declare const ROUTINE_VISIBILITY_VALUES: readonly ["PRIVATE", "FOLLOWERS", "PUBLIC"];
|
|
1189
|
+
type RoutineVisibility = (typeof ROUTINE_VISIBILITY_VALUES)[number];
|
|
1190
|
+
/** One routine keeps at most this many active links. */
|
|
1191
|
+
declare const ROUTINE_SHARE_MAX_ACTIVE_LINKS = 10;
|
|
1192
|
+
/** PUT /routines/:id/visibility */
|
|
1193
|
+
interface UpdateRoutineVisibilityRequest {
|
|
1194
|
+
visibility: RoutineVisibility;
|
|
1195
|
+
}
|
|
1196
|
+
/** An active share link, visible only to the routine's owner. */
|
|
1197
|
+
interface RoutineShare {
|
|
1198
|
+
id: string;
|
|
1199
|
+
routineId: string;
|
|
1200
|
+
/** Unguessable identifier used in the public `/shared/routines/:token` URL. */
|
|
1201
|
+
token: string;
|
|
1202
|
+
createdAt: IsoDateString;
|
|
1203
|
+
}
|
|
1204
|
+
/** Stable successful response of GET /routines/:id/shares. */
|
|
1205
|
+
interface RoutineShareListResponse {
|
|
1206
|
+
items: RoutineShare[];
|
|
1207
|
+
}
|
|
1208
|
+
interface SharedRoutineOwner {
|
|
1209
|
+
username: string;
|
|
1210
|
+
name: string;
|
|
1211
|
+
lastName?: string | null;
|
|
1212
|
+
avatarUrl?: string | null;
|
|
1213
|
+
}
|
|
1214
|
+
/**
|
|
1215
|
+
* How a reader reached a routine. A link is the owner's explicit consent for
|
|
1216
|
+
* that one routine and ignores visibility; a visibility read is governed by
|
|
1217
|
+
* both the routine's own rule and the account's.
|
|
1218
|
+
*/
|
|
1219
|
+
declare const SHARED_ROUTINE_SOURCES: readonly ["LINK", "VISIBILITY"];
|
|
1220
|
+
type SharedRoutineSource = (typeof SHARED_ROUTINE_SOURCES)[number];
|
|
1221
|
+
/**
|
|
1222
|
+
* Stable successful response of the unauthenticated
|
|
1223
|
+
* GET /shared/routines/:token, and of the authenticated member read.
|
|
1224
|
+
*/
|
|
1225
|
+
interface SharedRoutine {
|
|
1226
|
+
/** Kept so a future clone (`ROUT-05`) can record what it came from. */
|
|
1227
|
+
routineId: string;
|
|
1228
|
+
setup: RoutineVersionSetup;
|
|
1229
|
+
owner: SharedRoutineOwner;
|
|
1230
|
+
source: SharedRoutineSource;
|
|
1231
|
+
/** When the routine was last changed, not when it was shared. */
|
|
1232
|
+
updatedAt: IsoDateString;
|
|
1233
|
+
}
|
|
1234
|
+
/** A routine in a member's visible list, without loading its whole setup. */
|
|
1235
|
+
interface SharedRoutineSummary {
|
|
1236
|
+
routineId: string;
|
|
1237
|
+
name: string;
|
|
1238
|
+
description: string | null;
|
|
1239
|
+
scheduleMode: RoutineScheduleMode;
|
|
1240
|
+
dayCount: number;
|
|
1241
|
+
exerciseCount: number;
|
|
1242
|
+
updatedAt: IsoDateString;
|
|
1243
|
+
}
|
|
1244
|
+
/** Stable successful response of GET /users/:identifier/routines. */
|
|
1245
|
+
interface MemberRoutinesResponse {
|
|
1246
|
+
routines: SharedRoutineSummary[];
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1182
1249
|
/**
|
|
1183
1250
|
* ROUT-11: a WEEKLY routine ties each day to a weekday; a ROTATION routine
|
|
1184
1251
|
* runs its days in `order`, each after the last completed one, whatever the
|
|
@@ -1274,6 +1341,12 @@ interface Routine {
|
|
|
1274
1341
|
* dates; always empty on a WEEKLY routine.
|
|
1275
1342
|
*/
|
|
1276
1343
|
rotationWeekdays: number[];
|
|
1344
|
+
/**
|
|
1345
|
+
* ROUT-04: who may read this routine, bounded by the account-level
|
|
1346
|
+
* `PROF-06` routines rule. Owner-only field; it never appears in a shared
|
|
1347
|
+
* read, where visibility is the reason the reader is there.
|
|
1348
|
+
*/
|
|
1349
|
+
visibility: RoutineVisibility;
|
|
1277
1350
|
days: RoutineDay[];
|
|
1278
1351
|
createdAt: IsoDateString;
|
|
1279
1352
|
updatedAt: IsoDateString;
|
|
@@ -1539,7 +1612,7 @@ interface DeletePushSubscriptionRequest {
|
|
|
1539
1612
|
* What a delivered push asks the service worker to show. `kind` exists so the
|
|
1540
1613
|
* worker can branch without guessing from the copy.
|
|
1541
1614
|
*/
|
|
1542
|
-
declare const PUSH_PAYLOAD_KINDS: readonly ["REST_ALERT", "TRAINING_REMINDER"];
|
|
1615
|
+
declare const PUSH_PAYLOAD_KINDS: readonly ["REST_ALERT", "TRAINING_REMINDER", "STREAK_AT_RISK"];
|
|
1543
1616
|
type PushPayloadKind = (typeof PUSH_PAYLOAD_KINDS)[number];
|
|
1544
1617
|
interface RestAlertPushPayload {
|
|
1545
1618
|
kind: 'REST_ALERT';
|
|
@@ -1563,7 +1636,19 @@ interface TrainingReminderPushPayload {
|
|
|
1563
1636
|
url: string;
|
|
1564
1637
|
tag: string;
|
|
1565
1638
|
}
|
|
1566
|
-
|
|
1639
|
+
/**
|
|
1640
|
+
* NOTIF-06. Sent on the last day a run can still be saved, in place of that
|
|
1641
|
+
* day's reminder rather than beside it. It states the evidence and never
|
|
1642
|
+
* instructs anyone to train: a rest day ending a streak is the plan working.
|
|
1643
|
+
*/
|
|
1644
|
+
interface StreakAtRiskPushPayload {
|
|
1645
|
+
kind: 'STREAK_AT_RISK';
|
|
1646
|
+
title: string;
|
|
1647
|
+
body: string;
|
|
1648
|
+
url: string;
|
|
1649
|
+
tag: string;
|
|
1650
|
+
}
|
|
1651
|
+
type PushPayload = RestAlertPushPayload | TrainingReminderPushPayload | StreakAtRiskPushPayload;
|
|
1567
1652
|
/** A rest alert is refused beyond this far ahead. */
|
|
1568
1653
|
declare const REST_ALERT_MAX_LEAD_SECONDS = 3600;
|
|
1569
1654
|
/**
|
|
@@ -1600,7 +1685,7 @@ type RestAlertRefusal = (typeof REST_ALERT_REFUSALS)[number];
|
|
|
1600
1685
|
* twice; the NOTIF-01 centre is gathered on read rather than delivered, and is
|
|
1601
1686
|
* not something to turn off.
|
|
1602
1687
|
*/
|
|
1603
|
-
declare const NOTIFICATION_CATEGORIES: readonly ["REST_ALERT", "TRAINING_REMINDER"];
|
|
1688
|
+
declare const NOTIFICATION_CATEGORIES: readonly ["REST_ALERT", "TRAINING_REMINDER", "STREAK_AT_RISK"];
|
|
1604
1689
|
type NotificationCategory = (typeof NOTIFICATION_CATEGORIES)[number];
|
|
1605
1690
|
/**
|
|
1606
1691
|
* A local-clock window in which nothing is delivered, as minutes from
|
|
@@ -1626,6 +1711,13 @@ interface TrainingReminderPreference {
|
|
|
1626
1711
|
/** Null switches reminders off without discarding the chosen time. */
|
|
1627
1712
|
minuteOfDay: number | null;
|
|
1628
1713
|
}
|
|
1714
|
+
/**
|
|
1715
|
+
* NOTIF-06. A streak survives a gap of `STREAK_MAX_GAP_DAYS` and dies on the
|
|
1716
|
+
* next day, so "at risk" is not a judgement: it is the last local date that
|
|
1717
|
+
* can still save the run. The rule lives here because both halves of the
|
|
1718
|
+
* product state it.
|
|
1719
|
+
*/
|
|
1720
|
+
declare const STREAK_MAX_GAP_DAYS = 3;
|
|
1629
1721
|
interface NotificationPreferences {
|
|
1630
1722
|
/** Every category, so a client never has to assume a default. */
|
|
1631
1723
|
categories: Record<NotificationCategory, boolean>;
|
|
@@ -1668,4 +1760,4 @@ interface PlannedReminder {
|
|
|
1668
1760
|
routineNames: string[];
|
|
1669
1761
|
}
|
|
1670
1762
|
|
|
1671
|
-
export { ACHIEVEMENT_CATEGORIES, ACHIEVEMENT_DEFINITIONS, type AchievementCategory, type AchievementCategoryProgress, type AchievementDefinition, type AchievementNotification, type AchievementUnlockedEventPayload, type AchievementsResponse, type AppNotification, type Brand, COMEBACK_MIN_INACTIVE_DAYS, COMEBACK_RECOGNITION_LIMIT, COMEBACK_REQUIRED_ACTIVE_DAYS, COMEBACK_SESSION_LOOKBACK, COMEBACK_WINDOW_DAYS, type CalendarDate, type ComebackRecognition, type ComebackRecognitionSummary, type CreateRoutineDayInput, type CreateRoutineExerciseInput, type CreateRoutineRequest, type CreateRoutineVersionRequest, type CreateSessionShareRequest, type DeletePushSubscriptionRequest, EXERCISE_EQUIPMENT, EXERCISE_MECHANICS, type EarnedAchievement, 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 ExercisePlateau, type ExerciseStrengthSummary, type ExerciseStrengthTrendPoint, type ExerciseStrengthTrendQuery, type ExerciseStrengthTrendResponse, FEATURED_PROFILE_ITEMS_MAX, FEATURED_PROFILE_ITEM_KINDS, FEATURED_PROFILE_REFERENCE_MAX_LENGTH, FOLLOW_SUGGESTIONS_DEFAULT_LIMIT, FOLLOW_SUGGESTIONS_MAX_LIMIT, FOLLOW_SUGGESTION_REASONS, type FeaturedProfileAchievementItem, type FeaturedProfileItem, type FeaturedProfileItemKind, type FeaturedProfileRankItem, type FeaturedProfileRecordItem, type FeaturedProfileSelection, type FeaturedProfileSelectionInput, type FeaturedProfileSelectionsResponse, type FinishStatus, type FinishWorkoutRequest, type FinishWorkoutResponse, type FollowSuggestion, type FollowSuggestionReason, type FollowSuggestionsResponse, type IsoDateString, type ListSessionsParams, MEASURABLE_GOALS_MAX, MEASURABLE_GOAL_DIRECTIONS, MEASURABLE_GOAL_TYPES, MINUTES_IN_DAY, MOVEMENT_PATTERNS, MUSCLE_GROUPS, type MarkNotificationsReadRequest, type MarkNotificationsReadResponse, type MeasurableGoal, type MeasurableGoalDirection, type MeasurableGoalExercise, type MeasurableGoalInput, type MeasurableGoalType, type MoveOccurrenceRequest, type MovementPattern, type MuscleGroup, type MuscleGroupHeatmapQuery, type MuscleGroupHeatmapResponse, type MuscleGroupHeatmapValue, type MuscleGroupHeatmapWeek, type MuscleVolumeTrendSeries, NOTIFICATIONS_LIST_LIMIT, NOTIFICATIONS_LOOKBACK_DAYS, NOTIFICATIONS_RETENTION_DAYS, NOTIFICATION_CATEGORIES, NOTIFICATION_KINDS, type NewFollowerNotification, type NotificationCategory, type NotificationKind, type NotificationPreferences, type NotificationPreferencesResponse, type NotificationsResponse, PLATEAU_MIN_DAYS_SINCE_BEST, PLATEAU_MIN_SESSIONS, PLATEAU_MIN_SESSIONS_MAX, PLATEAU_MIN_SESSIONS_MIN, PLATEAU_RECENT_DAYS, PLATEAU_WINDOW_DAYS, 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, PUSH_PAYLOAD_KINDS, PUSH_SUBSCRIPTIONS_MAX, type PaginatedResponse, type PersonalGoalProgress, type PersonalGoalsResponse, type PersonalRecordEntry, type PersonalRecordKind, type PlannedReminder, type PlatePairInventory, type PlateauPreferences, type PlateauSet, type PlateausResponse, 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 PublicProfileAchievements, type PublicTrainingSummary, type PublicUserProfile, type PushPayload, type PushPayloadKind, type PushSubscriptionKeys, type PushSubscriptionSummary, type PushSubscriptionsResponse, type QuietHours, RELATIONSHIP_LIST_DEFAULT_LIMIT, RELATIONSHIP_LIST_KINDS, RELATIONSHIP_LIST_MAX_LIMIT, RENAISSANCE_RANK_DEFINITIONS, REP_TYPES, RESERVED_USERNAMES, REST_ALERT_MAX_LEAD_SECONDS, REST_ALERT_MIN_LEAD_SECONDS, REST_ALERT_REFUSALS, ROUTINE_DAYS_MAX, ROUTINE_DAY_NAME_MAX, ROUTINE_SCHEDULE_MODES, ROUTINE_VERSIONS_MAX, ROUTINE_VERSION_KINDS, ROUTINE_VERSION_NAME_MAX, type RecentActivityEntry, type RegisterPushSubscriptionRequest, type RelationshipListKind, type RelationshipListQuery, type RelationshipListResponse, type RelationshipMember, type RenaissanceRankDefinition, type RenaissanceRankProgress, type RepType, type ReplaceFeaturedProfileItemsRequest, type ReplaceMeasurableGoalsRequest, type ReplaceTrainingLocationsRequest, type RestAlertPushPayload, type RestAlertRefusal, type RestoreRoutineVersionResponse, type Routine, type RoutineDay, type RoutineDayId, type RoutineExercise, type RoutineId, type RoutineScheduleMode, type RoutineSet, type RoutineVersion, type RoutineVersionDay, type RoutineVersionExercise, type RoutineVersionKind, type RoutineVersionSetup, type RoutineVersionsResponse, SCHEDULE_MOVE_MAX_DAYS, SCHEDULE_OVERRIDES_MAX_RANGE_DAYS, SCHEDULE_OVERRIDE_KINDS, SCHEDULE_SKIP_PAST_DAYS, SESSION_SHARE_DEFAULT_FIELDS, SESSION_SHARE_FIELDS, SESSION_SHARE_MAX_ACTIVE_LINKS, SEXES, STARRED_EXERCISES_MAX, type ScheduleOverride, type ScheduleOverrideKind, type ScheduleOverridesQuery, type ScheduleOverridesResponse, type ScheduleRestAlertRequest, type ScheduleRestAlertResponse, type SessionComparisonExercise, type SessionComparisonQuery, type SessionComparisonResponse, type SessionComparisonRoutineDay, type SessionComparisonSession, type SessionComparisonSet, type SessionExerciseSubstitution, type SessionProgressNotification, type SessionRecapRecord, type SessionShare, type SessionShareField, type SessionShareListResponse, type SetAccountTimeZoneRequest, type SetLog, type Sex, type SharedSessionOwner, type SharedSessionRecap, type SkipOccurrenceRequest, type StarredExercise, type StarredExercisesResponse, type StartWorkoutRequest, type StartWorkoutResponse, type StreakMilestoneEventPayload, type SubstituteSessionExerciseRequest, type SubstituteSessionExerciseResponse, 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, type TrainingReminderPreference, type TrainingReminderPushPayload, USERNAME_MAX_LENGTH, USERNAME_MIN_LENGTH, USERNAME_PATTERN_SOURCE, type UpdateNotificationPreferencesRequest, 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, isWithinQuietHours, routineDayLabel };
|
|
1763
|
+
export { ACHIEVEMENT_CATEGORIES, ACHIEVEMENT_DEFINITIONS, type AchievementCategory, type AchievementCategoryProgress, type AchievementDefinition, type AchievementNotification, type AchievementUnlockedEventPayload, type AchievementsResponse, type AppNotification, type Brand, COMEBACK_MIN_INACTIVE_DAYS, COMEBACK_RECOGNITION_LIMIT, COMEBACK_REQUIRED_ACTIVE_DAYS, COMEBACK_SESSION_LOOKBACK, COMEBACK_WINDOW_DAYS, type CalendarDate, type ComebackRecognition, type ComebackRecognitionSummary, type CreateRoutineDayInput, type CreateRoutineExerciseInput, type CreateRoutineRequest, type CreateRoutineVersionRequest, type CreateSessionShareRequest, type DeletePushSubscriptionRequest, EXERCISE_EQUIPMENT, EXERCISE_MECHANICS, type EarnedAchievement, 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 ExercisePlateau, type ExerciseStrengthSummary, type ExerciseStrengthTrendPoint, type ExerciseStrengthTrendQuery, type ExerciseStrengthTrendResponse, FEATURED_PROFILE_ITEMS_MAX, FEATURED_PROFILE_ITEM_KINDS, FEATURED_PROFILE_REFERENCE_MAX_LENGTH, FOLLOW_SUGGESTIONS_DEFAULT_LIMIT, FOLLOW_SUGGESTIONS_MAX_LIMIT, FOLLOW_SUGGESTION_REASONS, type FeaturedProfileAchievementItem, type FeaturedProfileItem, type FeaturedProfileItemKind, type FeaturedProfileRankItem, type FeaturedProfileRecordItem, type FeaturedProfileSelection, type FeaturedProfileSelectionInput, type FeaturedProfileSelectionsResponse, type FinishStatus, type FinishWorkoutRequest, type FinishWorkoutResponse, type FollowSuggestion, type FollowSuggestionReason, type FollowSuggestionsResponse, type IsoDateString, type ListSessionsParams, MEASURABLE_GOALS_MAX, MEASURABLE_GOAL_DIRECTIONS, MEASURABLE_GOAL_TYPES, MINUTES_IN_DAY, MOVEMENT_PATTERNS, MUSCLE_GROUPS, type MarkNotificationsReadRequest, type MarkNotificationsReadResponse, type MeasurableGoal, type MeasurableGoalDirection, type MeasurableGoalExercise, type MeasurableGoalInput, type MeasurableGoalType, type MemberRoutinesResponse, type MoveOccurrenceRequest, type MovementPattern, type MuscleGroup, type MuscleGroupHeatmapQuery, type MuscleGroupHeatmapResponse, type MuscleGroupHeatmapValue, type MuscleGroupHeatmapWeek, type MuscleVolumeTrendSeries, NOTIFICATIONS_LIST_LIMIT, NOTIFICATIONS_LOOKBACK_DAYS, NOTIFICATIONS_RETENTION_DAYS, NOTIFICATION_CATEGORIES, NOTIFICATION_KINDS, type NewFollowerNotification, type NotificationCategory, type NotificationKind, type NotificationPreferences, type NotificationPreferencesResponse, type NotificationsResponse, PLATEAU_MIN_DAYS_SINCE_BEST, PLATEAU_MIN_SESSIONS, PLATEAU_MIN_SESSIONS_MAX, PLATEAU_MIN_SESSIONS_MIN, PLATEAU_RECENT_DAYS, PLATEAU_WINDOW_DAYS, 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, PUSH_PAYLOAD_KINDS, PUSH_SUBSCRIPTIONS_MAX, type PaginatedResponse, type PersonalGoalProgress, type PersonalGoalsResponse, type PersonalRecordEntry, type PersonalRecordKind, type PlannedReminder, type PlatePairInventory, type PlateauPreferences, type PlateauSet, type PlateausResponse, 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 PublicProfileAchievements, type PublicTrainingSummary, type PublicUserProfile, type PushPayload, type PushPayloadKind, type PushSubscriptionKeys, type PushSubscriptionSummary, type PushSubscriptionsResponse, type QuietHours, RELATIONSHIP_LIST_DEFAULT_LIMIT, RELATIONSHIP_LIST_KINDS, RELATIONSHIP_LIST_MAX_LIMIT, RENAISSANCE_RANK_DEFINITIONS, REP_TYPES, RESERVED_USERNAMES, REST_ALERT_MAX_LEAD_SECONDS, REST_ALERT_MIN_LEAD_SECONDS, REST_ALERT_REFUSALS, ROUTINE_DAYS_MAX, ROUTINE_DAY_NAME_MAX, ROUTINE_SCHEDULE_MODES, ROUTINE_SHARE_MAX_ACTIVE_LINKS, ROUTINE_VERSIONS_MAX, ROUTINE_VERSION_KINDS, ROUTINE_VERSION_NAME_MAX, ROUTINE_VISIBILITY_VALUES, type RecentActivityEntry, type RegisterPushSubscriptionRequest, type RelationshipListKind, type RelationshipListQuery, type RelationshipListResponse, type RelationshipMember, type RenaissanceRankDefinition, type RenaissanceRankProgress, type RepType, type ReplaceFeaturedProfileItemsRequest, type ReplaceMeasurableGoalsRequest, type ReplaceTrainingLocationsRequest, type RestAlertPushPayload, type RestAlertRefusal, type RestoreRoutineVersionResponse, type Routine, type RoutineDay, type RoutineDayId, type RoutineExercise, type RoutineId, type RoutineScheduleMode, type RoutineSet, type RoutineShare, type RoutineShareListResponse, type RoutineVersion, type RoutineVersionDay, type RoutineVersionExercise, type RoutineVersionKind, type RoutineVersionSetup, type RoutineVersionsResponse, type RoutineVisibility, SCHEDULE_MOVE_MAX_DAYS, SCHEDULE_OVERRIDES_MAX_RANGE_DAYS, SCHEDULE_OVERRIDE_KINDS, SCHEDULE_SKIP_PAST_DAYS, SESSION_SHARE_DEFAULT_FIELDS, SESSION_SHARE_FIELDS, SESSION_SHARE_MAX_ACTIVE_LINKS, SEXES, SHARED_ROUTINE_SOURCES, STARRED_EXERCISES_MAX, STREAK_MAX_GAP_DAYS, type ScheduleOverride, type ScheduleOverrideKind, type ScheduleOverridesQuery, type ScheduleOverridesResponse, type ScheduleRestAlertRequest, type ScheduleRestAlertResponse, type SessionComparisonExercise, type SessionComparisonQuery, type SessionComparisonResponse, type SessionComparisonRoutineDay, type SessionComparisonSession, type SessionComparisonSet, type SessionExerciseSubstitution, type SessionProgressNotification, type SessionRecapRecord, type SessionShare, type SessionShareField, type SessionShareListResponse, type SetAccountTimeZoneRequest, type SetLog, type Sex, type SharedRoutine, type SharedRoutineOwner, type SharedRoutineSource, type SharedRoutineSummary, type SharedSessionOwner, type SharedSessionRecap, type SkipOccurrenceRequest, type StarredExercise, type StarredExercisesResponse, type StartWorkoutRequest, type StartWorkoutResponse, type StreakAtRiskPushPayload, type StreakMilestoneEventPayload, type SubstituteSessionExerciseRequest, type SubstituteSessionExerciseResponse, 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, type TrainingReminderPreference, type TrainingReminderPushPayload, USERNAME_MAX_LENGTH, USERNAME_MIN_LENGTH, USERNAME_PATTERN_SOURCE, type UpdateNotificationPreferencesRequest, type UpdateProfileDiscoveryRequest, type UpdateProfilePrivacyRequest, type UpdateProfileRequest, type UpdateRoutineRequest, type UpdateRoutineVisibilityRequest, 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, isWithinQuietHours, routineDayLabel };
|
package/dist/index.js
CHANGED
|
@@ -316,6 +316,15 @@ var ROUTINE_VERSIONS_MAX = 20;
|
|
|
316
316
|
var ROUTINE_VERSION_NAME_MAX = 60;
|
|
317
317
|
var ROUTINE_VERSION_KINDS = ["SAVED", "BEFORE_RESTORE"];
|
|
318
318
|
|
|
319
|
+
// src/routine-sharing.ts
|
|
320
|
+
var ROUTINE_VISIBILITY_VALUES = [
|
|
321
|
+
"PRIVATE",
|
|
322
|
+
"FOLLOWERS",
|
|
323
|
+
"PUBLIC"
|
|
324
|
+
];
|
|
325
|
+
var ROUTINE_SHARE_MAX_ACTIVE_LINKS = 10;
|
|
326
|
+
var SHARED_ROUTINE_SOURCES = ["LINK", "VISIBILITY"];
|
|
327
|
+
|
|
319
328
|
// src/schedule.ts
|
|
320
329
|
var SCHEDULE_OVERRIDE_KINDS = ["MOVE", "SKIP"];
|
|
321
330
|
var SCHEDULE_MOVE_MAX_DAYS = 6;
|
|
@@ -370,7 +379,11 @@ var NOTIFICATIONS_LIST_LIMIT = 50;
|
|
|
370
379
|
|
|
371
380
|
// src/push.ts
|
|
372
381
|
var PUSH_SUBSCRIPTIONS_MAX = 10;
|
|
373
|
-
var PUSH_PAYLOAD_KINDS = [
|
|
382
|
+
var PUSH_PAYLOAD_KINDS = [
|
|
383
|
+
"REST_ALERT",
|
|
384
|
+
"TRAINING_REMINDER",
|
|
385
|
+
"STREAK_AT_RISK"
|
|
386
|
+
];
|
|
374
387
|
var REST_ALERT_MAX_LEAD_SECONDS = 3600;
|
|
375
388
|
var REST_ALERT_MIN_LEAD_SECONDS = 5;
|
|
376
389
|
var REST_ALERT_REFUSALS = [
|
|
@@ -389,7 +402,8 @@ var REST_ALERT_REFUSALS = [
|
|
|
389
402
|
// src/notification-preferences.ts
|
|
390
403
|
var NOTIFICATION_CATEGORIES = [
|
|
391
404
|
"REST_ALERT",
|
|
392
|
-
"TRAINING_REMINDER"
|
|
405
|
+
"TRAINING_REMINDER",
|
|
406
|
+
"STREAK_AT_RISK"
|
|
393
407
|
];
|
|
394
408
|
var MINUTES_IN_DAY = 1440;
|
|
395
409
|
function isWithinQuietHours(minuteOfDay, quietHours) {
|
|
@@ -398,6 +412,7 @@ function isWithinQuietHours(minuteOfDay, quietHours) {
|
|
|
398
412
|
if (startMinute === endMinute) return false;
|
|
399
413
|
return startMinute < endMinute ? minuteOfDay >= startMinute && minuteOfDay < endMinute : minuteOfDay >= startMinute || minuteOfDay < endMinute;
|
|
400
414
|
}
|
|
415
|
+
var STREAK_MAX_GAP_DAYS = 3;
|
|
401
416
|
export {
|
|
402
417
|
ACHIEVEMENT_CATEGORIES,
|
|
403
418
|
ACHIEVEMENT_DEFINITIONS,
|
|
@@ -454,9 +469,11 @@ export {
|
|
|
454
469
|
ROUTINE_DAYS_MAX,
|
|
455
470
|
ROUTINE_DAY_NAME_MAX,
|
|
456
471
|
ROUTINE_SCHEDULE_MODES,
|
|
472
|
+
ROUTINE_SHARE_MAX_ACTIVE_LINKS,
|
|
457
473
|
ROUTINE_VERSIONS_MAX,
|
|
458
474
|
ROUTINE_VERSION_KINDS,
|
|
459
475
|
ROUTINE_VERSION_NAME_MAX,
|
|
476
|
+
ROUTINE_VISIBILITY_VALUES,
|
|
460
477
|
SCHEDULE_MOVE_MAX_DAYS,
|
|
461
478
|
SCHEDULE_OVERRIDES_MAX_RANGE_DAYS,
|
|
462
479
|
SCHEDULE_OVERRIDE_KINDS,
|
|
@@ -465,7 +482,9 @@ export {
|
|
|
465
482
|
SESSION_SHARE_FIELDS,
|
|
466
483
|
SESSION_SHARE_MAX_ACTIVE_LINKS,
|
|
467
484
|
SEXES,
|
|
485
|
+
SHARED_ROUTINE_SOURCES,
|
|
468
486
|
STARRED_EXERCISES_MAX,
|
|
487
|
+
STREAK_MAX_GAP_DAYS,
|
|
469
488
|
TRAINING_DISCIPLINE_VALUES,
|
|
470
489
|
TRAINING_EVENT_TYPES,
|
|
471
490
|
TRAINING_EXPERIENCE_LEVEL_VALUES,
|