@fytkit/sdk 0.4.0 → 0.6.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.d.ts CHANGED
@@ -101,6 +101,53 @@ export declare interface FytkitClient {
101
101
  confirmEmail: (input: {
102
102
  token: string;
103
103
  }) => Promise<void>;
104
+ verifyTotp: (input: {
105
+ challenge: TwoFactorChallenge;
106
+ code: string;
107
+ }) => Promise<Session>;
108
+ verifyBackupCode: (input: {
109
+ challenge: TwoFactorChallenge;
110
+ code: string;
111
+ }) => Promise<Session>;
112
+ requestEmailOtp: (input: {
113
+ challenge: TwoFactorChallenge;
114
+ }) => Promise<void>;
115
+ verifyEmailOtp: (input: {
116
+ challenge: TwoFactorChallenge;
117
+ code: string;
118
+ }) => Promise<Session>;
119
+ getSecurityStatus: () => Promise<SecurityStatus>;
120
+ enableTotp: (input: {
121
+ password: string;
122
+ }) => Promise<TotpEnrollment>;
123
+ /** Completes TOTP enrolment. The server rotates the session on first
124
+ * verification; the SDK swaps its stored token transparently. */
125
+ verifyTotpSetup: (input: {
126
+ code: string;
127
+ }) => Promise<void>;
128
+ disableTwoFactor: (input: {
129
+ password: string;
130
+ }) => Promise<void>;
131
+ regenerateBackupCodes: (input: {
132
+ password: string;
133
+ }) => Promise<readonly string[]>;
134
+ /** With `revokeOtherSessions: true` every other device is signed out and
135
+ * the calling session is rotated — the SDK swaps its stored token. */
136
+ changePassword: (input: {
137
+ currentPassword: string;
138
+ newPassword: string;
139
+ revokeOtherSessions?: boolean;
140
+ }) => Promise<void>;
141
+ /** Starts the verified email-change flow — a confirmation link is emailed
142
+ * to the new address; nothing changes until it is opened. */
143
+ changeEmail: (input: {
144
+ newEmail: string;
145
+ }) => Promise<void>;
146
+ listSessions: () => Promise<readonly SessionInfo[]>;
147
+ revokeSession: (input: {
148
+ revokeId: string;
149
+ }) => Promise<void>;
150
+ revokeOtherSessions: () => Promise<void>;
104
151
  };
105
152
  readonly workouts: PublicApi["workout"];
106
153
  readonly programs: PublicApi["program"];
@@ -115,6 +162,9 @@ export declare interface FytkitClient {
115
162
  readonly media: PublicApi["media"];
116
163
  readonly appConfig: PublicApi["appConfig"];
117
164
  readonly subscription: PublicApi["subscription"];
165
+ readonly profile: PublicApi["profile"];
166
+ readonly nutritionLog: PublicApi["nutritionLog"];
167
+ readonly preferences: PublicApi["preferences"];
118
168
  }
119
169
 
120
170
  /** Constructor options for createFytkitClient. */
@@ -172,7 +222,7 @@ declare const publicRouter: {
172
222
  hasActiveSubscription: boolean;
173
223
  clientEntitlements: ClientEntitlements;
174
224
  authMode: "dev-app";
175
- appAllowedOrigins: string[];
225
+ appAllowedOrigins: readonly string[];
176
226
  }>, ZodObject< {
177
227
  email: ZodString;
178
228
  password: ZodString;
@@ -204,7 +254,7 @@ declare const publicRouter: {
204
254
  hasActiveSubscription: boolean;
205
255
  clientEntitlements: ClientEntitlements;
206
256
  authMode: "dev-app";
207
- appAllowedOrigins: string[];
257
+ appAllowedOrigins: readonly string[];
208
258
  }>, ZodObject< {
209
259
  email: ZodString;
210
260
  password: ZodString;
@@ -244,7 +294,7 @@ declare const publicRouter: {
244
294
  hasActiveSubscription: boolean;
245
295
  clientEntitlements: ClientEntitlements;
246
296
  authMode: "dev-app";
247
- appAllowedOrigins: string[];
297
+ appAllowedOrigins: readonly string[];
248
298
  }>, ZodObject< {
249
299
  token: ZodString;
250
300
  }, $strip>, ZodObject< {
@@ -267,7 +317,7 @@ declare const publicRouter: {
267
317
  hasActiveSubscription: boolean;
268
318
  clientEntitlements: ClientEntitlements;
269
319
  authMode: "dev-app";
270
- appAllowedOrigins: string[];
320
+ appAllowedOrigins: readonly string[];
271
321
  }>, ZodObject< {
272
322
  token: ZodString;
273
323
  }, $strip>, ZodObject< {
@@ -297,7 +347,7 @@ declare const publicRouter: {
297
347
  hasActiveSubscription: boolean;
298
348
  clientEntitlements: ClientEntitlements;
299
349
  authMode: "dev-app";
300
- appAllowedOrigins: string[];
350
+ appAllowedOrigins: readonly string[];
301
351
  }>, ZodObject< {
302
352
  email: ZodString;
303
353
  }, $strip>, ZodObject< {
@@ -320,7 +370,7 @@ declare const publicRouter: {
320
370
  hasActiveSubscription: boolean;
321
371
  clientEntitlements: ClientEntitlements;
322
372
  authMode: "dev-app";
323
- appAllowedOrigins: string[];
373
+ appAllowedOrigins: readonly string[];
324
374
  }>, ZodObject< {
325
375
  token: ZodString;
326
376
  password: ZodString;
@@ -344,7 +394,7 @@ declare const publicRouter: {
344
394
  hasActiveSubscription: boolean;
345
395
  clientEntitlements: ClientEntitlements;
346
396
  authMode: "dev-app";
347
- appAllowedOrigins: string[];
397
+ appAllowedOrigins: readonly string[];
348
398
  }>, ZodObject< {
349
399
  token: ZodString;
350
400
  }, $strip>, ZodObject< {
@@ -367,7 +417,7 @@ declare const publicRouter: {
367
417
  hasActiveSubscription: boolean;
368
418
  clientEntitlements: ClientEntitlements;
369
419
  authMode: "dev-app";
370
- appAllowedOrigins: string[];
420
+ appAllowedOrigins: readonly string[];
371
421
  }>, ZodObject< {
372
422
  password: ZodString;
373
423
  }, $strip>, ZodObject< {
@@ -391,7 +441,7 @@ declare const publicRouter: {
391
441
  hasActiveSubscription: boolean;
392
442
  clientEntitlements: ClientEntitlements;
393
443
  authMode: "dev-app";
394
- appAllowedOrigins: string[];
444
+ appAllowedOrigins: readonly string[];
395
445
  }>, ZodObject< {
396
446
  code: ZodString;
397
447
  }, $strip>, ZodObject< {
@@ -415,7 +465,7 @@ declare const publicRouter: {
415
465
  hasActiveSubscription: boolean;
416
466
  clientEntitlements: ClientEntitlements;
417
467
  authMode: "dev-app";
418
- appAllowedOrigins: string[];
468
+ appAllowedOrigins: readonly string[];
419
469
  }>, ZodObject< {
420
470
  password: ZodString;
421
471
  }, $strip>, ZodObject< {
@@ -438,7 +488,7 @@ declare const publicRouter: {
438
488
  hasActiveSubscription: boolean;
439
489
  clientEntitlements: ClientEntitlements;
440
490
  authMode: "dev-app";
441
- appAllowedOrigins: string[];
491
+ appAllowedOrigins: readonly string[];
442
492
  }>, ZodObject< {
443
493
  password: ZodString;
444
494
  }, $strip>, ZodObject< {
@@ -461,7 +511,7 @@ declare const publicRouter: {
461
511
  hasActiveSubscription: boolean;
462
512
  clientEntitlements: ClientEntitlements;
463
513
  authMode: "dev-app";
464
- appAllowedOrigins: string[];
514
+ appAllowedOrigins: readonly string[];
465
515
  }>, ZodObject< {
466
516
  token: ZodString;
467
517
  code: ZodString;
@@ -492,7 +542,7 @@ declare const publicRouter: {
492
542
  hasActiveSubscription: boolean;
493
543
  clientEntitlements: ClientEntitlements;
494
544
  authMode: "dev-app";
495
- appAllowedOrigins: string[];
545
+ appAllowedOrigins: readonly string[];
496
546
  }>, ZodObject< {
497
547
  token: ZodString;
498
548
  code: ZodString;
@@ -523,7 +573,7 @@ declare const publicRouter: {
523
573
  hasActiveSubscription: boolean;
524
574
  clientEntitlements: ClientEntitlements;
525
575
  authMode: "dev-app";
526
- appAllowedOrigins: string[];
576
+ appAllowedOrigins: readonly string[];
527
577
  }>, ZodObject< {
528
578
  token: ZodString;
529
579
  }, $strip>, ZodObject< {
@@ -546,7 +596,7 @@ declare const publicRouter: {
546
596
  hasActiveSubscription: boolean;
547
597
  clientEntitlements: ClientEntitlements;
548
598
  authMode: "dev-app";
549
- appAllowedOrigins: string[];
599
+ appAllowedOrigins: readonly string[];
550
600
  }>, ZodObject< {
551
601
  token: ZodString;
552
602
  code: ZodString;
@@ -577,7 +627,7 @@ declare const publicRouter: {
577
627
  hasActiveSubscription: boolean;
578
628
  clientEntitlements: ClientEntitlements;
579
629
  authMode: "dev-app";
580
- appAllowedOrigins: string[];
630
+ appAllowedOrigins: readonly string[];
581
631
  }>, ZodOptional<ZodObject< {}, $strip>>, ZodObject< {
582
632
  data: ZodObject< {
583
633
  twoFactorEnabled: ZodBoolean;
@@ -585,6 +635,125 @@ declare const publicRouter: {
585
635
  hasBackupCodes: ZodBoolean;
586
636
  }, $strip>;
587
637
  }, $strip>, Record<never, never>, Record<never, never>>;
638
+ changePassword: DecoratedProcedure<MergedInitialContext< {
639
+ headers: Headers;
640
+ } & Record<never, never>, {
641
+ headers: Headers;
642
+ } & Record<never, never>, {
643
+ headers: Headers;
644
+ }>, MergedCurrentContext< {
645
+ headers: Headers;
646
+ }, {
647
+ trainerId: string;
648
+ appId: string;
649
+ clientId: string | undefined;
650
+ hasActiveSubscription: boolean;
651
+ clientEntitlements: ClientEntitlements;
652
+ authMode: "dev-app";
653
+ appAllowedOrigins: readonly string[];
654
+ }>, ZodObject< {
655
+ currentPassword: ZodString;
656
+ newPassword: ZodString;
657
+ revokeOtherSessions: ZodOptional<ZodBoolean>;
658
+ }, $strip>, ZodObject< {
659
+ data: ZodObject< {
660
+ success: ZodLiteral<true>;
661
+ accessToken: ZodString;
662
+ }, $strip>;
663
+ }, $strip>, Record<never, never>, Record<never, never>>;
664
+ changeEmail: DecoratedProcedure<MergedInitialContext< {
665
+ headers: Headers;
666
+ } & Record<never, never>, {
667
+ headers: Headers;
668
+ } & Record<never, never>, {
669
+ headers: Headers;
670
+ }>, MergedCurrentContext< {
671
+ headers: Headers;
672
+ }, {
673
+ trainerId: string;
674
+ appId: string;
675
+ clientId: string | undefined;
676
+ hasActiveSubscription: boolean;
677
+ clientEntitlements: ClientEntitlements;
678
+ authMode: "dev-app";
679
+ appAllowedOrigins: readonly string[];
680
+ }>, ZodObject< {
681
+ newEmail: ZodString;
682
+ }, $strip>, ZodObject< {
683
+ data: ZodObject< {
684
+ ok: ZodLiteral<true>;
685
+ }, $strip>;
686
+ }, $strip>, Record<never, never>, Record<never, never>>;
687
+ listSessions: DecoratedProcedure<MergedInitialContext< {
688
+ headers: Headers;
689
+ } & Record<never, never>, {
690
+ headers: Headers;
691
+ } & Record<never, never>, {
692
+ headers: Headers;
693
+ }>, MergedCurrentContext< {
694
+ headers: Headers;
695
+ }, {
696
+ trainerId: string;
697
+ appId: string;
698
+ clientId: string | undefined;
699
+ hasActiveSubscription: boolean;
700
+ clientEntitlements: ClientEntitlements;
701
+ authMode: "dev-app";
702
+ appAllowedOrigins: readonly string[];
703
+ }>, ZodOptional<ZodObject< {}, $strip>>, ZodObject< {
704
+ data: ZodArray<ZodObject< {
705
+ revokeId: ZodString;
706
+ createdAt: ZodDate;
707
+ expiresAt: ZodDate;
708
+ ipAddress: ZodNullable<ZodString>;
709
+ userAgent: ZodNullable<ZodString>;
710
+ isCurrent: ZodBoolean;
711
+ }, $strip>>;
712
+ }, $strip>, Record<never, never>, Record<never, never>>;
713
+ revokeSession: DecoratedProcedure<MergedInitialContext< {
714
+ headers: Headers;
715
+ } & Record<never, never>, {
716
+ headers: Headers;
717
+ } & Record<never, never>, {
718
+ headers: Headers;
719
+ }>, MergedCurrentContext< {
720
+ headers: Headers;
721
+ }, {
722
+ trainerId: string;
723
+ appId: string;
724
+ clientId: string | undefined;
725
+ hasActiveSubscription: boolean;
726
+ clientEntitlements: ClientEntitlements;
727
+ authMode: "dev-app";
728
+ appAllowedOrigins: readonly string[];
729
+ }>, ZodObject< {
730
+ revokeId: ZodString;
731
+ }, $strip>, ZodObject< {
732
+ data: ZodObject< {
733
+ success: ZodLiteral<true>;
734
+ }, $strip>;
735
+ }, $strip>, Record<never, never>, Record<never, never>>;
736
+ revokeOtherSessions: DecoratedProcedure<MergedInitialContext< {
737
+ headers: Headers;
738
+ } & Record<never, never>, {
739
+ headers: Headers;
740
+ } & Record<never, never>, {
741
+ headers: Headers;
742
+ }>, MergedCurrentContext< {
743
+ headers: Headers;
744
+ }, {
745
+ trainerId: string;
746
+ appId: string;
747
+ clientId: string | undefined;
748
+ hasActiveSubscription: boolean;
749
+ clientEntitlements: ClientEntitlements;
750
+ authMode: "dev-app";
751
+ appAllowedOrigins: readonly string[];
752
+ }>, ZodOptional<ZodObject< {}, $strip>>, ZodObject< {
753
+ data: ZodObject< {
754
+ success: ZodLiteral<true>;
755
+ }, $strip>;
756
+ }, $strip>, Record<never, never>, Record<never, never>>;
588
757
  };
589
758
  workout: {
590
759
  list: DecoratedProcedure<MergedInitialContext< {
@@ -599,6 +768,12 @@ declare const publicRouter: {
599
768
  cursor: ZodOptional<ZodString>;
600
769
  limit: ZodDefault<ZodCoercedNumber<unknown>>;
601
770
  categoryId: ZodOptional<ZodString>;
771
+ q: ZodOptional<ZodString>;
772
+ difficulty: ZodOptional<ZodEnum< {
773
+ beginner: "beginner";
774
+ intermediate: "intermediate";
775
+ advanced: "advanced";
776
+ }>>;
602
777
  }, $strip>, ZodObject< {
603
778
  data: ZodArray<ZodObject< {
604
779
  id: ZodString;
@@ -614,6 +789,12 @@ declare const publicRouter: {
614
789
  published: "published";
615
790
  archived: "archived";
616
791
  }>;
792
+ durationMinutes: ZodNullable<ZodNumber>;
793
+ difficulty: ZodNullable<ZodEnum< {
794
+ beginner: "beginner";
795
+ intermediate: "intermediate";
796
+ advanced: "advanced";
797
+ }>>;
617
798
  publishedAt: ZodNullable<ZodDate>;
618
799
  videoAssetId: ZodNullable<ZodString>;
619
800
  headerImageId: ZodNullable<ZodString>;
@@ -649,6 +830,12 @@ declare const publicRouter: {
649
830
  published: "published";
650
831
  archived: "archived";
651
832
  }>;
833
+ durationMinutes: ZodNullable<ZodNumber>;
834
+ difficulty: ZodNullable<ZodEnum< {
835
+ beginner: "beginner";
836
+ intermediate: "intermediate";
837
+ advanced: "advanced";
838
+ }>>;
652
839
  publishedAt: ZodNullable<ZodDate>;
653
840
  videoAssetId: ZodNullable<ZodString>;
654
841
  headerImageId: ZodNullable<ZodString>;
@@ -736,6 +923,12 @@ declare const publicRouter: {
736
923
  published: "published";
737
924
  archived: "archived";
738
925
  }>;
926
+ durationMinutes: ZodNullable<ZodNumber>;
927
+ difficulty: ZodNullable<ZodEnum< {
928
+ beginner: "beginner";
929
+ intermediate: "intermediate";
930
+ advanced: "advanced";
931
+ }>>;
739
932
  publishedAt: ZodNullable<ZodDate>;
740
933
  videoAssetId: ZodNullable<ZodString>;
741
934
  headerImageId: ZodNullable<ZodString>;
@@ -761,6 +954,12 @@ declare const publicRouter: {
761
954
  published: "published";
762
955
  archived: "archived";
763
956
  }>;
957
+ durationMinutes: ZodNullable<ZodNumber>;
958
+ difficulty: ZodNullable<ZodEnum< {
959
+ beginner: "beginner";
960
+ intermediate: "intermediate";
961
+ advanced: "advanced";
962
+ }>>;
764
963
  publishedAt: ZodNullable<ZodDate>;
765
964
  videoAssetId: ZodNullable<ZodString>;
766
965
  headerImageId: ZodNullable<ZodString>;
@@ -879,6 +1078,305 @@ declare const publicRouter: {
879
1078
  }, $strip>;
880
1079
  }, $strip>, Record<never, never>, Record<never, never>>;
881
1080
  };
1081
+ nutritionLog: {
1082
+ getDay: DecoratedProcedure<MergedInitialContext< {
1083
+ headers: Headers;
1084
+ } & Record<never, never>, {
1085
+ headers: Headers;
1086
+ } & Record<never, never>, {
1087
+ headers: Headers;
1088
+ }>, MergedCurrentContext< {
1089
+ headers: Headers;
1090
+ }, ApiKeyContext>, ZodObject< {
1091
+ date: ZodString;
1092
+ }, $strip>, ZodObject< {
1093
+ data: ZodObject< {
1094
+ date: ZodString;
1095
+ targets: ZodNullable<ZodObject< {
1096
+ calories: ZodNullable<ZodCoercedNumber<unknown>>;
1097
+ protein: ZodNullable<ZodCoercedNumber<unknown>>;
1098
+ carbs: ZodNullable<ZodCoercedNumber<unknown>>;
1099
+ fat: ZodNullable<ZodCoercedNumber<unknown>>;
1100
+ }, $strip>>;
1101
+ totals: ZodObject< {
1102
+ calories: ZodNumber;
1103
+ protein: ZodNumber;
1104
+ carbs: ZodNumber;
1105
+ fat: ZodNumber;
1106
+ }, $strip>;
1107
+ entries: ZodArray<ZodObject< {
1108
+ id: ZodString;
1109
+ loggedFor: ZodString;
1110
+ name: ZodString;
1111
+ mealCategory: ZodNullable<ZodEnum< {
1112
+ breakfast: "breakfast";
1113
+ lunch: "lunch";
1114
+ dinner: "dinner";
1115
+ snack: "snack";
1116
+ }>>;
1117
+ recipeId: ZodNullable<ZodString>;
1118
+ calories: ZodNullable<ZodCoercedNumber<unknown>>;
1119
+ protein: ZodNullable<ZodCoercedNumber<unknown>>;
1120
+ carbs: ZodNullable<ZodCoercedNumber<unknown>>;
1121
+ fat: ZodNullable<ZodCoercedNumber<unknown>>;
1122
+ createdAt: ZodDate;
1123
+ }, $strip>>;
1124
+ }, $strip>;
1125
+ }, $strip>, Record<never, never>, Record<never, never>>;
1126
+ logFood: DecoratedProcedure<MergedInitialContext< {
1127
+ headers: Headers;
1128
+ } & Record<never, never>, {
1129
+ headers: Headers;
1130
+ } & Record<never, never>, {
1131
+ headers: Headers;
1132
+ }>, MergedCurrentContext< {
1133
+ headers: Headers;
1134
+ }, ApiKeyContext>, ZodObject< {
1135
+ loggedFor: ZodString;
1136
+ name: ZodString;
1137
+ mealCategory: ZodOptional<ZodEnum< {
1138
+ breakfast: "breakfast";
1139
+ lunch: "lunch";
1140
+ dinner: "dinner";
1141
+ snack: "snack";
1142
+ }>>;
1143
+ recipeId: ZodOptional<ZodString>;
1144
+ calories: ZodOptional<ZodNullable<ZodNumber>>;
1145
+ protein: ZodOptional<ZodNullable<ZodNumber>>;
1146
+ carbs: ZodOptional<ZodNullable<ZodNumber>>;
1147
+ fat: ZodOptional<ZodNullable<ZodNumber>>;
1148
+ }, $strip>, ZodObject< {
1149
+ data: ZodObject< {
1150
+ id: ZodString;
1151
+ loggedFor: ZodString;
1152
+ name: ZodString;
1153
+ mealCategory: ZodNullable<ZodEnum< {
1154
+ breakfast: "breakfast";
1155
+ lunch: "lunch";
1156
+ dinner: "dinner";
1157
+ snack: "snack";
1158
+ }>>;
1159
+ recipeId: ZodNullable<ZodString>;
1160
+ calories: ZodNullable<ZodCoercedNumber<unknown>>;
1161
+ protein: ZodNullable<ZodCoercedNumber<unknown>>;
1162
+ carbs: ZodNullable<ZodCoercedNumber<unknown>>;
1163
+ fat: ZodNullable<ZodCoercedNumber<unknown>>;
1164
+ createdAt: ZodDate;
1165
+ }, $strip>;
1166
+ }, $strip>, Record<never, never>, Record<never, never>>;
1167
+ updateFood: DecoratedProcedure<MergedInitialContext< {
1168
+ headers: Headers;
1169
+ } & Record<never, never>, {
1170
+ headers: Headers;
1171
+ } & Record<never, never>, {
1172
+ headers: Headers;
1173
+ }>, MergedCurrentContext< {
1174
+ headers: Headers;
1175
+ }, ApiKeyContext>, ZodObject< {
1176
+ name: ZodOptional<ZodString>;
1177
+ mealCategory: ZodOptional<ZodNullable<ZodEnum< {
1178
+ breakfast: "breakfast";
1179
+ lunch: "lunch";
1180
+ dinner: "dinner";
1181
+ snack: "snack";
1182
+ }>>>;
1183
+ calories: ZodOptional<ZodNullable<ZodNumber>>;
1184
+ protein: ZodOptional<ZodNullable<ZodNumber>>;
1185
+ carbs: ZodOptional<ZodNullable<ZodNumber>>;
1186
+ fat: ZodOptional<ZodNullable<ZodNumber>>;
1187
+ id: ZodString;
1188
+ }, $strip>, ZodObject< {
1189
+ data: ZodObject< {
1190
+ id: ZodString;
1191
+ loggedFor: ZodString;
1192
+ name: ZodString;
1193
+ mealCategory: ZodNullable<ZodEnum< {
1194
+ breakfast: "breakfast";
1195
+ lunch: "lunch";
1196
+ dinner: "dinner";
1197
+ snack: "snack";
1198
+ }>>;
1199
+ recipeId: ZodNullable<ZodString>;
1200
+ calories: ZodNullable<ZodCoercedNumber<unknown>>;
1201
+ protein: ZodNullable<ZodCoercedNumber<unknown>>;
1202
+ carbs: ZodNullable<ZodCoercedNumber<unknown>>;
1203
+ fat: ZodNullable<ZodCoercedNumber<unknown>>;
1204
+ createdAt: ZodDate;
1205
+ }, $strip>;
1206
+ }, $strip>, Record<never, never>, Record<never, never>>;
1207
+ deleteFood: DecoratedProcedure<MergedInitialContext< {
1208
+ headers: Headers;
1209
+ } & Record<never, never>, {
1210
+ headers: Headers;
1211
+ } & Record<never, never>, {
1212
+ headers: Headers;
1213
+ }>, MergedCurrentContext< {
1214
+ headers: Headers;
1215
+ }, ApiKeyContext>, ZodObject< {
1216
+ id: ZodString;
1217
+ }, $strip>, ZodObject< {
1218
+ data: ZodObject< {
1219
+ id: ZodString;
1220
+ deleted: ZodLiteral<true>;
1221
+ }, $strip>;
1222
+ }, $strip>, Record<never, never>, Record<never, never>>;
1223
+ setTargets: DecoratedProcedure<MergedInitialContext< {
1224
+ headers: Headers;
1225
+ } & Record<never, never>, {
1226
+ headers: Headers;
1227
+ } & Record<never, never>, {
1228
+ headers: Headers;
1229
+ }>, MergedCurrentContext< {
1230
+ headers: Headers;
1231
+ }, ApiKeyContext>, ZodObject< {
1232
+ calories: ZodOptional<ZodNullable<ZodNumber>>;
1233
+ protein: ZodOptional<ZodNullable<ZodNumber>>;
1234
+ carbs: ZodOptional<ZodNullable<ZodNumber>>;
1235
+ fat: ZodOptional<ZodNullable<ZodNumber>>;
1236
+ }, $strip>, ZodObject< {
1237
+ data: ZodNullable<ZodObject< {
1238
+ calories: ZodNullable<ZodCoercedNumber<unknown>>;
1239
+ protein: ZodNullable<ZodCoercedNumber<unknown>>;
1240
+ carbs: ZodNullable<ZodCoercedNumber<unknown>>;
1241
+ fat: ZodNullable<ZodCoercedNumber<unknown>>;
1242
+ }, $strip>>;
1243
+ }, $strip>, Record<never, never>, Record<never, never>>;
1244
+ };
1245
+ profile: {
1246
+ get: DecoratedProcedure<MergedInitialContext< {
1247
+ headers: Headers;
1248
+ } & Record<never, never>, {
1249
+ headers: Headers;
1250
+ } & Record<never, never>, {
1251
+ headers: Headers;
1252
+ }>, MergedCurrentContext< {
1253
+ headers: Headers;
1254
+ }, ApiKeyContext>, Schema<unknown, unknown>, ZodObject< {
1255
+ data: ZodObject< {
1256
+ id: ZodString;
1257
+ name: ZodString;
1258
+ email: ZodString;
1259
+ avatarUrl: ZodNullable<ZodString>;
1260
+ weightUnit: ZodEnum< {
1261
+ kg: "kg";
1262
+ lb: "lb";
1263
+ }>;
1264
+ timezone: ZodNullable<ZodString>;
1265
+ fitnessGoal: ZodNullable<ZodEnum< {
1266
+ lose_fat: "lose_fat";
1267
+ build_muscle: "build_muscle";
1268
+ get_strong: "get_strong";
1269
+ stay_consistent: "stay_consistent";
1270
+ }>>;
1271
+ dateOfBirth: ZodNullable<ZodString>;
1272
+ heightCm: ZodNullable<ZodCoercedNumber<unknown>>;
1273
+ sessionsPerWeek: ZodNullable<ZodNumber>;
1274
+ bodyweightKg: ZodNullable<ZodCoercedNumber<unknown>>;
1275
+ macroTargets: ZodNullable<ZodObject< {
1276
+ calories: ZodNullable<ZodCoercedNumber<unknown>>;
1277
+ protein: ZodNullable<ZodCoercedNumber<unknown>>;
1278
+ carbs: ZodNullable<ZodCoercedNumber<unknown>>;
1279
+ fat: ZodNullable<ZodCoercedNumber<unknown>>;
1280
+ }, $strip>>;
1281
+ }, $strip>;
1282
+ }, $strip>, Record<never, never>, Record<never, never>>;
1283
+ update: DecoratedProcedure<MergedInitialContext< {
1284
+ headers: Headers;
1285
+ } & Record<never, never>, {
1286
+ headers: Headers;
1287
+ } & Record<never, never>, {
1288
+ headers: Headers;
1289
+ }>, MergedCurrentContext< {
1290
+ headers: Headers;
1291
+ }, ApiKeyContext>, ZodObject< {
1292
+ name: ZodOptional<ZodString>;
1293
+ avatarUrl: ZodOptional<ZodNullable<ZodString>>;
1294
+ timezone: ZodOptional<ZodNullable<ZodString>>;
1295
+ weightUnit: ZodOptional<ZodEnum< {
1296
+ kg: "kg";
1297
+ lb: "lb";
1298
+ }>>;
1299
+ fitnessGoal: ZodOptional<ZodNullable<ZodEnum< {
1300
+ lose_fat: "lose_fat";
1301
+ build_muscle: "build_muscle";
1302
+ get_strong: "get_strong";
1303
+ stay_consistent: "stay_consistent";
1304
+ }>>>;
1305
+ dateOfBirth: ZodOptional<ZodNullable<ZodString>>;
1306
+ heightCm: ZodOptional<ZodNullable<ZodNumber>>;
1307
+ sessionsPerWeek: ZodOptional<ZodNullable<ZodNumber>>;
1308
+ }, $strip>, ZodObject< {
1309
+ data: ZodObject< {
1310
+ id: ZodString;
1311
+ name: ZodString;
1312
+ email: ZodString;
1313
+ avatarUrl: ZodNullable<ZodString>;
1314
+ weightUnit: ZodEnum< {
1315
+ kg: "kg";
1316
+ lb: "lb";
1317
+ }>;
1318
+ timezone: ZodNullable<ZodString>;
1319
+ fitnessGoal: ZodNullable<ZodEnum< {
1320
+ lose_fat: "lose_fat";
1321
+ build_muscle: "build_muscle";
1322
+ get_strong: "get_strong";
1323
+ stay_consistent: "stay_consistent";
1324
+ }>>;
1325
+ dateOfBirth: ZodNullable<ZodString>;
1326
+ heightCm: ZodNullable<ZodCoercedNumber<unknown>>;
1327
+ sessionsPerWeek: ZodNullable<ZodNumber>;
1328
+ bodyweightKg: ZodNullable<ZodCoercedNumber<unknown>>;
1329
+ macroTargets: ZodNullable<ZodObject< {
1330
+ calories: ZodNullable<ZodCoercedNumber<unknown>>;
1331
+ protein: ZodNullable<ZodCoercedNumber<unknown>>;
1332
+ carbs: ZodNullable<ZodCoercedNumber<unknown>>;
1333
+ fat: ZodNullable<ZodCoercedNumber<unknown>>;
1334
+ }, $strip>>;
1335
+ }, $strip>;
1336
+ }, $strip>, Record<never, never>, Record<never, never>>;
1337
+ };
1338
+ preferences: {
1339
+ getNotifications: DecoratedProcedure<MergedInitialContext< {
1340
+ headers: Headers;
1341
+ } & Record<never, never>, {
1342
+ headers: Headers;
1343
+ } & Record<never, never>, {
1344
+ headers: Headers;
1345
+ }>, MergedCurrentContext< {
1346
+ headers: Headers;
1347
+ }, ApiKeyContext>, Schema<unknown, unknown>, ZodObject< {
1348
+ data: ZodObject< {
1349
+ workoutReminders: ZodBoolean;
1350
+ streakAlerts: ZodBoolean;
1351
+ newPrograms: ZodBoolean;
1352
+ emailWeeklyRecap: ZodBoolean;
1353
+ emailProductNews: ZodBoolean;
1354
+ }, $strip>;
1355
+ }, $strip>, Record<never, never>, Record<never, never>>;
1356
+ updateNotifications: DecoratedProcedure<MergedInitialContext< {
1357
+ headers: Headers;
1358
+ } & Record<never, never>, {
1359
+ headers: Headers;
1360
+ } & Record<never, never>, {
1361
+ headers: Headers;
1362
+ }>, MergedCurrentContext< {
1363
+ headers: Headers;
1364
+ }, ApiKeyContext>, ZodObject< {
1365
+ workoutReminders: ZodOptional<ZodBoolean>;
1366
+ streakAlerts: ZodOptional<ZodBoolean>;
1367
+ newPrograms: ZodOptional<ZodBoolean>;
1368
+ emailWeeklyRecap: ZodOptional<ZodBoolean>;
1369
+ emailProductNews: ZodOptional<ZodBoolean>;
1370
+ }, $strip>, ZodObject< {
1371
+ data: ZodObject< {
1372
+ workoutReminders: ZodBoolean;
1373
+ streakAlerts: ZodBoolean;
1374
+ newPrograms: ZodBoolean;
1375
+ emailWeeklyRecap: ZodBoolean;
1376
+ emailProductNews: ZodBoolean;
1377
+ }, $strip>;
1378
+ }, $strip>, Record<never, never>, Record<never, never>>;
1379
+ };
882
1380
  article: {
883
1381
  list: DecoratedProcedure<MergedInitialContext< {
884
1382
  headers: Headers;
@@ -964,6 +1462,7 @@ declare const publicRouter: {
964
1462
  dinner: "dinner";
965
1463
  snack: "snack";
966
1464
  }>>;
1465
+ q: ZodOptional<ZodString>;
967
1466
  }, $strip>, ZodObject< {
968
1467
  data: ZodArray<ZodObject< {
969
1468
  id: ZodString;
@@ -1543,12 +2042,14 @@ declare const publicRouter: {
1543
2042
  }, ApiKeyContext>, ZodObject< {
1544
2043
  programId: ZodOptional<ZodString>;
1545
2044
  sessionId: ZodOptional<ZodString>;
2045
+ workoutId: ZodOptional<ZodString>;
1546
2046
  completed: ZodOptional<ZodBoolean>;
1547
2047
  }, $strip>, ZodObject< {
1548
2048
  data: ZodArray<ZodObject< {
1549
2049
  id: ZodString;
1550
- enrollmentId: ZodString;
1551
- sessionId: ZodString;
2050
+ enrollmentId: ZodNullable<ZodString>;
2051
+ sessionId: ZodNullable<ZodString>;
2052
+ workoutId: ZodNullable<ZodString>;
1552
2053
  startedAt: ZodString;
1553
2054
  completedAt: ZodNullable<ZodString>;
1554
2055
  overallRpe: ZodNullable<ZodNumber>;
@@ -1573,13 +2074,15 @@ declare const publicRouter: {
1573
2074
  }>, MergedCurrentContext< {
1574
2075
  headers: Headers;
1575
2076
  }, ApiKeyContext>, ZodObject< {
1576
- sessionId: ZodString;
1577
- enrollmentId: ZodString;
2077
+ sessionId: ZodOptional<ZodString>;
2078
+ enrollmentId: ZodOptional<ZodString>;
2079
+ workoutId: ZodOptional<ZodString>;
1578
2080
  }, $strip>, Schema< {
1579
2081
  data: {
1580
2082
  id: string;
1581
- enrollmentId: string;
1582
- sessionId: string;
2083
+ enrollmentId: string | null;
2084
+ sessionId: string | null;
2085
+ workoutId: string | null;
1583
2086
  startedAt: string;
1584
2087
  completedAt: string | null;
1585
2088
  overallRpe: number | null;
@@ -1589,8 +2092,9 @@ declare const publicRouter: {
1589
2092
  }, {
1590
2093
  data: {
1591
2094
  id: string;
1592
- enrollmentId: string;
1593
- sessionId: string;
2095
+ enrollmentId: string | null;
2096
+ sessionId: string | null;
2097
+ workoutId: string | null;
1594
2098
  startedAt: string;
1595
2099
  completedAt: string | null;
1596
2100
  overallRpe: number | null;
@@ -1614,8 +2118,9 @@ declare const publicRouter: {
1614
2118
  }, $strip>, Schema< {
1615
2119
  data: {
1616
2120
  id: string;
1617
- enrollmentId: string;
1618
- sessionId: string;
2121
+ enrollmentId: string | null;
2122
+ sessionId: string | null;
2123
+ workoutId: string | null;
1619
2124
  startedAt: string;
1620
2125
  completedAt: string | null;
1621
2126
  overallRpe: number | null;
@@ -1633,8 +2138,9 @@ declare const publicRouter: {
1633
2138
  }, {
1634
2139
  data: {
1635
2140
  id: string;
1636
- enrollmentId: string;
1637
- sessionId: string;
2141
+ enrollmentId: string | null;
2142
+ sessionId: string | null;
2143
+ workoutId: string | null;
1638
2144
  startedAt: string;
1639
2145
  completedAt: string | null;
1640
2146
  overallRpe: number | null;
@@ -1809,6 +2315,29 @@ declare const publicRouter: {
1809
2315
  computedAt: ZodString;
1810
2316
  }, $strip>;
1811
2317
  }, $strip>, Record<never, never>, Record<never, never>>;
2318
+ listPrHistory: DecoratedProcedure<MergedInitialContext< {
2319
+ headers: Headers;
2320
+ } & Record<never, never>, {
2321
+ headers: Headers;
2322
+ } & Record<never, never>, {
2323
+ headers: Headers;
2324
+ }>, MergedCurrentContext< {
2325
+ headers: Headers;
2326
+ }, ApiKeyContext>, ZodObject< {
2327
+ exerciseId: ZodOptional<ZodString>;
2328
+ limit: ZodDefault<ZodCoercedNumber<unknown>>;
2329
+ }, $strip>, ZodObject< {
2330
+ data: ZodArray<ZodObject< {
2331
+ id: ZodString;
2332
+ exerciseId: ZodString;
2333
+ exerciseName: ZodString;
2334
+ sessionLogId: ZodString;
2335
+ weightKg: ZodString;
2336
+ reps: ZodNumber;
2337
+ estimated1Rm: ZodString;
2338
+ achievedAt: ZodString;
2339
+ }, $strip>>;
2340
+ }, $strip>, Record<never, never>, Record<never, never>>;
1812
2341
  };
1813
2342
  bodyMetric: {
1814
2343
  list: DecoratedProcedure<MergedInitialContext< {
@@ -1936,6 +2465,21 @@ declare const publicRouter: {
1936
2465
  }, $strip>>;
1937
2466
  }, $strip>;
1938
2467
  }, $strip>, Record<never, never>, Record<never, never>>;
2468
+ getStreak: DecoratedProcedure<MergedInitialContext< {
2469
+ headers: Headers;
2470
+ } & Record<never, never>, {
2471
+ headers: Headers;
2472
+ } & Record<never, never>, {
2473
+ headers: Headers;
2474
+ }>, MergedCurrentContext< {
2475
+ headers: Headers;
2476
+ }, ApiKeyContext>, ZodObject< {}, $strip>, ZodObject< {
2477
+ data: ZodObject< {
2478
+ currentStreakDays: ZodNumber;
2479
+ longestStreakDays: ZodNumber;
2480
+ lastWorkoutAt: ZodNullable<ZodString>;
2481
+ }, $strip>;
2482
+ }, $strip>, Record<never, never>, Record<never, never>>;
1939
2483
  };
1940
2484
  media: {
1941
2485
  get: DecoratedProcedure<MergedInitialContext< {
@@ -1992,6 +2536,9 @@ declare const publicRouter: {
1992
2536
  failed: "failed";
1993
2537
  }>;
1994
2538
  buildVersion: ZodNullable<ZodString>;
2539
+ helpUrl: ZodNullable<ZodString>;
2540
+ termsUrl: ZodNullable<ZodString>;
2541
+ privacyUrl: ZodNullable<ZodString>;
1995
2542
  }, $strip>;
1996
2543
  }, $strip>, Record<never, never>, Record<never, never>>;
1997
2544
  };
@@ -2011,6 +2558,9 @@ declare const publicRouter: {
2011
2558
  id: ZodString;
2012
2559
  name: ZodString;
2013
2560
  monthlyPriceCents: ZodNumber;
2561
+ annualPriceCents: ZodNullable<ZodNumber>;
2562
+ hasAnnualStripe: ZodBoolean;
2563
+ trialDays: ZodNullable<ZodNumber>;
2014
2564
  description: ZodString;
2015
2565
  sortOrder: ZodNumber;
2016
2566
  hasStripe: ZodBoolean;
@@ -2051,6 +2601,11 @@ declare const publicRouter: {
2051
2601
  cancelled: "cancelled";
2052
2602
  past_due: "past_due";
2053
2603
  }>;
2604
+ interval: ZodNullable<ZodEnum< {
2605
+ monthly: "monthly";
2606
+ annual: "annual";
2607
+ }>>;
2608
+ priceCents: ZodNullable<ZodNumber>;
2054
2609
  startedAt: ZodNullable<ZodDate>;
2055
2610
  expiresAt: ZodNullable<ZodDate>;
2056
2611
  }, $strip>>;
@@ -2073,6 +2628,10 @@ declare const publicRouter: {
2073
2628
  headers: Headers;
2074
2629
  }, ApiKeyContext>, ZodObject< {
2075
2630
  planId: ZodString;
2631
+ interval: ZodDefault<ZodEnum< {
2632
+ monthly: "monthly";
2633
+ annual: "annual";
2634
+ }>>;
2076
2635
  returnUrl: ZodOptional<ZodString>;
2077
2636
  }, $strip>, ZodObject< {
2078
2637
  data: ZodObject< {
@@ -2097,6 +2656,13 @@ declare const publicRouter: {
2097
2656
  };
2098
2657
  };
2099
2658
 
2659
+ /** Which second factors the signed-in user has configured. */
2660
+ export declare interface SecurityStatus {
2661
+ readonly twoFactorEnabled: boolean;
2662
+ readonly totpEnabled: boolean;
2663
+ readonly hasBackupCodes: boolean;
2664
+ }
2665
+
2100
2666
  /** Cached session in storage. `expiresAt` is an ISO-8601 string from the server. */
2101
2667
  export declare interface Session {
2102
2668
  readonly accessToken: string;
@@ -2107,6 +2673,19 @@ export declare interface Session {
2107
2673
  };
2108
2674
  }
2109
2675
 
2676
+ /**
2677
+ * One signed-in device/session from `auth.listSessions`. `revokeId` is an
2678
+ * opaque identifier (never the bearer token) — pass it to `auth.revokeSession`.
2679
+ */
2680
+ export declare interface SessionInfo {
2681
+ readonly revokeId: string;
2682
+ readonly createdAt: Date;
2683
+ readonly expiresAt: Date;
2684
+ readonly ipAddress: string | null;
2685
+ readonly userAgent: string | null;
2686
+ readonly isCurrent: boolean;
2687
+ }
2688
+
2110
2689
  /**
2111
2690
  * The discriminated return value from `auth.signIn()`. When the trainee has
2112
2691
  * no second factor configured, `kind` is `"signed_in"` and the session is
@@ -2130,9 +2709,18 @@ export declare interface TokenStorage {
2130
2709
  }
2131
2710
 
2132
2711
  /**
2133
- * Carries everything a caller needs to drive step-2 of a two-factor sign-in.
2134
- * PR-B adds `auth.verifyTotp`, `auth.verifyBackupCode`, and the email-OTP
2135
- * helpers that consume this challenge.
2712
+ * Returned by `auth.enableTotp`. Render `totpUri` as a QR code (or expose it
2713
+ * as a link) and show `backupCodes` exactly once — the server stores them
2714
+ * encrypted and cannot display them again.
2715
+ */
2716
+ export declare interface TotpEnrollment {
2717
+ readonly totpUri: string;
2718
+ readonly backupCodes: readonly string[];
2719
+ }
2720
+
2721
+ /**
2722
+ * Carries everything a caller needs to drive step-2 of a two-factor sign-in
2723
+ * via `auth.verifyTotp`, `auth.verifyBackupCode`, or the email-OTP helpers.
2136
2724
  */
2137
2725
  export declare interface TwoFactorChallenge {
2138
2726
  readonly token: TwoFactorToken;