@sunsteel/contracts 0.48.0 → 0.50.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -22,6 +22,7 @@ var index_exports = {};
22
22
  __export(index_exports, {
23
23
  ACHIEVEMENT_CATEGORIES: () => ACHIEVEMENT_CATEGORIES,
24
24
  ACHIEVEMENT_DEFINITIONS: () => ACHIEVEMENT_DEFINITIONS,
25
+ CLONE_ROUTINE_REFUSALS: () => CLONE_ROUTINE_REFUSALS,
25
26
  COMEBACK_MIN_INACTIVE_DAYS: () => COMEBACK_MIN_INACTIVE_DAYS,
26
27
  COMEBACK_RECOGNITION_LIMIT: () => COMEBACK_RECOGNITION_LIMIT,
27
28
  COMEBACK_REQUIRED_ACTIVE_DAYS: () => COMEBACK_REQUIRED_ACTIVE_DAYS,
@@ -75,9 +76,11 @@ __export(index_exports, {
75
76
  ROUTINE_DAYS_MAX: () => ROUTINE_DAYS_MAX,
76
77
  ROUTINE_DAY_NAME_MAX: () => ROUTINE_DAY_NAME_MAX,
77
78
  ROUTINE_SCHEDULE_MODES: () => ROUTINE_SCHEDULE_MODES,
79
+ ROUTINE_SHARE_MAX_ACTIVE_LINKS: () => ROUTINE_SHARE_MAX_ACTIVE_LINKS,
78
80
  ROUTINE_VERSIONS_MAX: () => ROUTINE_VERSIONS_MAX,
79
81
  ROUTINE_VERSION_KINDS: () => ROUTINE_VERSION_KINDS,
80
82
  ROUTINE_VERSION_NAME_MAX: () => ROUTINE_VERSION_NAME_MAX,
83
+ ROUTINE_VISIBILITY_VALUES: () => ROUTINE_VISIBILITY_VALUES,
81
84
  SCHEDULE_MOVE_MAX_DAYS: () => SCHEDULE_MOVE_MAX_DAYS,
82
85
  SCHEDULE_OVERRIDES_MAX_RANGE_DAYS: () => SCHEDULE_OVERRIDES_MAX_RANGE_DAYS,
83
86
  SCHEDULE_OVERRIDE_KINDS: () => SCHEDULE_OVERRIDE_KINDS,
@@ -86,6 +89,7 @@ __export(index_exports, {
86
89
  SESSION_SHARE_FIELDS: () => SESSION_SHARE_FIELDS,
87
90
  SESSION_SHARE_MAX_ACTIVE_LINKS: () => SESSION_SHARE_MAX_ACTIVE_LINKS,
88
91
  SEXES: () => SEXES,
92
+ SHARED_ROUTINE_SOURCES: () => SHARED_ROUTINE_SOURCES,
89
93
  STARRED_EXERCISES_MAX: () => STARRED_EXERCISES_MAX,
90
94
  STREAK_MAX_GAP_DAYS: () => STREAK_MAX_GAP_DAYS,
91
95
  TRAINING_DISCIPLINE_VALUES: () => TRAINING_DISCIPLINE_VALUES,
@@ -215,7 +219,8 @@ var PREFERRED_TRAINING_STYLE_VALUES = [
215
219
  var FEATURED_PROFILE_ITEM_KINDS = [
216
220
  "RECORD",
217
221
  "ACHIEVEMENT",
218
- "RANK"
222
+ "RANK",
223
+ "ROUTINE"
219
224
  ];
220
225
  var FEATURED_PROFILE_ITEMS_MAX = 6;
221
226
  var FEATURED_PROFILE_REFERENCE_MAX_LENGTH = 100;
@@ -420,6 +425,21 @@ var ROUTINE_VERSIONS_MAX = 20;
420
425
  var ROUTINE_VERSION_NAME_MAX = 60;
421
426
  var ROUTINE_VERSION_KINDS = ["SAVED", "BEFORE_RESTORE"];
422
427
 
428
+ // src/routine-sharing.ts
429
+ var ROUTINE_VISIBILITY_VALUES = [
430
+ "PRIVATE",
431
+ "FOLLOWERS",
432
+ "PUBLIC"
433
+ ];
434
+ var ROUTINE_SHARE_MAX_ACTIVE_LINKS = 10;
435
+ var SHARED_ROUTINE_SOURCES = ["LINK", "VISIBILITY"];
436
+ var CLONE_ROUTINE_REFUSALS = {
437
+ /** Neither `token` nor `routineId`, or both at once. */
438
+ SOURCE_REQUIRED: "SOURCE_REQUIRED",
439
+ /** An exercise the routine programs is no longer in the catalog. */
440
+ UNKNOWN_EXERCISE: "UNKNOWN_EXERCISE"
441
+ };
442
+
423
443
  // src/schedule.ts
424
444
  var SCHEDULE_OVERRIDE_KINDS = ["MOVE", "SKIP"];
425
445
  var SCHEDULE_MOVE_MAX_DAYS = 6;
@@ -512,6 +532,7 @@ var STREAK_MAX_GAP_DAYS = 3;
512
532
  0 && (module.exports = {
513
533
  ACHIEVEMENT_CATEGORIES,
514
534
  ACHIEVEMENT_DEFINITIONS,
535
+ CLONE_ROUTINE_REFUSALS,
515
536
  COMEBACK_MIN_INACTIVE_DAYS,
516
537
  COMEBACK_RECOGNITION_LIMIT,
517
538
  COMEBACK_REQUIRED_ACTIVE_DAYS,
@@ -565,9 +586,11 @@ var STREAK_MAX_GAP_DAYS = 3;
565
586
  ROUTINE_DAYS_MAX,
566
587
  ROUTINE_DAY_NAME_MAX,
567
588
  ROUTINE_SCHEDULE_MODES,
589
+ ROUTINE_SHARE_MAX_ACTIVE_LINKS,
568
590
  ROUTINE_VERSIONS_MAX,
569
591
  ROUTINE_VERSION_KINDS,
570
592
  ROUTINE_VERSION_NAME_MAX,
593
+ ROUTINE_VISIBILITY_VALUES,
571
594
  SCHEDULE_MOVE_MAX_DAYS,
572
595
  SCHEDULE_OVERRIDES_MAX_RANGE_DAYS,
573
596
  SCHEDULE_OVERRIDE_KINDS,
@@ -576,6 +599,7 @@ var STREAK_MAX_GAP_DAYS = 3;
576
599
  SESSION_SHARE_FIELDS,
577
600
  SESSION_SHARE_MAX_ACTIVE_LINKS,
578
601
  SEXES,
602
+ SHARED_ROUTINE_SOURCES,
579
603
  STARRED_EXERCISES_MAX,
580
604
  STREAK_MAX_GAP_DAYS,
581
605
  TRAINING_DISCIPLINE_VALUES,
package/dist/index.d.cts CHANGED
@@ -812,6 +812,282 @@ interface AchievementsResponse {
812
812
  comeback: ComebackRecognitionSummary | null;
813
813
  }
814
814
 
815
+ /**
816
+ * ROUT-11: a WEEKLY routine ties each day to a weekday; a ROTATION routine
817
+ * runs its days in `order`, each after the last completed one, whatever the
818
+ * weekday.
819
+ */
820
+ declare const ROUTINE_SCHEDULE_MODES: readonly ["WEEKLY", "ROTATION"];
821
+ type RoutineScheduleMode = (typeof ROUTINE_SCHEDULE_MODES)[number];
822
+ /** At most seven days in either mode. */
823
+ declare const ROUTINE_DAYS_MAX = 7;
824
+ declare const ROUTINE_DAY_NAME_MAX = 40;
825
+ /**
826
+ * How a routine day is named everywhere, including history snapshots taken
827
+ * before ROUT-11: its own name, else its weekday, else its rotation letter
828
+ * ("Day A" for order 0).
829
+ */
830
+ declare function routineDayLabel(day: {
831
+ name?: string | null;
832
+ dayOfWeek?: number | null;
833
+ order?: number | null;
834
+ }): string;
835
+ interface RoutineSet {
836
+ setNumber: number;
837
+ repType: RepType;
838
+ reps?: number | null;
839
+ minReps?: number | null;
840
+ maxReps?: number | null;
841
+ weight?: number | null;
842
+ rir?: number | null;
843
+ }
844
+ interface RoutineExercise {
845
+ id: string;
846
+ order: number;
847
+ restSeconds: number;
848
+ note?: string | null;
849
+ progressionScheme: ProgressionScheme;
850
+ minWeightIncrement: number;
851
+ exercise: {
852
+ id: string;
853
+ name: string;
854
+ primaryMuscles?: MuscleGroup[];
855
+ secondaryMuscles?: MuscleGroup[];
856
+ };
857
+ sets: RoutineSet[];
858
+ }
859
+ interface CreateRoutineExerciseInput {
860
+ exerciseId: string;
861
+ order?: number;
862
+ restSeconds: number;
863
+ note?: string;
864
+ progressionScheme: ProgressionScheme;
865
+ minWeightIncrement: number;
866
+ sets: RoutineSet[];
867
+ }
868
+ interface RoutineDay {
869
+ id: string;
870
+ /** 0=Sun..6=Sat on a WEEKLY routine; null on a ROTATION routine. */
871
+ dayOfWeek: number | null;
872
+ /** Optional label such as "Push" or "Upper A" (see `routineDayLabel`). */
873
+ name: string | null;
874
+ /** Rotation sequence, 0-based; also the display order. */
875
+ order: number;
876
+ exercises: RoutineExercise[];
877
+ }
878
+ interface CreateRoutineDayInput {
879
+ /** Required and unique on a WEEKLY routine; omitted or null on a ROTATION. */
880
+ dayOfWeek?: number | null;
881
+ name?: string | null;
882
+ order?: number;
883
+ exercises: CreateRoutineExerciseInput[];
884
+ }
885
+ interface Routine {
886
+ id: string;
887
+ userId: string;
888
+ name: string;
889
+ description?: string | null;
890
+ isPeriodized: boolean;
891
+ isFavorite: boolean;
892
+ isCompleted: boolean;
893
+ scheduleMode: RoutineScheduleMode;
894
+ /**
895
+ * ROTATION only: the day after the one of the last completed session (an
896
+ * aborted session does not advance it), or the first day before any.
897
+ */
898
+ nextRotationDayId: string | null;
899
+ /**
900
+ * SCHED-07: weekdays (0=Sun..6=Sat) this weekly routine rests on by plan,
901
+ * never one of its training weekdays; always empty on a ROTATION routine.
902
+ */
903
+ restDays: number[];
904
+ /**
905
+ * SCHED-06: weekdays (0=Sun..6=Sat) a ROTATION routine trains on, sorted; the
906
+ * schedule places its days on them in order. Empty means any day, without
907
+ * dates; always empty on a WEEKLY routine.
908
+ */
909
+ rotationWeekdays: number[];
910
+ /**
911
+ * ROUT-04: who may read this routine, bounded by the account-level
912
+ * `PROF-06` routines rule. Owner-only field; it never appears in a shared
913
+ * read, where visibility is the reason the reader is there.
914
+ */
915
+ visibility: RoutineVisibility;
916
+ days: RoutineDay[];
917
+ createdAt: IsoDateString;
918
+ updatedAt: IsoDateString;
919
+ }
920
+ interface CreateRoutineRequest {
921
+ name: string;
922
+ description?: string;
923
+ isPeriodized: boolean;
924
+ /** Defaults to WEEKLY. Changing it on update requires `days`. */
925
+ scheduleMode?: RoutineScheduleMode;
926
+ /**
927
+ * Weekly routines only. Omitted on update keeps the stored rest days, minus
928
+ * any that became training weekdays.
929
+ */
930
+ restDays?: number[];
931
+ /**
932
+ * Rotation routines only. Omitted on update keeps the stored weekdays;
933
+ * switching to WEEKLY clears them.
934
+ */
935
+ rotationWeekdays?: number[];
936
+ days: CreateRoutineDayInput[];
937
+ }
938
+ type UpdateRoutineRequest = Partial<CreateRoutineRequest>;
939
+ /** A routine keeps at most this many versions; saving past it is refused. */
940
+ declare const ROUTINE_VERSIONS_MAX = 20;
941
+ declare const ROUTINE_VERSION_NAME_MAX = 60;
942
+ /**
943
+ * SAVED is an intentional save; BEFORE_RESTORE is the setup a restore
944
+ * replaced, saved automatically so the restore can be undone.
945
+ */
946
+ declare const ROUTINE_VERSION_KINDS: readonly ["SAVED", "BEFORE_RESTORE"];
947
+ type RoutineVersionKind = (typeof ROUTINE_VERSION_KINDS)[number];
948
+ interface RoutineVersionExercise {
949
+ /** The catalog exercise and its name when the version was saved. */
950
+ exercise: {
951
+ id: string;
952
+ name: string;
953
+ };
954
+ order: number;
955
+ restSeconds: number;
956
+ note: string | null;
957
+ progressionScheme: ProgressionScheme;
958
+ minWeightIncrement: number;
959
+ sets: RoutineSet[];
960
+ }
961
+ interface RoutineVersionDay {
962
+ dayOfWeek: number | null;
963
+ name: string | null;
964
+ order: number;
965
+ exercises: RoutineVersionExercise[];
966
+ }
967
+ /** Everything a routine edit can change, as it was when the version was saved. */
968
+ interface RoutineVersionSetup {
969
+ name: string;
970
+ description: string | null;
971
+ scheduleMode: RoutineScheduleMode;
972
+ restDays: number[];
973
+ /** SCHED-06; absent in versions saved before it, which means none. */
974
+ rotationWeekdays?: number[];
975
+ days: RoutineVersionDay[];
976
+ }
977
+ interface RoutineVersion {
978
+ id: string;
979
+ routineId: string;
980
+ /** 1, 2, 3… per routine, never reused after a deletion. */
981
+ number: number;
982
+ name: string | null;
983
+ kind: RoutineVersionKind;
984
+ /** BEFORE_RESTORE only: the number of the version that was restored. */
985
+ restoredVersionNumber: number | null;
986
+ createdAt: IsoDateString;
987
+ setup: RoutineVersionSetup;
988
+ }
989
+ /** `GET /routines/:id/versions`, newest first. */
990
+ interface RoutineVersionsResponse {
991
+ versions: RoutineVersion[];
992
+ max: number;
993
+ }
994
+ /** `POST /routines/:id/versions` */
995
+ interface CreateRoutineVersionRequest {
996
+ name?: string | null;
997
+ }
998
+ /** `POST /routines/:id/versions/:versionId/restore` */
999
+ interface RestoreRoutineVersionResponse {
1000
+ routine: Routine;
1001
+ /** The replaced setup, saved as a BEFORE_RESTORE version. */
1002
+ savedVersion: RoutineVersion;
1003
+ }
1004
+
1005
+ /**
1006
+ * Per-routine visibility. The account-level `PROF-06` routines rule is the
1007
+ * upper bound: a routine marked `PUBLIC` inside an account whose routines are
1008
+ * `FOLLOWERS` is visible to followers only, the same way `SOC-04` bounds
1009
+ * activity by the profile section it comes from.
1010
+ */
1011
+ declare const ROUTINE_VISIBILITY_VALUES: readonly ["PRIVATE", "FOLLOWERS", "PUBLIC"];
1012
+ type RoutineVisibility = (typeof ROUTINE_VISIBILITY_VALUES)[number];
1013
+ /** One routine keeps at most this many active links. */
1014
+ declare const ROUTINE_SHARE_MAX_ACTIVE_LINKS = 10;
1015
+ /** PUT /routines/:id/visibility */
1016
+ interface UpdateRoutineVisibilityRequest {
1017
+ visibility: RoutineVisibility;
1018
+ }
1019
+ /** An active share link, visible only to the routine's owner. */
1020
+ interface RoutineShare {
1021
+ id: string;
1022
+ routineId: string;
1023
+ /** Unguessable identifier used in the public `/shared/routines/:token` URL. */
1024
+ token: string;
1025
+ createdAt: IsoDateString;
1026
+ }
1027
+ /** Stable successful response of GET /routines/:id/shares. */
1028
+ interface RoutineShareListResponse {
1029
+ items: RoutineShare[];
1030
+ }
1031
+ interface SharedRoutineOwner {
1032
+ username: string;
1033
+ name: string;
1034
+ lastName?: string | null;
1035
+ avatarUrl?: string | null;
1036
+ }
1037
+ /**
1038
+ * How a reader reached a routine. A link is the owner's explicit consent for
1039
+ * that one routine and ignores visibility; a visibility read is governed by
1040
+ * both the routine's own rule and the account's.
1041
+ */
1042
+ declare const SHARED_ROUTINE_SOURCES: readonly ["LINK", "VISIBILITY"];
1043
+ type SharedRoutineSource = (typeof SHARED_ROUTINE_SOURCES)[number];
1044
+ /**
1045
+ * Stable successful response of the unauthenticated
1046
+ * GET /shared/routines/:token, and of the authenticated member read.
1047
+ */
1048
+ interface SharedRoutine {
1049
+ /** Kept so a future clone (`ROUT-05`) can record what it came from. */
1050
+ routineId: string;
1051
+ setup: RoutineVersionSetup;
1052
+ owner: SharedRoutineOwner;
1053
+ source: SharedRoutineSource;
1054
+ /** When the routine was last changed, not when it was shared. */
1055
+ updatedAt: IsoDateString;
1056
+ }
1057
+ /** A routine in a member's visible list, without loading its whole setup. */
1058
+ interface SharedRoutineSummary {
1059
+ routineId: string;
1060
+ name: string;
1061
+ description: string | null;
1062
+ scheduleMode: RoutineScheduleMode;
1063
+ dayCount: number;
1064
+ exerciseCount: number;
1065
+ updatedAt: IsoDateString;
1066
+ }
1067
+ /** Stable successful response of GET /users/:identifier/routines. */
1068
+ interface MemberRoutinesResponse {
1069
+ routines: SharedRoutineSummary[];
1070
+ }
1071
+ /**
1072
+ * POST /routines/clones. Exactly one source, matching the two ways a routine
1073
+ * can be read: `token` for a private link, `routineId` for one the viewer may
1074
+ * already see. Sending both, or neither, is refused.
1075
+ */
1076
+ interface CloneRoutineRequest {
1077
+ /** The `/shared/routines/:token` link the reader followed. */
1078
+ token?: string;
1079
+ /** A routine the viewer may read under `ROUT-04` visibility. */
1080
+ routineId?: string;
1081
+ }
1082
+ /** The refusals a clone states by name rather than as a bare 4xx. */
1083
+ declare const CLONE_ROUTINE_REFUSALS: {
1084
+ /** Neither `token` nor `routineId`, or both at once. */
1085
+ readonly SOURCE_REQUIRED: "SOURCE_REQUIRED";
1086
+ /** An exercise the routine programs is no longer in the catalog. */
1087
+ readonly UNKNOWN_EXERCISE: "UNKNOWN_EXERCISE";
1088
+ };
1089
+ type CloneRoutineRefusal = (typeof CLONE_ROUTINE_REFUSALS)[keyof typeof CLONE_ROUTINE_REFUSALS];
1090
+
815
1091
  declare const USERNAME_MIN_LENGTH = 3;
816
1092
  declare const USERNAME_MAX_LENGTH = 30;
817
1093
  declare const USERNAME_PATTERN_SOURCE = "^[a-z0-9][a-z0-9_-]{1,28}[a-z0-9]$";
@@ -879,7 +1155,12 @@ interface PublicBodyMetrics {
879
1155
  weightKg?: number | null;
880
1156
  heightCm?: number | null;
881
1157
  }
882
- declare const FEATURED_PROFILE_ITEM_KINDS: readonly ["RECORD", "ACHIEVEMENT", "RANK"];
1158
+ /**
1159
+ * `ROUTINE` is `PROF-08`: a shared routine is a fourth kind of featured item,
1160
+ * not a second showcase. It carries a `SharedRoutineSummary`, so a slot on a
1161
+ * profile still cannot express the owner's training.
1162
+ */
1163
+ declare const FEATURED_PROFILE_ITEM_KINDS: readonly ["RECORD", "ACHIEVEMENT", "RANK", "ROUTINE"];
883
1164
  type FeaturedProfileItemKind = (typeof FEATURED_PROFILE_ITEM_KINDS)[number];
884
1165
  declare const FEATURED_PROFILE_ITEMS_MAX = 6;
885
1166
  declare const FEATURED_PROFILE_REFERENCE_MAX_LENGTH = 100;
@@ -911,8 +1192,18 @@ interface FeaturedProfileRankItem extends FeaturedProfileItemBase {
911
1192
  kind: 'RANK';
912
1193
  rank: RenaissanceRankDefinition;
913
1194
  }
1195
+ /**
1196
+ * PROF-08. `referenceId` is the routine's id. It is resolved through the same
1197
+ * `ROUT-04` rule as every other read of somebody else's routine, so the
1198
+ * account-level `PROF-06` routines rule caps the routine's own visibility and
1199
+ * a slot the viewer may not see is omitted rather than emptied.
1200
+ */
1201
+ interface FeaturedProfileRoutineItem extends FeaturedProfileItemBase {
1202
+ kind: 'ROUTINE';
1203
+ routine: SharedRoutineSummary;
1204
+ }
914
1205
  /** Privacy-filtered, currently valid selections in owner-defined order. */
915
- type FeaturedProfileItem = FeaturedProfileRecordItem | FeaturedProfileAchievementItem | FeaturedProfileRankItem;
1206
+ type FeaturedProfileItem = FeaturedProfileRecordItem | FeaturedProfileAchievementItem | FeaturedProfileRankItem | FeaturedProfileRoutineItem;
916
1207
  /** Complete earned ledger allowed by the profile achievements privacy rule. */
917
1208
  interface PublicProfileAchievements {
918
1209
  rank: RenaissanceRankDefinition | null;
@@ -1179,190 +1470,6 @@ interface PersonalGoalsResponse {
1179
1470
  goals: PersonalGoalProgress[];
1180
1471
  }
1181
1472
 
1182
- /**
1183
- * ROUT-11: a WEEKLY routine ties each day to a weekday; a ROTATION routine
1184
- * runs its days in `order`, each after the last completed one, whatever the
1185
- * weekday.
1186
- */
1187
- declare const ROUTINE_SCHEDULE_MODES: readonly ["WEEKLY", "ROTATION"];
1188
- type RoutineScheduleMode = (typeof ROUTINE_SCHEDULE_MODES)[number];
1189
- /** At most seven days in either mode. */
1190
- declare const ROUTINE_DAYS_MAX = 7;
1191
- declare const ROUTINE_DAY_NAME_MAX = 40;
1192
- /**
1193
- * How a routine day is named everywhere, including history snapshots taken
1194
- * before ROUT-11: its own name, else its weekday, else its rotation letter
1195
- * ("Day A" for order 0).
1196
- */
1197
- declare function routineDayLabel(day: {
1198
- name?: string | null;
1199
- dayOfWeek?: number | null;
1200
- order?: number | null;
1201
- }): string;
1202
- interface RoutineSet {
1203
- setNumber: number;
1204
- repType: RepType;
1205
- reps?: number | null;
1206
- minReps?: number | null;
1207
- maxReps?: number | null;
1208
- weight?: number | null;
1209
- rir?: number | null;
1210
- }
1211
- interface RoutineExercise {
1212
- id: string;
1213
- order: number;
1214
- restSeconds: number;
1215
- note?: string | null;
1216
- progressionScheme: ProgressionScheme;
1217
- minWeightIncrement: number;
1218
- exercise: {
1219
- id: string;
1220
- name: string;
1221
- primaryMuscles?: MuscleGroup[];
1222
- secondaryMuscles?: MuscleGroup[];
1223
- };
1224
- sets: RoutineSet[];
1225
- }
1226
- interface CreateRoutineExerciseInput {
1227
- exerciseId: string;
1228
- order?: number;
1229
- restSeconds: number;
1230
- note?: string;
1231
- progressionScheme: ProgressionScheme;
1232
- minWeightIncrement: number;
1233
- sets: RoutineSet[];
1234
- }
1235
- interface RoutineDay {
1236
- id: string;
1237
- /** 0=Sun..6=Sat on a WEEKLY routine; null on a ROTATION routine. */
1238
- dayOfWeek: number | null;
1239
- /** Optional label such as "Push" or "Upper A" (see `routineDayLabel`). */
1240
- name: string | null;
1241
- /** Rotation sequence, 0-based; also the display order. */
1242
- order: number;
1243
- exercises: RoutineExercise[];
1244
- }
1245
- interface CreateRoutineDayInput {
1246
- /** Required and unique on a WEEKLY routine; omitted or null on a ROTATION. */
1247
- dayOfWeek?: number | null;
1248
- name?: string | null;
1249
- order?: number;
1250
- exercises: CreateRoutineExerciseInput[];
1251
- }
1252
- interface Routine {
1253
- id: string;
1254
- userId: string;
1255
- name: string;
1256
- description?: string | null;
1257
- isPeriodized: boolean;
1258
- isFavorite: boolean;
1259
- isCompleted: boolean;
1260
- scheduleMode: RoutineScheduleMode;
1261
- /**
1262
- * ROTATION only: the day after the one of the last completed session (an
1263
- * aborted session does not advance it), or the first day before any.
1264
- */
1265
- nextRotationDayId: string | null;
1266
- /**
1267
- * SCHED-07: weekdays (0=Sun..6=Sat) this weekly routine rests on by plan,
1268
- * never one of its training weekdays; always empty on a ROTATION routine.
1269
- */
1270
- restDays: number[];
1271
- /**
1272
- * SCHED-06: weekdays (0=Sun..6=Sat) a ROTATION routine trains on, sorted; the
1273
- * schedule places its days on them in order. Empty means any day, without
1274
- * dates; always empty on a WEEKLY routine.
1275
- */
1276
- rotationWeekdays: number[];
1277
- days: RoutineDay[];
1278
- createdAt: IsoDateString;
1279
- updatedAt: IsoDateString;
1280
- }
1281
- interface CreateRoutineRequest {
1282
- name: string;
1283
- description?: string;
1284
- isPeriodized: boolean;
1285
- /** Defaults to WEEKLY. Changing it on update requires `days`. */
1286
- scheduleMode?: RoutineScheduleMode;
1287
- /**
1288
- * Weekly routines only. Omitted on update keeps the stored rest days, minus
1289
- * any that became training weekdays.
1290
- */
1291
- restDays?: number[];
1292
- /**
1293
- * Rotation routines only. Omitted on update keeps the stored weekdays;
1294
- * switching to WEEKLY clears them.
1295
- */
1296
- rotationWeekdays?: number[];
1297
- days: CreateRoutineDayInput[];
1298
- }
1299
- type UpdateRoutineRequest = Partial<CreateRoutineRequest>;
1300
- /** A routine keeps at most this many versions; saving past it is refused. */
1301
- declare const ROUTINE_VERSIONS_MAX = 20;
1302
- declare const ROUTINE_VERSION_NAME_MAX = 60;
1303
- /**
1304
- * SAVED is an intentional save; BEFORE_RESTORE is the setup a restore
1305
- * replaced, saved automatically so the restore can be undone.
1306
- */
1307
- declare const ROUTINE_VERSION_KINDS: readonly ["SAVED", "BEFORE_RESTORE"];
1308
- type RoutineVersionKind = (typeof ROUTINE_VERSION_KINDS)[number];
1309
- interface RoutineVersionExercise {
1310
- /** The catalog exercise and its name when the version was saved. */
1311
- exercise: {
1312
- id: string;
1313
- name: string;
1314
- };
1315
- order: number;
1316
- restSeconds: number;
1317
- note: string | null;
1318
- progressionScheme: ProgressionScheme;
1319
- minWeightIncrement: number;
1320
- sets: RoutineSet[];
1321
- }
1322
- interface RoutineVersionDay {
1323
- dayOfWeek: number | null;
1324
- name: string | null;
1325
- order: number;
1326
- exercises: RoutineVersionExercise[];
1327
- }
1328
- /** Everything a routine edit can change, as it was when the version was saved. */
1329
- interface RoutineVersionSetup {
1330
- name: string;
1331
- description: string | null;
1332
- scheduleMode: RoutineScheduleMode;
1333
- restDays: number[];
1334
- /** SCHED-06; absent in versions saved before it, which means none. */
1335
- rotationWeekdays?: number[];
1336
- days: RoutineVersionDay[];
1337
- }
1338
- interface RoutineVersion {
1339
- id: string;
1340
- routineId: string;
1341
- /** 1, 2, 3… per routine, never reused after a deletion. */
1342
- number: number;
1343
- name: string | null;
1344
- kind: RoutineVersionKind;
1345
- /** BEFORE_RESTORE only: the number of the version that was restored. */
1346
- restoredVersionNumber: number | null;
1347
- createdAt: IsoDateString;
1348
- setup: RoutineVersionSetup;
1349
- }
1350
- /** `GET /routines/:id/versions`, newest first. */
1351
- interface RoutineVersionsResponse {
1352
- versions: RoutineVersion[];
1353
- max: number;
1354
- }
1355
- /** `POST /routines/:id/versions` */
1356
- interface CreateRoutineVersionRequest {
1357
- name?: string | null;
1358
- }
1359
- /** `POST /routines/:id/versions/:versionId/restore` */
1360
- interface RestoreRoutineVersionResponse {
1361
- routine: Routine;
1362
- /** The replaced setup, saved as a BEFORE_RESTORE version. */
1363
- savedVersion: RoutineVersion;
1364
- }
1365
-
1366
1473
  /** A local calendar date, YYYY-MM-DD. */
1367
1474
  type CalendarDate = string;
1368
1475
  /**
@@ -1687,4 +1794,4 @@ interface PlannedReminder {
1687
1794
  routineNames: string[];
1688
1795
  }
1689
1796
 
1690
- 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, 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 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 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 };
1797
+ export { ACHIEVEMENT_CATEGORIES, ACHIEVEMENT_DEFINITIONS, type AchievementCategory, type AchievementCategoryProgress, type AchievementDefinition, type AchievementNotification, type AchievementUnlockedEventPayload, type AchievementsResponse, type AppNotification, type Brand, CLONE_ROUTINE_REFUSALS, COMEBACK_MIN_INACTIVE_DAYS, COMEBACK_RECOGNITION_LIMIT, COMEBACK_REQUIRED_ACTIVE_DAYS, COMEBACK_SESSION_LOOKBACK, COMEBACK_WINDOW_DAYS, type CalendarDate, type CloneRoutineRefusal, type CloneRoutineRequest, 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 FeaturedProfileRoutineItem, 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
@@ -812,6 +812,282 @@ interface AchievementsResponse {
812
812
  comeback: ComebackRecognitionSummary | null;
813
813
  }
814
814
 
815
+ /**
816
+ * ROUT-11: a WEEKLY routine ties each day to a weekday; a ROTATION routine
817
+ * runs its days in `order`, each after the last completed one, whatever the
818
+ * weekday.
819
+ */
820
+ declare const ROUTINE_SCHEDULE_MODES: readonly ["WEEKLY", "ROTATION"];
821
+ type RoutineScheduleMode = (typeof ROUTINE_SCHEDULE_MODES)[number];
822
+ /** At most seven days in either mode. */
823
+ declare const ROUTINE_DAYS_MAX = 7;
824
+ declare const ROUTINE_DAY_NAME_MAX = 40;
825
+ /**
826
+ * How a routine day is named everywhere, including history snapshots taken
827
+ * before ROUT-11: its own name, else its weekday, else its rotation letter
828
+ * ("Day A" for order 0).
829
+ */
830
+ declare function routineDayLabel(day: {
831
+ name?: string | null;
832
+ dayOfWeek?: number | null;
833
+ order?: number | null;
834
+ }): string;
835
+ interface RoutineSet {
836
+ setNumber: number;
837
+ repType: RepType;
838
+ reps?: number | null;
839
+ minReps?: number | null;
840
+ maxReps?: number | null;
841
+ weight?: number | null;
842
+ rir?: number | null;
843
+ }
844
+ interface RoutineExercise {
845
+ id: string;
846
+ order: number;
847
+ restSeconds: number;
848
+ note?: string | null;
849
+ progressionScheme: ProgressionScheme;
850
+ minWeightIncrement: number;
851
+ exercise: {
852
+ id: string;
853
+ name: string;
854
+ primaryMuscles?: MuscleGroup[];
855
+ secondaryMuscles?: MuscleGroup[];
856
+ };
857
+ sets: RoutineSet[];
858
+ }
859
+ interface CreateRoutineExerciseInput {
860
+ exerciseId: string;
861
+ order?: number;
862
+ restSeconds: number;
863
+ note?: string;
864
+ progressionScheme: ProgressionScheme;
865
+ minWeightIncrement: number;
866
+ sets: RoutineSet[];
867
+ }
868
+ interface RoutineDay {
869
+ id: string;
870
+ /** 0=Sun..6=Sat on a WEEKLY routine; null on a ROTATION routine. */
871
+ dayOfWeek: number | null;
872
+ /** Optional label such as "Push" or "Upper A" (see `routineDayLabel`). */
873
+ name: string | null;
874
+ /** Rotation sequence, 0-based; also the display order. */
875
+ order: number;
876
+ exercises: RoutineExercise[];
877
+ }
878
+ interface CreateRoutineDayInput {
879
+ /** Required and unique on a WEEKLY routine; omitted or null on a ROTATION. */
880
+ dayOfWeek?: number | null;
881
+ name?: string | null;
882
+ order?: number;
883
+ exercises: CreateRoutineExerciseInput[];
884
+ }
885
+ interface Routine {
886
+ id: string;
887
+ userId: string;
888
+ name: string;
889
+ description?: string | null;
890
+ isPeriodized: boolean;
891
+ isFavorite: boolean;
892
+ isCompleted: boolean;
893
+ scheduleMode: RoutineScheduleMode;
894
+ /**
895
+ * ROTATION only: the day after the one of the last completed session (an
896
+ * aborted session does not advance it), or the first day before any.
897
+ */
898
+ nextRotationDayId: string | null;
899
+ /**
900
+ * SCHED-07: weekdays (0=Sun..6=Sat) this weekly routine rests on by plan,
901
+ * never one of its training weekdays; always empty on a ROTATION routine.
902
+ */
903
+ restDays: number[];
904
+ /**
905
+ * SCHED-06: weekdays (0=Sun..6=Sat) a ROTATION routine trains on, sorted; the
906
+ * schedule places its days on them in order. Empty means any day, without
907
+ * dates; always empty on a WEEKLY routine.
908
+ */
909
+ rotationWeekdays: number[];
910
+ /**
911
+ * ROUT-04: who may read this routine, bounded by the account-level
912
+ * `PROF-06` routines rule. Owner-only field; it never appears in a shared
913
+ * read, where visibility is the reason the reader is there.
914
+ */
915
+ visibility: RoutineVisibility;
916
+ days: RoutineDay[];
917
+ createdAt: IsoDateString;
918
+ updatedAt: IsoDateString;
919
+ }
920
+ interface CreateRoutineRequest {
921
+ name: string;
922
+ description?: string;
923
+ isPeriodized: boolean;
924
+ /** Defaults to WEEKLY. Changing it on update requires `days`. */
925
+ scheduleMode?: RoutineScheduleMode;
926
+ /**
927
+ * Weekly routines only. Omitted on update keeps the stored rest days, minus
928
+ * any that became training weekdays.
929
+ */
930
+ restDays?: number[];
931
+ /**
932
+ * Rotation routines only. Omitted on update keeps the stored weekdays;
933
+ * switching to WEEKLY clears them.
934
+ */
935
+ rotationWeekdays?: number[];
936
+ days: CreateRoutineDayInput[];
937
+ }
938
+ type UpdateRoutineRequest = Partial<CreateRoutineRequest>;
939
+ /** A routine keeps at most this many versions; saving past it is refused. */
940
+ declare const ROUTINE_VERSIONS_MAX = 20;
941
+ declare const ROUTINE_VERSION_NAME_MAX = 60;
942
+ /**
943
+ * SAVED is an intentional save; BEFORE_RESTORE is the setup a restore
944
+ * replaced, saved automatically so the restore can be undone.
945
+ */
946
+ declare const ROUTINE_VERSION_KINDS: readonly ["SAVED", "BEFORE_RESTORE"];
947
+ type RoutineVersionKind = (typeof ROUTINE_VERSION_KINDS)[number];
948
+ interface RoutineVersionExercise {
949
+ /** The catalog exercise and its name when the version was saved. */
950
+ exercise: {
951
+ id: string;
952
+ name: string;
953
+ };
954
+ order: number;
955
+ restSeconds: number;
956
+ note: string | null;
957
+ progressionScheme: ProgressionScheme;
958
+ minWeightIncrement: number;
959
+ sets: RoutineSet[];
960
+ }
961
+ interface RoutineVersionDay {
962
+ dayOfWeek: number | null;
963
+ name: string | null;
964
+ order: number;
965
+ exercises: RoutineVersionExercise[];
966
+ }
967
+ /** Everything a routine edit can change, as it was when the version was saved. */
968
+ interface RoutineVersionSetup {
969
+ name: string;
970
+ description: string | null;
971
+ scheduleMode: RoutineScheduleMode;
972
+ restDays: number[];
973
+ /** SCHED-06; absent in versions saved before it, which means none. */
974
+ rotationWeekdays?: number[];
975
+ days: RoutineVersionDay[];
976
+ }
977
+ interface RoutineVersion {
978
+ id: string;
979
+ routineId: string;
980
+ /** 1, 2, 3… per routine, never reused after a deletion. */
981
+ number: number;
982
+ name: string | null;
983
+ kind: RoutineVersionKind;
984
+ /** BEFORE_RESTORE only: the number of the version that was restored. */
985
+ restoredVersionNumber: number | null;
986
+ createdAt: IsoDateString;
987
+ setup: RoutineVersionSetup;
988
+ }
989
+ /** `GET /routines/:id/versions`, newest first. */
990
+ interface RoutineVersionsResponse {
991
+ versions: RoutineVersion[];
992
+ max: number;
993
+ }
994
+ /** `POST /routines/:id/versions` */
995
+ interface CreateRoutineVersionRequest {
996
+ name?: string | null;
997
+ }
998
+ /** `POST /routines/:id/versions/:versionId/restore` */
999
+ interface RestoreRoutineVersionResponse {
1000
+ routine: Routine;
1001
+ /** The replaced setup, saved as a BEFORE_RESTORE version. */
1002
+ savedVersion: RoutineVersion;
1003
+ }
1004
+
1005
+ /**
1006
+ * Per-routine visibility. The account-level `PROF-06` routines rule is the
1007
+ * upper bound: a routine marked `PUBLIC` inside an account whose routines are
1008
+ * `FOLLOWERS` is visible to followers only, the same way `SOC-04` bounds
1009
+ * activity by the profile section it comes from.
1010
+ */
1011
+ declare const ROUTINE_VISIBILITY_VALUES: readonly ["PRIVATE", "FOLLOWERS", "PUBLIC"];
1012
+ type RoutineVisibility = (typeof ROUTINE_VISIBILITY_VALUES)[number];
1013
+ /** One routine keeps at most this many active links. */
1014
+ declare const ROUTINE_SHARE_MAX_ACTIVE_LINKS = 10;
1015
+ /** PUT /routines/:id/visibility */
1016
+ interface UpdateRoutineVisibilityRequest {
1017
+ visibility: RoutineVisibility;
1018
+ }
1019
+ /** An active share link, visible only to the routine's owner. */
1020
+ interface RoutineShare {
1021
+ id: string;
1022
+ routineId: string;
1023
+ /** Unguessable identifier used in the public `/shared/routines/:token` URL. */
1024
+ token: string;
1025
+ createdAt: IsoDateString;
1026
+ }
1027
+ /** Stable successful response of GET /routines/:id/shares. */
1028
+ interface RoutineShareListResponse {
1029
+ items: RoutineShare[];
1030
+ }
1031
+ interface SharedRoutineOwner {
1032
+ username: string;
1033
+ name: string;
1034
+ lastName?: string | null;
1035
+ avatarUrl?: string | null;
1036
+ }
1037
+ /**
1038
+ * How a reader reached a routine. A link is the owner's explicit consent for
1039
+ * that one routine and ignores visibility; a visibility read is governed by
1040
+ * both the routine's own rule and the account's.
1041
+ */
1042
+ declare const SHARED_ROUTINE_SOURCES: readonly ["LINK", "VISIBILITY"];
1043
+ type SharedRoutineSource = (typeof SHARED_ROUTINE_SOURCES)[number];
1044
+ /**
1045
+ * Stable successful response of the unauthenticated
1046
+ * GET /shared/routines/:token, and of the authenticated member read.
1047
+ */
1048
+ interface SharedRoutine {
1049
+ /** Kept so a future clone (`ROUT-05`) can record what it came from. */
1050
+ routineId: string;
1051
+ setup: RoutineVersionSetup;
1052
+ owner: SharedRoutineOwner;
1053
+ source: SharedRoutineSource;
1054
+ /** When the routine was last changed, not when it was shared. */
1055
+ updatedAt: IsoDateString;
1056
+ }
1057
+ /** A routine in a member's visible list, without loading its whole setup. */
1058
+ interface SharedRoutineSummary {
1059
+ routineId: string;
1060
+ name: string;
1061
+ description: string | null;
1062
+ scheduleMode: RoutineScheduleMode;
1063
+ dayCount: number;
1064
+ exerciseCount: number;
1065
+ updatedAt: IsoDateString;
1066
+ }
1067
+ /** Stable successful response of GET /users/:identifier/routines. */
1068
+ interface MemberRoutinesResponse {
1069
+ routines: SharedRoutineSummary[];
1070
+ }
1071
+ /**
1072
+ * POST /routines/clones. Exactly one source, matching the two ways a routine
1073
+ * can be read: `token` for a private link, `routineId` for one the viewer may
1074
+ * already see. Sending both, or neither, is refused.
1075
+ */
1076
+ interface CloneRoutineRequest {
1077
+ /** The `/shared/routines/:token` link the reader followed. */
1078
+ token?: string;
1079
+ /** A routine the viewer may read under `ROUT-04` visibility. */
1080
+ routineId?: string;
1081
+ }
1082
+ /** The refusals a clone states by name rather than as a bare 4xx. */
1083
+ declare const CLONE_ROUTINE_REFUSALS: {
1084
+ /** Neither `token` nor `routineId`, or both at once. */
1085
+ readonly SOURCE_REQUIRED: "SOURCE_REQUIRED";
1086
+ /** An exercise the routine programs is no longer in the catalog. */
1087
+ readonly UNKNOWN_EXERCISE: "UNKNOWN_EXERCISE";
1088
+ };
1089
+ type CloneRoutineRefusal = (typeof CLONE_ROUTINE_REFUSALS)[keyof typeof CLONE_ROUTINE_REFUSALS];
1090
+
815
1091
  declare const USERNAME_MIN_LENGTH = 3;
816
1092
  declare const USERNAME_MAX_LENGTH = 30;
817
1093
  declare const USERNAME_PATTERN_SOURCE = "^[a-z0-9][a-z0-9_-]{1,28}[a-z0-9]$";
@@ -879,7 +1155,12 @@ interface PublicBodyMetrics {
879
1155
  weightKg?: number | null;
880
1156
  heightCm?: number | null;
881
1157
  }
882
- declare const FEATURED_PROFILE_ITEM_KINDS: readonly ["RECORD", "ACHIEVEMENT", "RANK"];
1158
+ /**
1159
+ * `ROUTINE` is `PROF-08`: a shared routine is a fourth kind of featured item,
1160
+ * not a second showcase. It carries a `SharedRoutineSummary`, so a slot on a
1161
+ * profile still cannot express the owner's training.
1162
+ */
1163
+ declare const FEATURED_PROFILE_ITEM_KINDS: readonly ["RECORD", "ACHIEVEMENT", "RANK", "ROUTINE"];
883
1164
  type FeaturedProfileItemKind = (typeof FEATURED_PROFILE_ITEM_KINDS)[number];
884
1165
  declare const FEATURED_PROFILE_ITEMS_MAX = 6;
885
1166
  declare const FEATURED_PROFILE_REFERENCE_MAX_LENGTH = 100;
@@ -911,8 +1192,18 @@ interface FeaturedProfileRankItem extends FeaturedProfileItemBase {
911
1192
  kind: 'RANK';
912
1193
  rank: RenaissanceRankDefinition;
913
1194
  }
1195
+ /**
1196
+ * PROF-08. `referenceId` is the routine's id. It is resolved through the same
1197
+ * `ROUT-04` rule as every other read of somebody else's routine, so the
1198
+ * account-level `PROF-06` routines rule caps the routine's own visibility and
1199
+ * a slot the viewer may not see is omitted rather than emptied.
1200
+ */
1201
+ interface FeaturedProfileRoutineItem extends FeaturedProfileItemBase {
1202
+ kind: 'ROUTINE';
1203
+ routine: SharedRoutineSummary;
1204
+ }
914
1205
  /** Privacy-filtered, currently valid selections in owner-defined order. */
915
- type FeaturedProfileItem = FeaturedProfileRecordItem | FeaturedProfileAchievementItem | FeaturedProfileRankItem;
1206
+ type FeaturedProfileItem = FeaturedProfileRecordItem | FeaturedProfileAchievementItem | FeaturedProfileRankItem | FeaturedProfileRoutineItem;
916
1207
  /** Complete earned ledger allowed by the profile achievements privacy rule. */
917
1208
  interface PublicProfileAchievements {
918
1209
  rank: RenaissanceRankDefinition | null;
@@ -1179,190 +1470,6 @@ interface PersonalGoalsResponse {
1179
1470
  goals: PersonalGoalProgress[];
1180
1471
  }
1181
1472
 
1182
- /**
1183
- * ROUT-11: a WEEKLY routine ties each day to a weekday; a ROTATION routine
1184
- * runs its days in `order`, each after the last completed one, whatever the
1185
- * weekday.
1186
- */
1187
- declare const ROUTINE_SCHEDULE_MODES: readonly ["WEEKLY", "ROTATION"];
1188
- type RoutineScheduleMode = (typeof ROUTINE_SCHEDULE_MODES)[number];
1189
- /** At most seven days in either mode. */
1190
- declare const ROUTINE_DAYS_MAX = 7;
1191
- declare const ROUTINE_DAY_NAME_MAX = 40;
1192
- /**
1193
- * How a routine day is named everywhere, including history snapshots taken
1194
- * before ROUT-11: its own name, else its weekday, else its rotation letter
1195
- * ("Day A" for order 0).
1196
- */
1197
- declare function routineDayLabel(day: {
1198
- name?: string | null;
1199
- dayOfWeek?: number | null;
1200
- order?: number | null;
1201
- }): string;
1202
- interface RoutineSet {
1203
- setNumber: number;
1204
- repType: RepType;
1205
- reps?: number | null;
1206
- minReps?: number | null;
1207
- maxReps?: number | null;
1208
- weight?: number | null;
1209
- rir?: number | null;
1210
- }
1211
- interface RoutineExercise {
1212
- id: string;
1213
- order: number;
1214
- restSeconds: number;
1215
- note?: string | null;
1216
- progressionScheme: ProgressionScheme;
1217
- minWeightIncrement: number;
1218
- exercise: {
1219
- id: string;
1220
- name: string;
1221
- primaryMuscles?: MuscleGroup[];
1222
- secondaryMuscles?: MuscleGroup[];
1223
- };
1224
- sets: RoutineSet[];
1225
- }
1226
- interface CreateRoutineExerciseInput {
1227
- exerciseId: string;
1228
- order?: number;
1229
- restSeconds: number;
1230
- note?: string;
1231
- progressionScheme: ProgressionScheme;
1232
- minWeightIncrement: number;
1233
- sets: RoutineSet[];
1234
- }
1235
- interface RoutineDay {
1236
- id: string;
1237
- /** 0=Sun..6=Sat on a WEEKLY routine; null on a ROTATION routine. */
1238
- dayOfWeek: number | null;
1239
- /** Optional label such as "Push" or "Upper A" (see `routineDayLabel`). */
1240
- name: string | null;
1241
- /** Rotation sequence, 0-based; also the display order. */
1242
- order: number;
1243
- exercises: RoutineExercise[];
1244
- }
1245
- interface CreateRoutineDayInput {
1246
- /** Required and unique on a WEEKLY routine; omitted or null on a ROTATION. */
1247
- dayOfWeek?: number | null;
1248
- name?: string | null;
1249
- order?: number;
1250
- exercises: CreateRoutineExerciseInput[];
1251
- }
1252
- interface Routine {
1253
- id: string;
1254
- userId: string;
1255
- name: string;
1256
- description?: string | null;
1257
- isPeriodized: boolean;
1258
- isFavorite: boolean;
1259
- isCompleted: boolean;
1260
- scheduleMode: RoutineScheduleMode;
1261
- /**
1262
- * ROTATION only: the day after the one of the last completed session (an
1263
- * aborted session does not advance it), or the first day before any.
1264
- */
1265
- nextRotationDayId: string | null;
1266
- /**
1267
- * SCHED-07: weekdays (0=Sun..6=Sat) this weekly routine rests on by plan,
1268
- * never one of its training weekdays; always empty on a ROTATION routine.
1269
- */
1270
- restDays: number[];
1271
- /**
1272
- * SCHED-06: weekdays (0=Sun..6=Sat) a ROTATION routine trains on, sorted; the
1273
- * schedule places its days on them in order. Empty means any day, without
1274
- * dates; always empty on a WEEKLY routine.
1275
- */
1276
- rotationWeekdays: number[];
1277
- days: RoutineDay[];
1278
- createdAt: IsoDateString;
1279
- updatedAt: IsoDateString;
1280
- }
1281
- interface CreateRoutineRequest {
1282
- name: string;
1283
- description?: string;
1284
- isPeriodized: boolean;
1285
- /** Defaults to WEEKLY. Changing it on update requires `days`. */
1286
- scheduleMode?: RoutineScheduleMode;
1287
- /**
1288
- * Weekly routines only. Omitted on update keeps the stored rest days, minus
1289
- * any that became training weekdays.
1290
- */
1291
- restDays?: number[];
1292
- /**
1293
- * Rotation routines only. Omitted on update keeps the stored weekdays;
1294
- * switching to WEEKLY clears them.
1295
- */
1296
- rotationWeekdays?: number[];
1297
- days: CreateRoutineDayInput[];
1298
- }
1299
- type UpdateRoutineRequest = Partial<CreateRoutineRequest>;
1300
- /** A routine keeps at most this many versions; saving past it is refused. */
1301
- declare const ROUTINE_VERSIONS_MAX = 20;
1302
- declare const ROUTINE_VERSION_NAME_MAX = 60;
1303
- /**
1304
- * SAVED is an intentional save; BEFORE_RESTORE is the setup a restore
1305
- * replaced, saved automatically so the restore can be undone.
1306
- */
1307
- declare const ROUTINE_VERSION_KINDS: readonly ["SAVED", "BEFORE_RESTORE"];
1308
- type RoutineVersionKind = (typeof ROUTINE_VERSION_KINDS)[number];
1309
- interface RoutineVersionExercise {
1310
- /** The catalog exercise and its name when the version was saved. */
1311
- exercise: {
1312
- id: string;
1313
- name: string;
1314
- };
1315
- order: number;
1316
- restSeconds: number;
1317
- note: string | null;
1318
- progressionScheme: ProgressionScheme;
1319
- minWeightIncrement: number;
1320
- sets: RoutineSet[];
1321
- }
1322
- interface RoutineVersionDay {
1323
- dayOfWeek: number | null;
1324
- name: string | null;
1325
- order: number;
1326
- exercises: RoutineVersionExercise[];
1327
- }
1328
- /** Everything a routine edit can change, as it was when the version was saved. */
1329
- interface RoutineVersionSetup {
1330
- name: string;
1331
- description: string | null;
1332
- scheduleMode: RoutineScheduleMode;
1333
- restDays: number[];
1334
- /** SCHED-06; absent in versions saved before it, which means none. */
1335
- rotationWeekdays?: number[];
1336
- days: RoutineVersionDay[];
1337
- }
1338
- interface RoutineVersion {
1339
- id: string;
1340
- routineId: string;
1341
- /** 1, 2, 3… per routine, never reused after a deletion. */
1342
- number: number;
1343
- name: string | null;
1344
- kind: RoutineVersionKind;
1345
- /** BEFORE_RESTORE only: the number of the version that was restored. */
1346
- restoredVersionNumber: number | null;
1347
- createdAt: IsoDateString;
1348
- setup: RoutineVersionSetup;
1349
- }
1350
- /** `GET /routines/:id/versions`, newest first. */
1351
- interface RoutineVersionsResponse {
1352
- versions: RoutineVersion[];
1353
- max: number;
1354
- }
1355
- /** `POST /routines/:id/versions` */
1356
- interface CreateRoutineVersionRequest {
1357
- name?: string | null;
1358
- }
1359
- /** `POST /routines/:id/versions/:versionId/restore` */
1360
- interface RestoreRoutineVersionResponse {
1361
- routine: Routine;
1362
- /** The replaced setup, saved as a BEFORE_RESTORE version. */
1363
- savedVersion: RoutineVersion;
1364
- }
1365
-
1366
1473
  /** A local calendar date, YYYY-MM-DD. */
1367
1474
  type CalendarDate = string;
1368
1475
  /**
@@ -1687,4 +1794,4 @@ interface PlannedReminder {
1687
1794
  routineNames: string[];
1688
1795
  }
1689
1796
 
1690
- 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, 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 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 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 };
1797
+ export { ACHIEVEMENT_CATEGORIES, ACHIEVEMENT_DEFINITIONS, type AchievementCategory, type AchievementCategoryProgress, type AchievementDefinition, type AchievementNotification, type AchievementUnlockedEventPayload, type AchievementsResponse, type AppNotification, type Brand, CLONE_ROUTINE_REFUSALS, COMEBACK_MIN_INACTIVE_DAYS, COMEBACK_RECOGNITION_LIMIT, COMEBACK_REQUIRED_ACTIVE_DAYS, COMEBACK_SESSION_LOOKBACK, COMEBACK_WINDOW_DAYS, type CalendarDate, type CloneRoutineRefusal, type CloneRoutineRequest, 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 FeaturedProfileRoutineItem, 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
@@ -111,7 +111,8 @@ var PREFERRED_TRAINING_STYLE_VALUES = [
111
111
  var FEATURED_PROFILE_ITEM_KINDS = [
112
112
  "RECORD",
113
113
  "ACHIEVEMENT",
114
- "RANK"
114
+ "RANK",
115
+ "ROUTINE"
115
116
  ];
116
117
  var FEATURED_PROFILE_ITEMS_MAX = 6;
117
118
  var FEATURED_PROFILE_REFERENCE_MAX_LENGTH = 100;
@@ -316,6 +317,21 @@ var ROUTINE_VERSIONS_MAX = 20;
316
317
  var ROUTINE_VERSION_NAME_MAX = 60;
317
318
  var ROUTINE_VERSION_KINDS = ["SAVED", "BEFORE_RESTORE"];
318
319
 
320
+ // src/routine-sharing.ts
321
+ var ROUTINE_VISIBILITY_VALUES = [
322
+ "PRIVATE",
323
+ "FOLLOWERS",
324
+ "PUBLIC"
325
+ ];
326
+ var ROUTINE_SHARE_MAX_ACTIVE_LINKS = 10;
327
+ var SHARED_ROUTINE_SOURCES = ["LINK", "VISIBILITY"];
328
+ var CLONE_ROUTINE_REFUSALS = {
329
+ /** Neither `token` nor `routineId`, or both at once. */
330
+ SOURCE_REQUIRED: "SOURCE_REQUIRED",
331
+ /** An exercise the routine programs is no longer in the catalog. */
332
+ UNKNOWN_EXERCISE: "UNKNOWN_EXERCISE"
333
+ };
334
+
319
335
  // src/schedule.ts
320
336
  var SCHEDULE_OVERRIDE_KINDS = ["MOVE", "SKIP"];
321
337
  var SCHEDULE_MOVE_MAX_DAYS = 6;
@@ -407,6 +423,7 @@ var STREAK_MAX_GAP_DAYS = 3;
407
423
  export {
408
424
  ACHIEVEMENT_CATEGORIES,
409
425
  ACHIEVEMENT_DEFINITIONS,
426
+ CLONE_ROUTINE_REFUSALS,
410
427
  COMEBACK_MIN_INACTIVE_DAYS,
411
428
  COMEBACK_RECOGNITION_LIMIT,
412
429
  COMEBACK_REQUIRED_ACTIVE_DAYS,
@@ -460,9 +477,11 @@ export {
460
477
  ROUTINE_DAYS_MAX,
461
478
  ROUTINE_DAY_NAME_MAX,
462
479
  ROUTINE_SCHEDULE_MODES,
480
+ ROUTINE_SHARE_MAX_ACTIVE_LINKS,
463
481
  ROUTINE_VERSIONS_MAX,
464
482
  ROUTINE_VERSION_KINDS,
465
483
  ROUTINE_VERSION_NAME_MAX,
484
+ ROUTINE_VISIBILITY_VALUES,
466
485
  SCHEDULE_MOVE_MAX_DAYS,
467
486
  SCHEDULE_OVERRIDES_MAX_RANGE_DAYS,
468
487
  SCHEDULE_OVERRIDE_KINDS,
@@ -471,6 +490,7 @@ export {
471
490
  SESSION_SHARE_FIELDS,
472
491
  SESSION_SHARE_MAX_ACTIVE_LINKS,
473
492
  SEXES,
493
+ SHARED_ROUTINE_SOURCES,
474
494
  STARRED_EXERCISES_MAX,
475
495
  STREAK_MAX_GAP_DAYS,
476
496
  TRAINING_DISCIPLINE_VALUES,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sunsteel/contracts",
3
- "version": "0.48.0",
3
+ "version": "0.50.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/ezee969/sunsteel-contracts.git"