@dgpholdings/greatoak-shared 1.0.20 → 1.0.22

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.
@@ -0,0 +1,3 @@
1
+ import { TBodyPart, TBodyPartKeys } from "../types";
2
+ export declare const bodyCategories: TBodyPart[];
3
+ export declare const bodySubCategories: Record<TBodyPart, TBodyPartKeys>;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.bodySubCategories = exports.bodyCategories = void 0;
4
+ exports.bodyCategories = [
5
+ "Chest",
6
+ "Core",
7
+ "Shoulders",
8
+ "Back",
9
+ "Bicep",
10
+ "Tricep",
11
+ "Fore arm",
12
+ "Legs",
13
+ "Cardio",
14
+ "Grip",
15
+ ];
16
+ exports.bodySubCategories = {
17
+ Chest: ["pectoralis-major", "pectoralis-minor"],
18
+ Core: ["abs-lower", "abs-upper", "obliques"],
19
+ Shoulders: ["deltoids-front", "deltoids-rear", "lateral-deltoids-center"],
20
+ Back: ["trapezius", "latissimus-dorsi", "rhomboids"],
21
+ Bicep: ["bicep-short-inner", "bicep-long-outer"],
22
+ Tricep: ["brachii-lateral-rear", "brachii-long-outer"],
23
+ "Fore arm": ["fore-arm-inner", "fore-arm-outer"],
24
+ Legs: [
25
+ "hamstrings",
26
+ "calf-inner",
27
+ "calf-outer",
28
+ "quadriceps",
29
+ "medius-upper",
30
+ "maximus-lower",
31
+ ],
32
+ Cardio: ["cardio"],
33
+ Grip: ["grip"],
34
+ };
@@ -0,0 +1 @@
1
+ export * from "./BodyCategories";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./BodyCategories"), exports);
package/dist/index.d.ts CHANGED
@@ -1,5 +1,2 @@
1
- export * from "./TApiAuth";
2
- export * from "./TApiExercise";
3
- export * from "./TApiRecord";
4
- export * from "./TApiTemplate";
5
- export * from "./adminApi/TApiAttachment";
1
+ export * from "./constants";
2
+ export type * from "./types";
package/dist/index.js CHANGED
@@ -14,8 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./TApiAuth"), exports);
18
- __exportStar(require("./TApiExercise"), exports);
19
- __exportStar(require("./TApiRecord"), exports);
20
- __exportStar(require("./TApiTemplate"), exports);
21
- __exportStar(require("./adminApi/TApiAttachment"), exports);
17
+ __exportStar(require("./constants"), exports);
@@ -1,6 +1,5 @@
1
1
  import { TRecord } from "./TApiRecord";
2
2
  export type TBodyPart = "Chest" | "Core" | "Shoulders" | "Back" | "Bicep" | "Tricep" | "Fore arm" | "Legs" | "Cardio" | "Grip";
3
- export type TBodyPartDetail = keyof EBodyParts;
4
3
  export declare enum EBodyParts {
5
4
  "pectoralis-major" = "Pectoralis upper",
6
5
  "pectoralis-minor" = "Pectoralis lower",
@@ -27,17 +26,18 @@ export declare enum EBodyParts {
27
26
  "medius-upper" = "Gluteus medius (upper)",
28
27
  "maximus-lower" = "Gluteus Maximus (lower)",
29
28
  "cardio" = "Cardio",
30
- wrist = "Wrist"
29
+ "grip" = "Grip"
31
30
  }
31
+ export type TBodyPartKeys = Array<keyof typeof EBodyParts>;
32
32
  export type TExercise = {
33
- id: string;
33
+ exerciseId: string;
34
34
  name: string;
35
35
  recordType: TRecord["type"];
36
- primaryMuscles: TBodyPartDetail[];
37
- secondaryMuscles: TBodyPartDetail[];
36
+ primaryMuscles: TBodyPartKeys[];
37
+ secondaryMuscles: TBodyPartKeys[];
38
38
  otherName?: string;
39
- videoUrl?: string[];
40
- thumbnailUrl?: string;
39
+ videoUrl: string[];
40
+ thumbnailUrl: string;
41
41
  };
42
42
  export type TBodyPartExercises = {
43
43
  id: string;
@@ -55,10 +55,16 @@ export type TApiCreateExerciseRes = {
55
55
  export type TApiListExercisesReq = null;
56
56
  export type TApiListExercisesRes = {
57
57
  data: {
58
- id: string;
58
+ exerciseId: string;
59
59
  name: string;
60
60
  bodyPart: string;
61
61
  primaryMuscles: string[];
62
62
  thumbnailUrl: string | null;
63
- };
63
+ }[];
64
+ };
65
+ export type TApiGetOneExerciseReq = {
66
+ exerciseId: string;
67
+ };
68
+ export type TApiGetOneExerciseRes = TExercise & {
69
+ isActive: boolean;
64
70
  };
@@ -28,5 +28,5 @@ var EBodyParts;
28
28
  EBodyParts["medius-upper"] = "Gluteus medius (upper)";
29
29
  EBodyParts["maximus-lower"] = "Gluteus Maximus (lower)";
30
30
  EBodyParts["cardio"] = "Cardio";
31
- EBodyParts["wrist"] = "Wrist";
31
+ EBodyParts["grip"] = "Grip";
32
32
  })(EBodyParts || (exports.EBodyParts = EBodyParts = {}));
@@ -1,8 +1,9 @@
1
1
  import { TExercise } from "./TApiExercise";
2
2
  export type TTemplate = {
3
3
  name: string;
4
- id: string;
4
+ templateId: string;
5
5
  lastUsed?: string;
6
+ createdAt?: string;
6
7
  };
7
8
  export type TTemplateExercise = {
8
9
  template: TTemplate;
@@ -10,7 +11,6 @@ export type TTemplateExercise = {
10
11
  };
11
12
  export type TApiTemplateCreateReq = {
12
13
  name: string;
13
- exerciseIds: string[];
14
14
  };
15
15
  export type TApiTemplateCreateRes = {
16
16
  status: number;
@@ -27,3 +27,11 @@ export type TApiTemplateUpdateRes = {
27
27
  success?: boolean;
28
28
  message?: string;
29
29
  };
30
+ export type TApiTemplateListReq = {};
31
+ export type TApiTemplateListRes = {
32
+ templates: TTemplate[];
33
+ };
34
+ export type TApiTemplateDataReq = {
35
+ templateId: string;
36
+ };
37
+ export type TApiTemplateDataRes = TTemplateExercise;
@@ -1,4 +1,5 @@
1
- export * from "./TApiAuth";
2
- export * from "./TApiExercise";
3
- export * from "./TApiRecord";
4
- export * from "./TApiTemplate";
1
+ export type * from "./TApiAuth";
2
+ export type * from "./TApiExercise";
3
+ export type * from "./TApiRecord";
4
+ export type * from "./TApiTemplate";
5
+ export type * from "./adminApi/TApiAttachment";
@@ -1,20 +1,2 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
2
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./TApiAuth"), exports);
18
- __exportStar(require("./TApiExercise"), exports);
19
- __exportStar(require("./TApiRecord"), exports);
20
- __exportStar(require("./TApiTemplate"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dgpholdings/greatoak-shared",
3
- "version": "1.0.20",
3
+ "version": "1.0.22",
4
4
  "description": "Shared TypeScript types and utilities for @dgpholdings projects",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -1,30 +0,0 @@
1
- export type TApiSignupReq = {
2
- email: string;
3
- password: string;
4
- model: string;
5
- deviceUniqueId: string;
6
- };
7
- export type TApiSignupRes = {
8
- token?: string;
9
- status: 400 | 201 | 500;
10
- message?: string;
11
- };
12
- export type TApiSigninEmailReq = {
13
- email: string;
14
- password: string;
15
- model: string;
16
- deviceUniqueId: string;
17
- };
18
- export type TApiSigninEmailRes = {
19
- message?: string;
20
- token?: string;
21
- status?: 400 | 200 | 500;
22
- };
23
- export type TApiSignInTokenReq = {
24
- deviceUniqueId: string;
25
- };
26
- export type TApiSignInTokenRes = {
27
- message: string;
28
- token?: string;
29
- status: 200 | 500;
30
- };
package/dist/TApiAuth.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,70 +0,0 @@
1
- import { TRecord } from "./TApiRecord";
2
- export type TBodyPart = "Chest" | "Core" | "Shoulders" | "Back" | "Bicep" | "Tricep" | "Fore arm" | "Legs" | "Cardio" | "Grip";
3
- export declare enum EBodyParts {
4
- "pectoralis-major" = "Pectoralis upper",
5
- "pectoralis-minor" = "Pectoralis lower",
6
- "abs-upper" = "Abs upper",
7
- "abs-lower" = "Abs lower",
8
- "obliques" = "Obliques",
9
- "latissimus-dorsi" = "Latissimus dorsi",
10
- "rhomboids" = "Rhomboids",
11
- "trapezius" = "Trapezius",
12
- "bicep-short-inner" = "Bicep short (inner)",
13
- "bicep-long-outer" = "Bicep long (outer)",
14
- "brachii-long-outer" = "Brachii long (outer)",
15
- "brachii-lateral-rear" = "Brachii lateral (rear)",
16
- "medial-rear-2" = "Medial (rear 2)",
17
- "fore-arm-inner" = "Fore arm inner",
18
- "fore-arm-outer" = "Fore arm outer",
19
- "deltoids-front" = "Deltoids front",
20
- "lateral-deltoids-center" = "Lateral deltoids (center)",
21
- "deltoids-rear" = "Deltoids rear",
22
- "calf-inner" = "Calf inner",
23
- "calf-outer" = "Calf outer",
24
- "hamstrings" = "Hamstrings",
25
- "quadriceps" = "Quadriceps",
26
- "medius-upper" = "Gluteus medius (upper)",
27
- "maximus-lower" = "Gluteus Maximus (lower)",
28
- "cardio" = "Cardio",
29
- "grip" = "Grip"
30
- }
31
- export type TBodyPartKeys = Array<keyof typeof EBodyParts>;
32
- export type TExercise = {
33
- exerciseId: string;
34
- name: string;
35
- recordType: TRecord["type"];
36
- primaryMuscles: TBodyPartKeys[];
37
- secondaryMuscles: TBodyPartKeys[];
38
- otherName?: string;
39
- videoUrl: string[];
40
- thumbnailUrl: string;
41
- };
42
- export type TBodyPartExercises = {
43
- id: string;
44
- bodyPart: TBodyPart;
45
- exercises: Record<string, TExercise>;
46
- };
47
- export type TApiCreateExerciseReq = {
48
- bodyPart: TBodyPart;
49
- exercise: Omit<TExercise, "id">;
50
- };
51
- export type TApiCreateExerciseRes = {
52
- success: boolean;
53
- message: string;
54
- };
55
- export type TApiListExercisesReq = null;
56
- export type TApiListExercisesRes = {
57
- data: {
58
- exerciseId: string;
59
- name: string;
60
- bodyPart: string;
61
- primaryMuscles: string[];
62
- thumbnailUrl: string | null;
63
- }[];
64
- };
65
- export type TApiGetOneExerciseReq = {
66
- exerciseId: string;
67
- };
68
- export type TApiGetOneExerciseRes = TExercise & {
69
- isActive: boolean;
70
- };
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EBodyParts = void 0;
4
- var EBodyParts;
5
- (function (EBodyParts) {
6
- EBodyParts["pectoralis-major"] = "Pectoralis upper";
7
- EBodyParts["pectoralis-minor"] = "Pectoralis lower";
8
- EBodyParts["abs-upper"] = "Abs upper";
9
- EBodyParts["abs-lower"] = "Abs lower";
10
- EBodyParts["obliques"] = "Obliques";
11
- EBodyParts["latissimus-dorsi"] = "Latissimus dorsi";
12
- EBodyParts["rhomboids"] = "Rhomboids";
13
- EBodyParts["trapezius"] = "Trapezius";
14
- EBodyParts["bicep-short-inner"] = "Bicep short (inner)";
15
- EBodyParts["bicep-long-outer"] = "Bicep long (outer)";
16
- EBodyParts["brachii-long-outer"] = "Brachii long (outer)";
17
- EBodyParts["brachii-lateral-rear"] = "Brachii lateral (rear)";
18
- EBodyParts["medial-rear-2"] = "Medial (rear 2)";
19
- EBodyParts["fore-arm-inner"] = "Fore arm inner";
20
- EBodyParts["fore-arm-outer"] = "Fore arm outer";
21
- EBodyParts["deltoids-front"] = "Deltoids front";
22
- EBodyParts["lateral-deltoids-center"] = "Lateral deltoids (center)";
23
- EBodyParts["deltoids-rear"] = "Deltoids rear";
24
- EBodyParts["calf-inner"] = "Calf inner";
25
- EBodyParts["calf-outer"] = "Calf outer";
26
- EBodyParts["hamstrings"] = "Hamstrings";
27
- EBodyParts["quadriceps"] = "Quadriceps";
28
- EBodyParts["medius-upper"] = "Gluteus medius (upper)";
29
- EBodyParts["maximus-lower"] = "Gluteus Maximus (lower)";
30
- EBodyParts["cardio"] = "Cardio";
31
- EBodyParts["grip"] = "Grip";
32
- })(EBodyParts || (exports.EBodyParts = EBodyParts = {}));
@@ -1,26 +0,0 @@
1
- export type TRecord = {
2
- id: string;
3
- } & ({
4
- type: "weight-reps";
5
- kg: string;
6
- reps: string;
7
- } | {
8
- type: "duration";
9
- durationSecs: string;
10
- goalDuration: string;
11
- } | {
12
- type: "reps-only";
13
- reps: string;
14
- });
15
- export type TRecordForm = TRecord & {
16
- isDone: boolean;
17
- };
18
- export type TRecordDuration = Extract<TRecord, {
19
- type: "duration";
20
- }>;
21
- export type TRecordWeight = Extract<TRecord, {
22
- type: "weight-reps";
23
- }>;
24
- export type TRecordBodyWeight = Extract<TRecord, {
25
- type: "reps-only";
26
- }>;
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,37 +0,0 @@
1
- import { TExercise } from "./TApiExercise";
2
- export type TTemplate = {
3
- name: string;
4
- templateId: string;
5
- lastUsed?: string;
6
- createdAt?: string;
7
- };
8
- export type TTemplateExercise = {
9
- template: TTemplate;
10
- exercise: TExercise[];
11
- };
12
- export type TApiTemplateCreateReq = {
13
- name: string;
14
- };
15
- export type TApiTemplateCreateRes = {
16
- status: number;
17
- success?: boolean;
18
- message?: string;
19
- };
20
- export type TApiTemplateUpdateReq = {
21
- templateId: string;
22
- name: string;
23
- exerciseIds: string[];
24
- };
25
- export type TApiTemplateUpdateRes = {
26
- status: number;
27
- success?: boolean;
28
- message?: string;
29
- };
30
- export type TApiTemplateListReq = {};
31
- export type TApiTemplateListRes = {
32
- templates: TTemplate[];
33
- };
34
- export type TApiTemplateDataReq = {
35
- templateId: string;
36
- };
37
- export type TApiTemplateDataRes = TTemplateExercise;
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,28 +0,0 @@
1
- export declare const bodyParts: {
2
- readonly "pectoralis-major": "Pectoralis upper";
3
- readonly "pectoralis-minor": "Pectoralis lower";
4
- readonly "abs-upper": "Abs upper";
5
- readonly "abs-lower": "Abs lower";
6
- readonly obliques: "Obliques";
7
- readonly "latissimus-dorsi": "Latissimus dorsi";
8
- readonly rhomboids: "Rhomboids";
9
- readonly trapezius: "Trapezius";
10
- readonly "bicep-short-inner": "Bicep short (inner)";
11
- readonly "bicep-long-outer": "Bicep long (outer)";
12
- readonly "brachii-long-outer": "Brachii long (outer)";
13
- readonly "brachii-lateral-rear": "Brachii lateral (rear)";
14
- readonly "medial-rear-2": "Medial (rear 2)";
15
- readonly "fore-arm-inner": "Fore arm inner";
16
- readonly "fore-arm-outer": "Fore arm outer";
17
- readonly "deltoids-front": "Deltoids front";
18
- readonly "lateral-deltoids-center": "Lateral deltoids (center)";
19
- readonly "deltoids-rear": "Deltoids rear";
20
- readonly "calf-inner": "Calf inner";
21
- readonly "calf-outer": "Calf outer";
22
- readonly hamstrings: "Hamstrings";
23
- readonly quadriceps: "Quadriceps";
24
- readonly "medius-upper": "Gluteus medius (upper)";
25
- readonly "maximus-lower": "Gluteus Maximus (lower)";
26
- readonly cardio: "Cardio";
27
- readonly wrist: "Wrist";
28
- };
@@ -1,31 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.bodyParts = void 0;
4
- exports.bodyParts = {
5
- "pectoralis-major": "Pectoralis upper",
6
- "pectoralis-minor": "Pectoralis lower",
7
- "abs-upper": "Abs upper",
8
- "abs-lower": "Abs lower",
9
- obliques: "Obliques",
10
- "latissimus-dorsi": "Latissimus dorsi",
11
- rhomboids: "Rhomboids",
12
- trapezius: "Trapezius",
13
- "bicep-short-inner": "Bicep short (inner)",
14
- "bicep-long-outer": "Bicep long (outer)",
15
- "brachii-long-outer": "Brachii long (outer)",
16
- "brachii-lateral-rear": "Brachii lateral (rear)",
17
- "medial-rear-2": "Medial (rear 2)",
18
- "fore-arm-inner": "Fore arm inner",
19
- "fore-arm-outer": "Fore arm outer",
20
- "deltoids-front": "Deltoids front",
21
- "lateral-deltoids-center": "Lateral deltoids (center)",
22
- "deltoids-rear": "Deltoids rear",
23
- "calf-inner": "Calf inner",
24
- "calf-outer": "Calf outer",
25
- hamstrings: "Hamstrings",
26
- quadriceps: "Quadriceps",
27
- "medius-upper": "Gluteus medius (upper)",
28
- "maximus-lower": "Gluteus Maximus (lower)",
29
- cardio: "Cardio",
30
- wrist: "Wrist",
31
- };