hevy-shared 1.0.1050 → 1.0.1052

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.
Files changed (2) hide show
  1. package/built/index.d.ts +14 -1
  2. package/package.json +1 -1
package/built/index.d.ts CHANGED
@@ -302,8 +302,21 @@ export interface BackofficeExistingUserResponse {
302
302
  public_api_key: string | null;
303
303
  limited_discovery: boolean;
304
304
  coach_trial_expire_date?: string;
305
- hevy_trainer_program: TrainerProgramV3 | null;
305
+ hevy_trainer_program: BackofficeTrainerProgram | null;
306
306
  }
307
+ /**
308
+ * A user has at most one active Hevy Trainer program, on either the v2 schema
309
+ * (program → routines) or the v3 schema (program → templates). The backoffice
310
+ * receives whichever exists as a discriminated union keyed by `schema_version`
311
+ * so the front-end can render each shape.
312
+ */
313
+ export type BackofficeTrainerProgram = {
314
+ schema_version: 'v2';
315
+ program: HevyTrainerProgram;
316
+ } | {
317
+ schema_version: 'v3';
318
+ program: TrainerProgramV3;
319
+ };
307
320
  export interface BackofficeDeletedUserResponse {
308
321
  state: 'deleted-account';
309
322
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hevy-shared",
3
- "version": "1.0.1050",
3
+ "version": "1.0.1052",
4
4
  "description": "",
5
5
  "main": "built/index.js",
6
6
  "types": "built/index.d.ts",