@dgpholdings/greatoak-shared 1.2.22 → 1.2.24
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/types/TApiProPlan.d.ts +145 -0
- package/dist/types/TApiProPlan.js +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { TDayKey, TTemplateExercise } from "./commonTypes";
|
|
2
|
+
export type TProPlanTags = "medical" | "free-hand" | "all-gym-equip" | "light-gym-equip" | "bands-free-hand";
|
|
3
|
+
export type TProPlan = {
|
|
4
|
+
name: {
|
|
5
|
+
default: string;
|
|
6
|
+
en?: string;
|
|
7
|
+
de?: string;
|
|
8
|
+
ru?: string;
|
|
9
|
+
es?: string;
|
|
10
|
+
fr?: string;
|
|
11
|
+
};
|
|
12
|
+
description: {
|
|
13
|
+
default: string;
|
|
14
|
+
en?: string;
|
|
15
|
+
de?: string;
|
|
16
|
+
ru?: string;
|
|
17
|
+
es?: string;
|
|
18
|
+
fr?: string;
|
|
19
|
+
};
|
|
20
|
+
planId: string;
|
|
21
|
+
planCode: string;
|
|
22
|
+
gender: "male" | "female" | "all";
|
|
23
|
+
slug: string;
|
|
24
|
+
level: "beginner" | "intermediate" | "advanced" | "beginner-intermediate" | "intermediate-advanced" | "all";
|
|
25
|
+
tags: TProPlanTags[];
|
|
26
|
+
status: "active" | "achieved" | "draft";
|
|
27
|
+
version: number;
|
|
28
|
+
versionNote?: string;
|
|
29
|
+
days: {
|
|
30
|
+
dayId: string;
|
|
31
|
+
name: {
|
|
32
|
+
default: string;
|
|
33
|
+
en?: string;
|
|
34
|
+
de?: string;
|
|
35
|
+
ru?: string;
|
|
36
|
+
es?: string;
|
|
37
|
+
fr?: string;
|
|
38
|
+
};
|
|
39
|
+
suggestedDay: TDayKey;
|
|
40
|
+
exercises: TTemplateExercise[];
|
|
41
|
+
}[];
|
|
42
|
+
createdAt?: Date;
|
|
43
|
+
updatedAt?: Date;
|
|
44
|
+
} & ({
|
|
45
|
+
groupId: string;
|
|
46
|
+
type: "system";
|
|
47
|
+
thumbnailImageUrl: string;
|
|
48
|
+
isPremium: boolean;
|
|
49
|
+
} | {
|
|
50
|
+
avatarImgName: string;
|
|
51
|
+
type: "trainer-created";
|
|
52
|
+
ownerId: string;
|
|
53
|
+
});
|
|
54
|
+
export type TApiProPlanCreateReq = ({
|
|
55
|
+
type: "trainer-created";
|
|
56
|
+
} & Omit<Extract<TProPlan, {
|
|
57
|
+
type: "trainer-created";
|
|
58
|
+
}>, "type" | "planCode" | "slug" | "ownerId" | "planId">) | ({
|
|
59
|
+
type: "system";
|
|
60
|
+
} & Omit<Extract<TProPlan, {
|
|
61
|
+
type: "system";
|
|
62
|
+
}>, "type" | "planCode" | "planId">);
|
|
63
|
+
export type TApiProPlanCreateRes = {
|
|
64
|
+
status: 400;
|
|
65
|
+
state: "failed";
|
|
66
|
+
message: string;
|
|
67
|
+
} | {
|
|
68
|
+
status: 201;
|
|
69
|
+
state: "success";
|
|
70
|
+
planCode: string;
|
|
71
|
+
};
|
|
72
|
+
export type TApiProPlanUpdateReq = {
|
|
73
|
+
planCode: string;
|
|
74
|
+
isDelete: boolean;
|
|
75
|
+
isSkipVersionUpdate: boolean;
|
|
76
|
+
} & TProPlan;
|
|
77
|
+
export type TApiProPlanUpdateRes = {
|
|
78
|
+
status: 400;
|
|
79
|
+
state: "failed";
|
|
80
|
+
message: string;
|
|
81
|
+
} | {
|
|
82
|
+
status: 200;
|
|
83
|
+
state: "success";
|
|
84
|
+
plan: TProPlan;
|
|
85
|
+
};
|
|
86
|
+
export type TApiProPlanGetReq = {
|
|
87
|
+
type: TProPlan["type"];
|
|
88
|
+
lastEvaluatedKey?: string;
|
|
89
|
+
limit?: number;
|
|
90
|
+
};
|
|
91
|
+
export type TApiProPlanGetRes = {
|
|
92
|
+
status: 400;
|
|
93
|
+
state: "failed";
|
|
94
|
+
message: string;
|
|
95
|
+
} | {
|
|
96
|
+
status: 200;
|
|
97
|
+
state: "success";
|
|
98
|
+
templates: TProPlanWithUserInfo[];
|
|
99
|
+
lastEvaluatedKey?: string;
|
|
100
|
+
hasMore: boolean;
|
|
101
|
+
};
|
|
102
|
+
export type TApiProPlanGetOneReq = {
|
|
103
|
+
planId: string;
|
|
104
|
+
};
|
|
105
|
+
export type TApiProPlanGetOneRes = {
|
|
106
|
+
status: 400;
|
|
107
|
+
state: "failed";
|
|
108
|
+
message: string;
|
|
109
|
+
} | {
|
|
110
|
+
status: 200;
|
|
111
|
+
state: "success";
|
|
112
|
+
plan: TProPlan;
|
|
113
|
+
};
|
|
114
|
+
export type TApiSharedProPlanGetReq = {
|
|
115
|
+
planCode: string;
|
|
116
|
+
};
|
|
117
|
+
export type TApiSharedProPlanGetRes = {
|
|
118
|
+
status: 400;
|
|
119
|
+
state: "failed";
|
|
120
|
+
message: string;
|
|
121
|
+
} | {
|
|
122
|
+
status: 203;
|
|
123
|
+
state: "success";
|
|
124
|
+
plan: {
|
|
125
|
+
name: TProPlan["name"];
|
|
126
|
+
description: TProPlan["description"];
|
|
127
|
+
planCode: string;
|
|
128
|
+
ownerId: string;
|
|
129
|
+
ownerCode: string;
|
|
130
|
+
avatarImgName: string;
|
|
131
|
+
};
|
|
132
|
+
} | {
|
|
133
|
+
status: 200;
|
|
134
|
+
state: "success";
|
|
135
|
+
plan: TProPlan & {
|
|
136
|
+
ownerCode: string;
|
|
137
|
+
ownerFullName: string;
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
export type TProPlanWithUserInfo = TProPlan & {
|
|
141
|
+
ownerInfo?: {
|
|
142
|
+
userCode: string;
|
|
143
|
+
fullName: string;
|
|
144
|
+
};
|
|
145
|
+
};
|