@burdenoff/microfe-atheletebridge 2026.629.1 → 2026.705.2
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/atheletebridge/AthleteBridgeRoot.js +45 -37
- package/dist/atheletebridge/AthleteBridgeRoot.js.map +1 -1
- package/dist/atheletebridge/AthleteBridgeRoutes.js +10 -6
- package/dist/atheletebridge/AthleteBridgeRoutes.js.map +1 -1
- package/dist/atheletebridge/components/AthleteSelect.js +66 -0
- package/dist/atheletebridge/components/AthleteSelect.js.map +1 -0
- package/dist/atheletebridge/components/DrillVideoLink.js +28 -0
- package/dist/atheletebridge/components/DrillVideoLink.js.map +1 -0
- package/dist/atheletebridge/components/MetricsCard.js +20 -46
- package/dist/atheletebridge/components/MetricsCard.js.map +1 -1
- package/dist/atheletebridge/components/UserSearchSelect.js +129 -0
- package/dist/atheletebridge/components/UserSearchSelect.js.map +1 -0
- package/dist/atheletebridge/components/domain.js +10 -1
- package/dist/atheletebridge/components/domain.js.map +1 -1
- package/dist/atheletebridge/hooks/useAthleteBridgeApi.js +313 -180
- package/dist/atheletebridge/hooks/useAthleteBridgeApi.js.map +1 -1
- package/dist/atheletebridge/pages/DashboardPage.js +77 -69
- package/dist/atheletebridge/pages/DashboardPage.js.map +1 -1
- package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.js +4 -4
- package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.js.map +1 -1
- package/dist/atheletebridge/pages/performance/PerformancePage.js +496 -0
- package/dist/atheletebridge/pages/performance/PerformancePage.js.map +1 -0
- package/dist/atheletebridge/pages/programs/ProgramDetailPage.js +176 -142
- package/dist/atheletebridge/pages/programs/ProgramDetailPage.js.map +1 -1
- package/dist/atheletebridge/pages/sessions/SessionDetailPage.js +86 -85
- package/dist/atheletebridge/pages/sessions/SessionDetailPage.js.map +1 -1
- package/dist/atheletebridge/pages/sessions/SessionFormPage.js +92 -98
- package/dist/atheletebridge/pages/sessions/SessionFormPage.js.map +1 -1
- package/dist/atheletebridge/pages/teams/TeamDetailPage.js +132 -137
- package/dist/atheletebridge/pages/teams/TeamDetailPage.js.map +1 -1
- package/dist/atheletebridge/utils/formatters.js +2 -25
- package/dist/atheletebridge/utils/formatters.js.map +1 -1
- package/dist/atheletebridge/utils/url.js +17 -0
- package/dist/atheletebridge/utils/url.js.map +1 -0
- package/dist/index.js +4 -4
- package/package.json +5 -5
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { useAthleteBridge as e } from "../context/AthleteBridgeContext.js";
|
|
2
2
|
import "../context/index.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { useCallback as t } from "react";
|
|
4
|
+
import { useMutation as n, useQuery as r, useQueryClient as i } from "@tanstack/react-query";
|
|
5
|
+
import { clearGraphqlFetchResponseCache as a, graphqlFetch as o } from "@burdenoff/fe-libs/shared/graphql";
|
|
5
6
|
//#region src/atheletebridge/hooks/useAthleteBridgeApi.ts
|
|
6
|
-
var
|
|
7
|
-
let r = await
|
|
7
|
+
var s = async (e, t, n) => {
|
|
8
|
+
let r = await o({
|
|
8
9
|
gateway: "workspace",
|
|
9
10
|
baseUrl: n,
|
|
10
11
|
query: e,
|
|
@@ -13,195 +14,222 @@ var a = async (e, t, n) => {
|
|
|
13
14
|
});
|
|
14
15
|
if (r.errors?.length) throw Error(r.errors[0]?.message ?? "GraphQL request failed");
|
|
15
16
|
if (!r.data) throw Error("GraphQL response did not include data");
|
|
16
|
-
return r.data;
|
|
17
|
-
},
|
|
18
|
-
let
|
|
19
|
-
|
|
17
|
+
return e.trimStart().startsWith("mutation") && a(), r.data;
|
|
18
|
+
}, c = async (e, t) => {
|
|
19
|
+
let n = await o({
|
|
20
|
+
gateway: "global",
|
|
21
|
+
query: e,
|
|
22
|
+
variables: t,
|
|
23
|
+
suppressGlobalErrorEvent: !0
|
|
24
|
+
});
|
|
25
|
+
if (n.errors?.length) throw Error(n.errors[0]?.message ?? "GraphQL request failed");
|
|
26
|
+
if (!n.data) throw Error("GraphQL response did not include data");
|
|
27
|
+
return n.data;
|
|
28
|
+
}, l = "\n id workspaceId name sport status description ageGroup season homeVenue\n headCoachId tags createdAt updatedAt\n", u = "\n id workspaceId teamId userId displayName role status position jerseyNumber\n height weight dominantSide notes joinedAt createdAt updatedAt\n", d = "\n id workspaceId type status competition round venue homeTeamId awayTeamId\n homeScore awayScore scheduledAt kickoffAt notes createdAt updatedAt\n homeTeam { id name sport }\n awayTeam { id name sport }\n", f = "\n id workspaceId competition teamId played won drawn lost goalsFor goalsAgainst\n points rank createdAt updatedAt\n team { id name sport }\n", p = "\n id workspaceId programId name description weekNumber orderIndex sets reps\n durationSec restSec createdAt updatedAt\n video { id }\n", m = "\n id workspaceId coachId name sport level status summary weeks isTemplate tags\n createdAt updatedAt\n", h = "\n id workspaceId coachId athleteId programId title type status location\n meetingUrl scheduledAt durationMin completedAt feedback rating\n createdAt updatedAt\n", g = "\n id workspaceId athleteId programId title status performedAt durationMin rpe\n totalLoad metrics notes createdAt updatedAt\n", _ = "\n id workspaceId athleteId type label value unit source recordedAt\n createdAt updatedAt\n", v = (t = {}) => {
|
|
29
|
+
let { apiGatewayUrl: n } = e();
|
|
30
|
+
return r({
|
|
20
31
|
queryKey: [
|
|
21
32
|
"atheletebridge",
|
|
22
33
|
"teams",
|
|
23
34
|
t
|
|
24
35
|
],
|
|
25
|
-
queryFn: async () => (await
|
|
36
|
+
queryFn: async () => (await s(`query AthListTeams($sport: AthSport, $status: AthTeamStatus, $pagination: PaginationInput) {
|
|
26
37
|
athListTeams(sport: $sport, status: $status, pagination: $pagination) {
|
|
27
|
-
items { ${
|
|
38
|
+
items { ${l} }
|
|
28
39
|
pageInfo { cursor hasMore }
|
|
29
40
|
}
|
|
30
41
|
}`, {
|
|
31
42
|
sport: t.sport,
|
|
32
43
|
status: t.status,
|
|
33
44
|
pagination: t.pagination
|
|
34
|
-
},
|
|
45
|
+
}, n)).athListTeams
|
|
35
46
|
});
|
|
36
|
-
},
|
|
37
|
-
let { apiGatewayUrl:
|
|
38
|
-
return
|
|
47
|
+
}, y = (t) => {
|
|
48
|
+
let { apiGatewayUrl: n } = e();
|
|
49
|
+
return r({
|
|
39
50
|
queryKey: [
|
|
40
51
|
"atheletebridge",
|
|
41
52
|
"team",
|
|
42
53
|
t
|
|
43
54
|
],
|
|
44
|
-
queryFn: async () => (await
|
|
55
|
+
queryFn: async () => (await s(`query AthTeam($id: ID!) {
|
|
45
56
|
athTeam(id: $id) {
|
|
46
|
-
${
|
|
47
|
-
members { ${
|
|
48
|
-
fixtures { ${
|
|
57
|
+
${l}
|
|
58
|
+
members { ${u} }
|
|
59
|
+
fixtures { ${d} }
|
|
49
60
|
}
|
|
50
|
-
}`, { id: t },
|
|
61
|
+
}`, { id: t }, n)).athTeam,
|
|
62
|
+
enabled: !!t
|
|
63
|
+
});
|
|
64
|
+
}, b = (t, n) => {
|
|
65
|
+
let { apiGatewayUrl: i } = e();
|
|
66
|
+
return r({
|
|
67
|
+
queryKey: [
|
|
68
|
+
"atheletebridge",
|
|
69
|
+
"members",
|
|
70
|
+
t,
|
|
71
|
+
n
|
|
72
|
+
],
|
|
73
|
+
queryFn: async () => (await s(`query AthListMembers($teamId: ID!, $status: AthMemberStatus) {
|
|
74
|
+
athListMembers(teamId: $teamId, status: $status) { ${u} }
|
|
75
|
+
}`, {
|
|
76
|
+
teamId: t,
|
|
77
|
+
status: n
|
|
78
|
+
}, i)).athListMembers,
|
|
51
79
|
enabled: !!t
|
|
52
80
|
});
|
|
53
|
-
},
|
|
54
|
-
let
|
|
55
|
-
return
|
|
56
|
-
mutationFn: async (e) => (await
|
|
57
|
-
athCreateTeam(input: $input) { ${
|
|
58
|
-
}`, { input: e },
|
|
81
|
+
}, x = () => {
|
|
82
|
+
let t = i(), { apiGatewayUrl: r } = e();
|
|
83
|
+
return n({
|
|
84
|
+
mutationFn: async (e) => (await s(`mutation AthCreateTeam($input: AthCreateTeamInput!) {
|
|
85
|
+
athCreateTeam(input: $input) { ${l} }
|
|
86
|
+
}`, { input: e }, r)).athCreateTeam,
|
|
59
87
|
onSuccess: () => {
|
|
60
|
-
|
|
88
|
+
t.invalidateQueries({ queryKey: ["atheletebridge", "teams"] });
|
|
61
89
|
}
|
|
62
90
|
});
|
|
63
|
-
},
|
|
64
|
-
let
|
|
65
|
-
return
|
|
66
|
-
mutationFn: async ({ id: e, input: t }) => (await
|
|
67
|
-
athUpdateTeam(id: $id, input: $input) { ${
|
|
91
|
+
}, S = () => {
|
|
92
|
+
let t = i(), { apiGatewayUrl: r } = e();
|
|
93
|
+
return n({
|
|
94
|
+
mutationFn: async ({ id: e, input: t }) => (await s(`mutation AthUpdateTeam($id: ID!, $input: AthUpdateTeamInput!) {
|
|
95
|
+
athUpdateTeam(id: $id, input: $input) { ${l} }
|
|
68
96
|
}`, {
|
|
69
97
|
id: e,
|
|
70
98
|
input: t
|
|
71
|
-
},
|
|
99
|
+
}, r)).athUpdateTeam,
|
|
72
100
|
onSuccess: (e) => {
|
|
73
|
-
|
|
101
|
+
t.invalidateQueries({ queryKey: ["atheletebridge", "teams"] }), t.invalidateQueries({ queryKey: [
|
|
74
102
|
"atheletebridge",
|
|
75
103
|
"team",
|
|
76
104
|
e.id
|
|
77
105
|
] });
|
|
78
106
|
}
|
|
79
107
|
});
|
|
80
|
-
},
|
|
81
|
-
let
|
|
82
|
-
return
|
|
83
|
-
mutationFn: async (e) => (await
|
|
108
|
+
}, C = () => {
|
|
109
|
+
let t = i(), { apiGatewayUrl: r } = e();
|
|
110
|
+
return n({
|
|
111
|
+
mutationFn: async (e) => (await s("mutation AthArchiveTeam($id: ID!) { athArchiveTeam(id: $id) }", { id: e }, r)).athArchiveTeam,
|
|
84
112
|
onSuccess: () => {
|
|
85
|
-
|
|
113
|
+
t.invalidateQueries({ queryKey: ["atheletebridge", "teams"] });
|
|
86
114
|
}
|
|
87
115
|
});
|
|
88
|
-
},
|
|
89
|
-
let
|
|
90
|
-
return
|
|
91
|
-
mutationFn: async (e) => (await
|
|
92
|
-
athAddMember(input: $input) { ${
|
|
93
|
-
}`, { input: e },
|
|
116
|
+
}, w = () => {
|
|
117
|
+
let t = i(), { apiGatewayUrl: r } = e();
|
|
118
|
+
return n({
|
|
119
|
+
mutationFn: async (e) => (await s(`mutation AthAddMember($input: AthAddMemberInput!) {
|
|
120
|
+
athAddMember(input: $input) { ${u} }
|
|
121
|
+
}`, { input: e }, r)).athAddMember,
|
|
94
122
|
onSuccess: (e) => {
|
|
95
|
-
|
|
123
|
+
t.invalidateQueries({ queryKey: [
|
|
96
124
|
"atheletebridge",
|
|
97
125
|
"members",
|
|
98
126
|
e.teamId
|
|
99
|
-
] }),
|
|
127
|
+
] }), t.invalidateQueries({ queryKey: [
|
|
100
128
|
"atheletebridge",
|
|
101
129
|
"team",
|
|
102
130
|
e.teamId
|
|
103
131
|
] });
|
|
104
132
|
}
|
|
105
133
|
});
|
|
106
|
-
},
|
|
107
|
-
let
|
|
108
|
-
return
|
|
109
|
-
mutationFn: async (e) => (await
|
|
134
|
+
}, T = (t) => {
|
|
135
|
+
let r = i(), { apiGatewayUrl: a } = e();
|
|
136
|
+
return n({
|
|
137
|
+
mutationFn: async (e) => (await s("mutation AthRemoveMember($id: ID!) { athRemoveMember(id: $id) }", { id: e }, a)).athRemoveMember,
|
|
110
138
|
onSuccess: () => {
|
|
111
|
-
|
|
139
|
+
r.invalidateQueries({ queryKey: [
|
|
112
140
|
"atheletebridge",
|
|
113
141
|
"members",
|
|
114
|
-
|
|
115
|
-
] }),
|
|
142
|
+
t
|
|
143
|
+
] }), r.invalidateQueries({ queryKey: [
|
|
116
144
|
"atheletebridge",
|
|
117
145
|
"team",
|
|
118
|
-
|
|
146
|
+
t
|
|
119
147
|
] });
|
|
120
148
|
}
|
|
121
149
|
});
|
|
122
|
-
},
|
|
123
|
-
let { apiGatewayUrl:
|
|
124
|
-
return
|
|
150
|
+
}, E = (t = {}) => {
|
|
151
|
+
let { apiGatewayUrl: n } = e();
|
|
152
|
+
return r({
|
|
125
153
|
queryKey: [
|
|
126
154
|
"atheletebridge",
|
|
127
155
|
"fixtures",
|
|
128
156
|
t
|
|
129
157
|
],
|
|
130
|
-
queryFn: async () => (await
|
|
158
|
+
queryFn: async () => (await s(`query AthListFixtures($status: AthFixtureStatus, $teamId: ID, $pagination: PaginationInput) {
|
|
131
159
|
athListFixtures(status: $status, teamId: $teamId, pagination: $pagination) {
|
|
132
|
-
items { ${
|
|
160
|
+
items { ${d} }
|
|
133
161
|
pageInfo { cursor hasMore }
|
|
134
162
|
}
|
|
135
163
|
}`, {
|
|
136
164
|
status: t.status,
|
|
137
165
|
teamId: t.teamId,
|
|
138
166
|
pagination: t.pagination
|
|
139
|
-
},
|
|
167
|
+
}, n)).athListFixtures
|
|
140
168
|
});
|
|
141
|
-
},
|
|
142
|
-
let { apiGatewayUrl:
|
|
143
|
-
return
|
|
169
|
+
}, D = (t) => {
|
|
170
|
+
let { apiGatewayUrl: n } = e();
|
|
171
|
+
return r({
|
|
144
172
|
queryKey: [
|
|
145
173
|
"atheletebridge",
|
|
146
174
|
"fixture",
|
|
147
175
|
t
|
|
148
176
|
],
|
|
149
|
-
queryFn: async () => (await
|
|
150
|
-
athFixture(id: $id) { ${
|
|
151
|
-
}`, { id: t },
|
|
177
|
+
queryFn: async () => (await s(`query AthFixture($id: ID!) {
|
|
178
|
+
athFixture(id: $id) { ${d} }
|
|
179
|
+
}`, { id: t }, n)).athFixture,
|
|
152
180
|
enabled: !!t
|
|
153
181
|
});
|
|
154
|
-
},
|
|
155
|
-
let { apiGatewayUrl:
|
|
156
|
-
return
|
|
182
|
+
}, O = (t) => {
|
|
183
|
+
let { apiGatewayUrl: n } = e();
|
|
184
|
+
return r({
|
|
157
185
|
queryKey: [
|
|
158
186
|
"atheletebridge",
|
|
159
187
|
"standings",
|
|
160
188
|
t
|
|
161
189
|
],
|
|
162
|
-
queryFn: async () => (await
|
|
163
|
-
athStandings(competition: $competition) { ${
|
|
164
|
-
}`, { competition: t },
|
|
190
|
+
queryFn: async () => (await s(`query AthStandings($competition: String!) {
|
|
191
|
+
athStandings(competition: $competition) { ${f} }
|
|
192
|
+
}`, { competition: t }, n)).athStandings,
|
|
165
193
|
enabled: !!t
|
|
166
194
|
});
|
|
167
|
-
},
|
|
168
|
-
let
|
|
169
|
-
return
|
|
170
|
-
mutationFn: async (e) => (await
|
|
171
|
-
athScheduleFixture(input: $input) { ${
|
|
172
|
-
}`, { input: e },
|
|
195
|
+
}, k = () => {
|
|
196
|
+
let t = i(), { apiGatewayUrl: r } = e();
|
|
197
|
+
return n({
|
|
198
|
+
mutationFn: async (e) => (await s(`mutation AthScheduleFixture($input: AthCreateFixtureInput!) {
|
|
199
|
+
athScheduleFixture(input: $input) { ${d} }
|
|
200
|
+
}`, { input: e }, r)).athScheduleFixture,
|
|
173
201
|
onSuccess: () => {
|
|
174
|
-
|
|
202
|
+
t.invalidateQueries({ queryKey: ["atheletebridge", "fixtures"] });
|
|
175
203
|
}
|
|
176
204
|
});
|
|
177
|
-
},
|
|
178
|
-
let
|
|
179
|
-
return
|
|
180
|
-
mutationFn: async ({ id: e, input: t }) => (await
|
|
181
|
-
athRecordFixtureResult(id: $id, input: $input) { ${
|
|
205
|
+
}, A = () => {
|
|
206
|
+
let t = i(), { apiGatewayUrl: r } = e();
|
|
207
|
+
return n({
|
|
208
|
+
mutationFn: async ({ id: e, input: t }) => (await s(`mutation AthRecordFixtureResult($id: ID!, $input: AthRecordResultInput!) {
|
|
209
|
+
athRecordFixtureResult(id: $id, input: $input) { ${d} }
|
|
182
210
|
}`, {
|
|
183
211
|
id: e,
|
|
184
212
|
input: t
|
|
185
|
-
},
|
|
213
|
+
}, r)).athRecordFixtureResult,
|
|
186
214
|
onSuccess: (e) => {
|
|
187
|
-
|
|
215
|
+
t.invalidateQueries({ queryKey: ["atheletebridge", "fixtures"] }), t.invalidateQueries({ queryKey: [
|
|
188
216
|
"atheletebridge",
|
|
189
217
|
"fixture",
|
|
190
218
|
e.id
|
|
191
|
-
] }),
|
|
219
|
+
] }), t.invalidateQueries({ queryKey: ["atheletebridge", "standings"] });
|
|
192
220
|
}
|
|
193
221
|
});
|
|
194
|
-
},
|
|
195
|
-
let { apiGatewayUrl:
|
|
196
|
-
return
|
|
222
|
+
}, j = (t = {}) => {
|
|
223
|
+
let { apiGatewayUrl: n } = e();
|
|
224
|
+
return r({
|
|
197
225
|
queryKey: [
|
|
198
226
|
"atheletebridge",
|
|
199
227
|
"programs",
|
|
200
228
|
t
|
|
201
229
|
],
|
|
202
|
-
queryFn: async () => (await
|
|
230
|
+
queryFn: async () => (await s(`query AthListPrograms($sport: AthSport, $level: AthProgramLevel, $status: AthProgramStatus, $pagination: PaginationInput) {
|
|
203
231
|
athListPrograms(sport: $sport, level: $level, status: $status, pagination: $pagination) {
|
|
204
|
-
items { ${
|
|
232
|
+
items { ${m} }
|
|
205
233
|
pageInfo { cursor hasMore }
|
|
206
234
|
}
|
|
207
235
|
}`, {
|
|
@@ -209,113 +237,113 @@ var a = async (e, t, n) => {
|
|
|
209
237
|
level: t.level,
|
|
210
238
|
status: t.status,
|
|
211
239
|
pagination: t.pagination
|
|
212
|
-
},
|
|
240
|
+
}, n)).athListPrograms
|
|
213
241
|
});
|
|
214
|
-
},
|
|
215
|
-
let { apiGatewayUrl:
|
|
216
|
-
return
|
|
242
|
+
}, M = (t) => {
|
|
243
|
+
let { apiGatewayUrl: n } = e();
|
|
244
|
+
return r({
|
|
217
245
|
queryKey: [
|
|
218
246
|
"atheletebridge",
|
|
219
247
|
"program",
|
|
220
248
|
t
|
|
221
249
|
],
|
|
222
|
-
queryFn: async () => (await
|
|
250
|
+
queryFn: async () => (await s(`query AthProgram($id: ID!) {
|
|
223
251
|
athProgram(id: $id) {
|
|
224
|
-
${
|
|
225
|
-
drills { ${
|
|
252
|
+
${m}
|
|
253
|
+
drills { ${p} }
|
|
226
254
|
}
|
|
227
|
-
}`, { id: t },
|
|
255
|
+
}`, { id: t }, n)).athProgram,
|
|
228
256
|
enabled: !!t
|
|
229
257
|
});
|
|
230
|
-
},
|
|
231
|
-
let
|
|
232
|
-
return
|
|
233
|
-
mutationFn: async (e) => (await
|
|
234
|
-
athCreateProgram(input: $input) { ${
|
|
235
|
-
}`, { input: e },
|
|
258
|
+
}, N = () => {
|
|
259
|
+
let t = i(), { apiGatewayUrl: r } = e();
|
|
260
|
+
return n({
|
|
261
|
+
mutationFn: async (e) => (await s(`mutation AthCreateProgram($input: AthCreateProgramInput!) {
|
|
262
|
+
athCreateProgram(input: $input) { ${m} }
|
|
263
|
+
}`, { input: e }, r)).athCreateProgram,
|
|
236
264
|
onSuccess: () => {
|
|
237
|
-
|
|
265
|
+
t.invalidateQueries({ queryKey: ["atheletebridge", "programs"] });
|
|
238
266
|
}
|
|
239
267
|
});
|
|
240
|
-
},
|
|
241
|
-
let
|
|
242
|
-
return
|
|
243
|
-
mutationFn: async ({ id: e, input: t }) => (await
|
|
244
|
-
athUpdateProgram(id: $id, input: $input) { ${
|
|
268
|
+
}, P = () => {
|
|
269
|
+
let t = i(), { apiGatewayUrl: r } = e();
|
|
270
|
+
return n({
|
|
271
|
+
mutationFn: async ({ id: e, input: t }) => (await s(`mutation AthUpdateProgram($id: ID!, $input: AthUpdateProgramInput!) {
|
|
272
|
+
athUpdateProgram(id: $id, input: $input) { ${m} }
|
|
245
273
|
}`, {
|
|
246
274
|
id: e,
|
|
247
275
|
input: t
|
|
248
|
-
},
|
|
276
|
+
}, r)).athUpdateProgram,
|
|
249
277
|
onSuccess: (e) => {
|
|
250
|
-
|
|
278
|
+
t.invalidateQueries({ queryKey: ["atheletebridge", "programs"] }), t.invalidateQueries({ queryKey: [
|
|
251
279
|
"atheletebridge",
|
|
252
280
|
"program",
|
|
253
281
|
e.id
|
|
254
282
|
] });
|
|
255
283
|
}
|
|
256
284
|
});
|
|
257
|
-
},
|
|
258
|
-
let
|
|
259
|
-
return
|
|
260
|
-
mutationFn: async ({ id: e, status: t }) => (await
|
|
261
|
-
athTransitionProgram(id: $id, status: $status) { ${
|
|
285
|
+
}, F = () => {
|
|
286
|
+
let t = i(), { apiGatewayUrl: r } = e();
|
|
287
|
+
return n({
|
|
288
|
+
mutationFn: async ({ id: e, status: t }) => (await s(`mutation AthTransitionProgram($id: ID!, $status: AthProgramStatus!) {
|
|
289
|
+
athTransitionProgram(id: $id, status: $status) { ${m} }
|
|
262
290
|
}`, {
|
|
263
291
|
id: e,
|
|
264
292
|
status: t
|
|
265
|
-
},
|
|
293
|
+
}, r)).athTransitionProgram,
|
|
266
294
|
onSuccess: (e) => {
|
|
267
|
-
|
|
295
|
+
t.invalidateQueries({ queryKey: ["atheletebridge", "programs"] }), t.invalidateQueries({ queryKey: [
|
|
268
296
|
"atheletebridge",
|
|
269
297
|
"program",
|
|
270
298
|
e.id
|
|
271
299
|
] });
|
|
272
300
|
}
|
|
273
301
|
});
|
|
274
|
-
},
|
|
275
|
-
let
|
|
276
|
-
return
|
|
277
|
-
mutationFn: async (e) => (await
|
|
302
|
+
}, I = () => {
|
|
303
|
+
let t = i(), { apiGatewayUrl: r } = e();
|
|
304
|
+
return n({
|
|
305
|
+
mutationFn: async (e) => (await s("mutation AthArchiveProgram($id: ID!) { athArchiveProgram(id: $id) }", { id: e }, r)).athArchiveProgram,
|
|
278
306
|
onSuccess: () => {
|
|
279
|
-
|
|
307
|
+
t.invalidateQueries({ queryKey: ["atheletebridge", "programs"] });
|
|
280
308
|
}
|
|
281
309
|
});
|
|
282
|
-
},
|
|
283
|
-
let
|
|
284
|
-
return
|
|
285
|
-
mutationFn: async (e) => (await
|
|
286
|
-
athAddDrill(input: $input) { ${
|
|
287
|
-
}`, { input: e },
|
|
310
|
+
}, L = () => {
|
|
311
|
+
let t = i(), { apiGatewayUrl: r } = e();
|
|
312
|
+
return n({
|
|
313
|
+
mutationFn: async (e) => (await s(`mutation AthAddDrill($input: AthAddDrillInput!) {
|
|
314
|
+
athAddDrill(input: $input) { ${p} }
|
|
315
|
+
}`, { input: e }, r)).athAddDrill,
|
|
288
316
|
onSuccess: (e) => {
|
|
289
|
-
|
|
317
|
+
t.invalidateQueries({ queryKey: [
|
|
290
318
|
"atheletebridge",
|
|
291
319
|
"program",
|
|
292
320
|
e.programId
|
|
293
321
|
] });
|
|
294
322
|
}
|
|
295
323
|
});
|
|
296
|
-
},
|
|
297
|
-
let
|
|
298
|
-
return
|
|
299
|
-
mutationFn: async (e) => (await
|
|
324
|
+
}, R = (t) => {
|
|
325
|
+
let r = i(), { apiGatewayUrl: a } = e();
|
|
326
|
+
return n({
|
|
327
|
+
mutationFn: async (e) => (await s("mutation AthRemoveDrill($id: ID!) { athRemoveDrill(id: $id) }", { id: e }, a)).athRemoveDrill,
|
|
300
328
|
onSuccess: () => {
|
|
301
|
-
|
|
329
|
+
r.invalidateQueries({ queryKey: [
|
|
302
330
|
"atheletebridge",
|
|
303
331
|
"program",
|
|
304
|
-
|
|
332
|
+
t
|
|
305
333
|
] });
|
|
306
334
|
}
|
|
307
335
|
});
|
|
308
|
-
},
|
|
309
|
-
let { apiGatewayUrl:
|
|
310
|
-
return
|
|
336
|
+
}, z = (t = {}) => {
|
|
337
|
+
let { apiGatewayUrl: n } = e();
|
|
338
|
+
return r({
|
|
311
339
|
queryKey: [
|
|
312
340
|
"atheletebridge",
|
|
313
341
|
"sessions",
|
|
314
342
|
t
|
|
315
343
|
],
|
|
316
|
-
queryFn: async () => (await
|
|
344
|
+
queryFn: async () => (await s(`query AthListSessions($athleteId: ID, $coachId: ID, $status: AthSessionStatus, $pagination: PaginationInput) {
|
|
317
345
|
athListSessions(athleteId: $athleteId, coachId: $coachId, status: $status, pagination: $pagination) {
|
|
318
|
-
items { ${
|
|
346
|
+
items { ${h} }
|
|
319
347
|
pageInfo { cursor hasMore }
|
|
320
348
|
}
|
|
321
349
|
}`, {
|
|
@@ -323,78 +351,183 @@ var a = async (e, t, n) => {
|
|
|
323
351
|
coachId: t.coachId,
|
|
324
352
|
status: t.status,
|
|
325
353
|
pagination: t.pagination
|
|
326
|
-
},
|
|
354
|
+
}, n)).athListSessions
|
|
327
355
|
});
|
|
328
|
-
},
|
|
329
|
-
let { apiGatewayUrl:
|
|
330
|
-
return
|
|
356
|
+
}, B = (t) => {
|
|
357
|
+
let { apiGatewayUrl: n } = e();
|
|
358
|
+
return r({
|
|
331
359
|
queryKey: [
|
|
332
360
|
"atheletebridge",
|
|
333
361
|
"session",
|
|
334
362
|
t
|
|
335
363
|
],
|
|
336
|
-
queryFn: async () => (await
|
|
337
|
-
athSession(id: $id) { ${
|
|
338
|
-
}`, { id: t },
|
|
364
|
+
queryFn: async () => (await s(`query AthSession($id: ID!) {
|
|
365
|
+
athSession(id: $id) { ${h} }
|
|
366
|
+
}`, { id: t }, n)).athSession,
|
|
339
367
|
enabled: !!t
|
|
340
368
|
});
|
|
341
|
-
},
|
|
342
|
-
let
|
|
343
|
-
return
|
|
344
|
-
mutationFn: async (e) => (await
|
|
345
|
-
athBookSession(input: $input) { ${
|
|
346
|
-
}`, { input: e },
|
|
369
|
+
}, V = () => {
|
|
370
|
+
let t = i(), { apiGatewayUrl: r } = e();
|
|
371
|
+
return n({
|
|
372
|
+
mutationFn: async (e) => (await s(`mutation AthBookSession($input: AthBookSessionInput!) {
|
|
373
|
+
athBookSession(input: $input) { ${h} }
|
|
374
|
+
}`, { input: e }, r)).athBookSession,
|
|
347
375
|
onSuccess: () => {
|
|
348
|
-
|
|
376
|
+
t.invalidateQueries({ queryKey: ["atheletebridge", "sessions"] });
|
|
349
377
|
}
|
|
350
378
|
});
|
|
351
|
-
},
|
|
352
|
-
let
|
|
353
|
-
return
|
|
354
|
-
mutationFn: async (e) => (await
|
|
355
|
-
athConfirmSession(id: $id) { ${
|
|
356
|
-
}`, { id: e },
|
|
379
|
+
}, H = () => {
|
|
380
|
+
let t = i(), { apiGatewayUrl: r } = e();
|
|
381
|
+
return n({
|
|
382
|
+
mutationFn: async (e) => (await s(`mutation AthConfirmSession($id: ID!) {
|
|
383
|
+
athConfirmSession(id: $id) { ${h} }
|
|
384
|
+
}`, { id: e }, r)).athConfirmSession,
|
|
357
385
|
onSuccess: (e) => {
|
|
358
|
-
|
|
386
|
+
t.invalidateQueries({ queryKey: ["atheletebridge", "sessions"] }), t.invalidateQueries({ queryKey: [
|
|
359
387
|
"atheletebridge",
|
|
360
388
|
"session",
|
|
361
389
|
e.id
|
|
362
390
|
] });
|
|
363
391
|
}
|
|
364
392
|
});
|
|
365
|
-
},
|
|
366
|
-
let
|
|
367
|
-
return
|
|
368
|
-
mutationFn: async ({ id: e, input: t }) => (await
|
|
369
|
-
athCompleteSession(id: $id, input: $input) { ${
|
|
393
|
+
}, U = () => {
|
|
394
|
+
let t = i(), { apiGatewayUrl: r } = e();
|
|
395
|
+
return n({
|
|
396
|
+
mutationFn: async ({ id: e, input: t }) => (await s(`mutation AthCompleteSession($id: ID!, $input: AthCompleteSessionInput) {
|
|
397
|
+
athCompleteSession(id: $id, input: $input) { ${h} }
|
|
370
398
|
}`, {
|
|
371
399
|
id: e,
|
|
372
400
|
input: t
|
|
373
|
-
},
|
|
401
|
+
}, r)).athCompleteSession,
|
|
374
402
|
onSuccess: (e) => {
|
|
375
|
-
|
|
403
|
+
t.invalidateQueries({ queryKey: ["atheletebridge", "sessions"] }), t.invalidateQueries({ queryKey: [
|
|
376
404
|
"atheletebridge",
|
|
377
405
|
"session",
|
|
378
406
|
e.id
|
|
379
407
|
] });
|
|
380
408
|
}
|
|
381
409
|
});
|
|
382
|
-
},
|
|
383
|
-
let
|
|
384
|
-
return
|
|
385
|
-
mutationFn: async (e) => (await
|
|
386
|
-
athCancelSession(id: $id) { ${
|
|
387
|
-
}`, { id: e },
|
|
410
|
+
}, W = () => {
|
|
411
|
+
let t = i(), { apiGatewayUrl: r } = e();
|
|
412
|
+
return n({
|
|
413
|
+
mutationFn: async (e) => (await s(`mutation AthCancelSession($id: ID!) {
|
|
414
|
+
athCancelSession(id: $id) { ${h} }
|
|
415
|
+
}`, { id: e }, r)).athCancelSession,
|
|
388
416
|
onSuccess: (e) => {
|
|
389
|
-
|
|
417
|
+
t.invalidateQueries({ queryKey: ["atheletebridge", "sessions"] }), t.invalidateQueries({ queryKey: [
|
|
390
418
|
"atheletebridge",
|
|
391
419
|
"session",
|
|
392
420
|
e.id
|
|
393
421
|
] });
|
|
394
422
|
}
|
|
395
423
|
});
|
|
424
|
+
}, G = (t = {}) => {
|
|
425
|
+
let { apiGatewayUrl: n } = e();
|
|
426
|
+
return r({
|
|
427
|
+
queryKey: [
|
|
428
|
+
"atheletebridge",
|
|
429
|
+
"workout-logs",
|
|
430
|
+
t
|
|
431
|
+
],
|
|
432
|
+
queryFn: async () => (await s(`query AthListWorkoutLogs($athleteId: ID, $programId: ID, $pagination: PaginationInput) {
|
|
433
|
+
athListWorkoutLogs(athleteId: $athleteId, programId: $programId, pagination: $pagination) {
|
|
434
|
+
items { ${g} }
|
|
435
|
+
pageInfo { cursor hasMore }
|
|
436
|
+
}
|
|
437
|
+
}`, {
|
|
438
|
+
athleteId: t.athleteId,
|
|
439
|
+
programId: t.programId,
|
|
440
|
+
pagination: t.pagination
|
|
441
|
+
}, n)).athListWorkoutLogs
|
|
442
|
+
});
|
|
443
|
+
}, K = (t) => {
|
|
444
|
+
let { apiGatewayUrl: n } = e();
|
|
445
|
+
return r({
|
|
446
|
+
queryKey: [
|
|
447
|
+
"atheletebridge",
|
|
448
|
+
"metrics",
|
|
449
|
+
t
|
|
450
|
+
],
|
|
451
|
+
queryFn: async () => (await s(`query AthPerformanceMetrics($athleteId: ID!) {
|
|
452
|
+
athPerformanceMetrics(athleteId: $athleteId) { ${_} }
|
|
453
|
+
}`, { athleteId: t }, n)).athPerformanceMetrics,
|
|
454
|
+
enabled: !!t
|
|
455
|
+
});
|
|
456
|
+
}, q = () => {
|
|
457
|
+
let t = i(), { apiGatewayUrl: r } = e();
|
|
458
|
+
return n({
|
|
459
|
+
mutationFn: async (e) => (await s(`mutation AthLogWorkout($input: AthLogWorkoutInput!) {
|
|
460
|
+
athLogWorkout(input: $input) { ${g} }
|
|
461
|
+
}`, { input: e }, r)).athLogWorkout,
|
|
462
|
+
onSuccess: () => {
|
|
463
|
+
t.invalidateQueries({ queryKey: ["atheletebridge", "workout-logs"] });
|
|
464
|
+
}
|
|
465
|
+
});
|
|
466
|
+
}, J = () => {
|
|
467
|
+
let t = i(), { apiGatewayUrl: r } = e();
|
|
468
|
+
return n({
|
|
469
|
+
mutationFn: async (e) => (await s(`mutation AthRecordMetric($input: AthRecordMetricInput!) {
|
|
470
|
+
athRecordMetric(input: $input) { ${_} }
|
|
471
|
+
}`, { input: e }, r)).athRecordMetric,
|
|
472
|
+
onSuccess: () => {
|
|
473
|
+
t.invalidateQueries({ queryKey: ["atheletebridge", "metrics"] });
|
|
474
|
+
}
|
|
475
|
+
});
|
|
476
|
+
}, Y = (e) => {
|
|
477
|
+
let t = e.lastIndexOf(".");
|
|
478
|
+
return t >= 0 ? e.slice(t + 1).toLowerCase() : "bin";
|
|
479
|
+
}, X = () => {
|
|
480
|
+
let { apiGatewayUrl: n } = e();
|
|
481
|
+
return t(async (e) => {
|
|
482
|
+
let t = await s("mutation AthInitiateUpload($input: InitiateUploadInput!) {\n initiateUpload(input: $input) { uploadUrl session { id } }\n }", { input: {
|
|
483
|
+
fileName: e.name,
|
|
484
|
+
extension: Y(e.name),
|
|
485
|
+
fileSize: e.size,
|
|
486
|
+
mimeType: e.type || "application/octet-stream",
|
|
487
|
+
visibility: "WORKSPACE"
|
|
488
|
+
} }, n), r = t.initiateUpload.uploadUrl, i = t.initiateUpload.session.id;
|
|
489
|
+
if (!r || !i) throw Error("Upload could not be initialised.");
|
|
490
|
+
let a = await fetch(r, {
|
|
491
|
+
method: "PUT",
|
|
492
|
+
body: e,
|
|
493
|
+
headers: { "Content-Type": e.type || "application/octet-stream" }
|
|
494
|
+
});
|
|
495
|
+
if (!a.ok) throw Error(`Storage rejected the upload (HTTP ${a.status}).`);
|
|
496
|
+
return (await s("mutation AthCompleteUpload($input: CompleteUploadInput!) {\n completeUpload(input: $input) { fileId }\n }", { input: { sessionId: i } }, n)).completeUpload.fileId;
|
|
497
|
+
}, [n]);
|
|
498
|
+
}, Z = (t) => {
|
|
499
|
+
let { apiGatewayUrl: n } = e();
|
|
500
|
+
return r({
|
|
501
|
+
queryKey: [
|
|
502
|
+
"atheletebridge",
|
|
503
|
+
"file",
|
|
504
|
+
t
|
|
505
|
+
],
|
|
506
|
+
queryFn: async () => (await s("query AthGetFile($id: ID!) {\n getFile(id: $id) { id name downloadUrl }\n }", { id: t }, n)).getFile,
|
|
507
|
+
enabled: !!t,
|
|
508
|
+
staleTime: 6e4
|
|
509
|
+
});
|
|
510
|
+
}, Q = (e) => e.name?.trim() ? e.name.trim() : [e.firstName, e.lastName].filter(Boolean).join(" ").trim() || (e.username?.trim() ? e.username.trim() : e.email), $ = (e) => {
|
|
511
|
+
let t = e.trim();
|
|
512
|
+
return r({
|
|
513
|
+
queryKey: [
|
|
514
|
+
"atheletebridge",
|
|
515
|
+
"user-search",
|
|
516
|
+
t
|
|
517
|
+
],
|
|
518
|
+
queryFn: async () => (await c("query AthUserSearch($filter: UserFilterInput, $pagination: PaginationInput) {\n users(filter: $filter, pagination: $pagination) {\n users { id name firstName lastName email username }\n hasMore\n }\n }", {
|
|
519
|
+
filter: { search: t },
|
|
520
|
+
pagination: {
|
|
521
|
+
limit: 8,
|
|
522
|
+
offset: 0
|
|
523
|
+
}
|
|
524
|
+
})).users.users,
|
|
525
|
+
enabled: t.length >= 2,
|
|
526
|
+
staleTime: 3e4,
|
|
527
|
+
retry: !1
|
|
528
|
+
});
|
|
396
529
|
};
|
|
397
530
|
//#endregion
|
|
398
|
-
export {
|
|
531
|
+
export { Q as directoryUserName, L as useAddDrill, w as useAddMember, I as useArchiveProgram, C as useArchiveTeam, V as useBookSession, W as useCancelSession, U as useCompleteSession, H as useConfirmSession, N as useCreateProgram, x as useCreateTeam, Z as useFile, D as useFixture, E as useFixtures, q as useLogWorkout, K as usePerformanceMetrics, M as useProgram, j as usePrograms, A as useRecordFixtureResult, J as useRecordMetric, R as useRemoveDrill, T as useRemoveMember, k as useScheduleFixture, B as useSession, z as useSessions, O as useStandings, y as useTeam, b as useTeamMembers, v as useTeams, F as useTransitionProgram, P as useUpdateProgram, S as useUpdateTeam, X as useUploadFile, $ as useUserSearch, G as useWorkoutLogs };
|
|
399
532
|
|
|
400
533
|
//# sourceMappingURL=useAthleteBridgeApi.js.map
|