@burdenoff/microfe-atheletebridge 2026.1031.2 → 2026.1102.1
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.d.ts.map +1 -1
- package/dist/atheletebridge/AthleteBridgeRoot.js +63 -47
- package/dist/atheletebridge/AthleteBridgeRoot.js.map +1 -1
- package/dist/atheletebridge/AthleteBridgeRoutes.d.ts.map +1 -1
- package/dist/atheletebridge/AthleteBridgeRoutes.js +62 -6
- package/dist/atheletebridge/AthleteBridgeRoutes.js.map +1 -1
- package/dist/atheletebridge/components/StatusBadge.d.ts.map +1 -1
- package/dist/atheletebridge/components/StatusBadge.js +13 -1
- package/dist/atheletebridge/components/StatusBadge.js.map +1 -1
- package/dist/atheletebridge/components/registration/PaymentSummaryPanel.d.ts +6 -0
- package/dist/atheletebridge/components/registration/PaymentSummaryPanel.d.ts.map +1 -0
- package/dist/atheletebridge/components/registration/PaymentSummaryPanel.js +104 -0
- package/dist/atheletebridge/components/registration/PaymentSummaryPanel.js.map +1 -0
- package/dist/atheletebridge/components/registration/RegistrationEntryFields.d.ts +15 -0
- package/dist/atheletebridge/components/registration/RegistrationEntryFields.d.ts.map +1 -0
- package/dist/atheletebridge/components/registration/RegistrationEntryFields.js +236 -0
- package/dist/atheletebridge/components/registration/RegistrationEntryFields.js.map +1 -0
- package/dist/atheletebridge/components/registration/entryRules.d.ts +23 -0
- package/dist/atheletebridge/components/registration/entryRules.d.ts.map +1 -0
- package/dist/atheletebridge/components/registration/entryRules.js +29 -0
- package/dist/atheletebridge/components/registration/entryRules.js.map +1 -0
- package/dist/atheletebridge/hooks/useAthleteBridgeApi.d.ts +6 -2
- package/dist/atheletebridge/hooks/useAthleteBridgeApi.d.ts.map +1 -1
- package/dist/atheletebridge/hooks/useAthleteBridgeApi.js +297 -281
- package/dist/atheletebridge/hooks/useAthleteBridgeApi.js.map +1 -1
- package/dist/atheletebridge/hooks/useRegistrationApi.d.ts +54 -0
- package/dist/atheletebridge/hooks/useRegistrationApi.d.ts.map +1 -0
- package/dist/atheletebridge/hooks/useRegistrationApi.js +265 -0
- package/dist/atheletebridge/hooks/useRegistrationApi.js.map +1 -0
- package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.d.ts.map +1 -1
- package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.js +123 -416
- package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.js.map +1 -1
- package/dist/atheletebridge/pages/registrations/MyRegistrationsPage.d.ts +10 -0
- package/dist/atheletebridge/pages/registrations/MyRegistrationsPage.d.ts.map +1 -0
- package/dist/atheletebridge/pages/registrations/MyRegistrationsPage.js +89 -0
- package/dist/atheletebridge/pages/registrations/MyRegistrationsPage.js.map +1 -0
- package/dist/atheletebridge/pages/registrations/RecordRegistrationPage.d.ts +10 -0
- package/dist/atheletebridge/pages/registrations/RecordRegistrationPage.d.ts.map +1 -0
- package/dist/atheletebridge/pages/registrations/RecordRegistrationPage.js +94 -0
- package/dist/atheletebridge/pages/registrations/RecordRegistrationPage.js.map +1 -0
- package/dist/atheletebridge/pages/registrations/RegisterPage.d.ts +11 -0
- package/dist/atheletebridge/pages/registrations/RegisterPage.d.ts.map +1 -0
- package/dist/atheletebridge/pages/registrations/RegisterPage.js +160 -0
- package/dist/atheletebridge/pages/registrations/RegisterPage.js.map +1 -0
- package/dist/atheletebridge/pages/registrations/RegistrationFormBuilderPage.d.ts +10 -0
- package/dist/atheletebridge/pages/registrations/RegistrationFormBuilderPage.d.ts.map +1 -0
- package/dist/atheletebridge/pages/registrations/RegistrationFormBuilderPage.js +602 -0
- package/dist/atheletebridge/pages/registrations/RegistrationFormBuilderPage.js.map +1 -0
- package/dist/atheletebridge/pages/registrations/RegistrationFormDetailPage.d.ts +9 -0
- package/dist/atheletebridge/pages/registrations/RegistrationFormDetailPage.d.ts.map +1 -0
- package/dist/atheletebridge/pages/registrations/RegistrationFormDetailPage.js +317 -0
- package/dist/atheletebridge/pages/registrations/RegistrationFormDetailPage.js.map +1 -0
- package/dist/atheletebridge/pages/registrations/RegistrationFormsListPage.d.ts +9 -0
- package/dist/atheletebridge/pages/registrations/RegistrationFormsListPage.d.ts.map +1 -0
- package/dist/atheletebridge/pages/registrations/RegistrationFormsListPage.js +127 -0
- package/dist/atheletebridge/pages/registrations/RegistrationFormsListPage.js.map +1 -0
- package/dist/atheletebridge/pages/registrations/RegistrationSubmissionPage.d.ts +11 -0
- package/dist/atheletebridge/pages/registrations/RegistrationSubmissionPage.d.ts.map +1 -0
- package/dist/atheletebridge/pages/registrations/RegistrationSubmissionPage.js +411 -0
- package/dist/atheletebridge/pages/registrations/RegistrationSubmissionPage.js.map +1 -0
- package/dist/atheletebridge/types/registration.d.ts +220 -0
- package/dist/atheletebridge/types/registration.d.ts.map +1 -0
- package/dist/atheletebridge/utils/fixtureCapabilities.d.ts +19 -0
- package/dist/atheletebridge/utils/fixtureCapabilities.d.ts.map +1 -0
- package/dist/atheletebridge/utils/fixtureCapabilities.js +21 -0
- package/dist/atheletebridge/utils/fixtureCapabilities.js.map +1 -0
- package/dist/atheletebridge/utils/money.d.ts +22 -0
- package/dist/atheletebridge/utils/money.d.ts.map +1 -0
- package/dist/atheletebridge/utils/money.js +38 -0
- package/dist/atheletebridge/utils/money.js.map +1 -0
- package/dist/atheletebridge/utils/registration.d.ts +17 -0
- package/dist/atheletebridge/utils/registration.d.ts.map +1 -0
- package/dist/atheletebridge/utils/registration.js +25 -0
- package/dist/atheletebridge/utils/registration.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { useAthleteBridge as e } from "../context/AthleteBridgeContext.js";
|
|
2
2
|
import "../context/index.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { fixtureOutcomeSelection as t, normalizeFixture as n, normalizeFixtureOrNull as r } from "../utils/fixtureCapabilities.js";
|
|
4
|
+
import { useCallback as i, useMemo as a } from "react";
|
|
5
|
+
import { useMutation as o, useQuery as s, useQueryClient as c } from "@tanstack/react-query";
|
|
6
|
+
import { clearGraphqlFetchResponseCache as l, graphqlFetch as u } from "@burdenoff/fe-libs/shared/graphql";
|
|
6
7
|
//#region src/atheletebridge/hooks/useAthleteBridgeApi.ts
|
|
7
|
-
var
|
|
8
|
+
var d = "AI_PROVIDER_UNAVAILABLE", f = class extends Error {
|
|
8
9
|
code;
|
|
9
10
|
agentRunId;
|
|
10
11
|
constructor(e, t) {
|
|
@@ -12,8 +13,8 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
|
|
|
12
13
|
let n = t?.code, r = t?.agentRunId;
|
|
13
14
|
this.code = typeof n == "string" && n ? n : null, this.agentRunId = typeof r == "string" && r ? r : null;
|
|
14
15
|
}
|
|
15
|
-
},
|
|
16
|
-
let r = await
|
|
16
|
+
}, p = async (e, t, n) => {
|
|
17
|
+
let r = await u({
|
|
17
18
|
gateway: "workspace",
|
|
18
19
|
baseUrl: n,
|
|
19
20
|
query: e,
|
|
@@ -22,12 +23,12 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
|
|
|
22
23
|
});
|
|
23
24
|
if (r.errors?.length) {
|
|
24
25
|
let e = r.errors[0];
|
|
25
|
-
throw new
|
|
26
|
+
throw new f(e?.message ?? "GraphQL request failed", e?.extensions);
|
|
26
27
|
}
|
|
27
|
-
if (!r.data) throw new
|
|
28
|
-
return e.trimStart().startsWith("mutation") &&
|
|
29
|
-
},
|
|
30
|
-
let n = await
|
|
28
|
+
if (!r.data) throw new f("GraphQL response did not include data");
|
|
29
|
+
return e.trimStart().startsWith("mutation") && l(), r.data;
|
|
30
|
+
}, m = async (e, t) => {
|
|
31
|
+
let n = await u({
|
|
31
32
|
gateway: "global",
|
|
32
33
|
query: e,
|
|
33
34
|
variables: t,
|
|
@@ -35,32 +36,32 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
|
|
|
35
36
|
});
|
|
36
37
|
if (n.errors?.length) {
|
|
37
38
|
let e = n.errors[0];
|
|
38
|
-
throw new
|
|
39
|
+
throw new f(e?.message ?? "GraphQL request failed", e?.extensions);
|
|
39
40
|
}
|
|
40
|
-
if (!n.data) throw new
|
|
41
|
+
if (!n.data) throw new f("GraphQL response did not include data");
|
|
41
42
|
return n.data;
|
|
42
|
-
},
|
|
43
|
+
}, h = "\n id workspaceId name sport status description ageGroup season homeVenue\n headCoachId tags createdAt updatedAt\n", g = "\n id workspaceId teamId userId displayName role status position jerseyNumber\n height weight dominantSide notes joinedAt createdAt updatedAt\n", _ = "\n runs wickets overs balls extras\n", v = `
|
|
43
44
|
id workspaceId type status competition round venue homeTeamId awayTeamId
|
|
44
|
-
homeScore awayScore
|
|
45
|
-
|
|
46
|
-
homeInnings { ${
|
|
47
|
-
awayInnings { ${
|
|
45
|
+
homeScore awayScore
|
|
46
|
+
${t(`
|
|
47
|
+
homeInnings { ${_} }
|
|
48
|
+
awayInnings { ${_} }
|
|
48
49
|
winner decidedBy margin superOver dls
|
|
49
|
-
`}
|
|
50
|
+
`)}
|
|
50
51
|
scheduledAt kickoffAt notes createdAt updatedAt
|
|
51
52
|
homeTeam { id name sport }
|
|
52
53
|
awayTeam { id name sport }
|
|
53
|
-
`,
|
|
54
|
+
`, y = "\n id workspaceId competition teamId played won drawn lost goalsFor goalsAgainst\n points rank createdAt updatedAt\n team { id name sport }\n", b = "\n id workspaceId programId name description weekNumber orderIndex sets reps\n durationSec restSec createdAt updatedAt\n video { id }\n", x = "\n id workspaceId coachId name sport level status summary weeks isTemplate tags\n createdAt updatedAt\n", S = "\n id workspaceId coachId athleteId programId title type status location\n meetingUrl scheduledAt durationMin completedAt feedback rating\n createdAt updatedAt\n", C = "\n id workspaceId athleteId programId title status performedAt durationMin rpe\n totalLoad metrics notes createdAt updatedAt\n", w = "\n id workspaceId athleteId type label value unit source recordedAt\n createdAt updatedAt\n", T = (t = {}) => {
|
|
54
55
|
let { apiGatewayUrl: n } = e();
|
|
55
|
-
return
|
|
56
|
+
return s({
|
|
56
57
|
queryKey: [
|
|
57
58
|
"atheletebridge",
|
|
58
59
|
"teams",
|
|
59
60
|
t
|
|
60
61
|
],
|
|
61
|
-
queryFn: async () => (await
|
|
62
|
+
queryFn: async () => (await p(`query AthListTeams($sport: AthSport, $status: AthTeamStatus, $pagination: PaginationInput) {
|
|
62
63
|
athListTeams(sport: $sport, status: $status, pagination: $pagination) {
|
|
63
|
-
items { ${
|
|
64
|
+
items { ${h} members { items { id } } }
|
|
64
65
|
pageInfo { cursor hasMore }
|
|
65
66
|
}
|
|
66
67
|
}`, {
|
|
@@ -69,55 +70,64 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
|
|
|
69
70
|
pagination: t.pagination
|
|
70
71
|
}, n)).athListTeams
|
|
71
72
|
});
|
|
72
|
-
},
|
|
73
|
-
let { apiGatewayUrl:
|
|
74
|
-
return
|
|
73
|
+
}, E = (t) => {
|
|
74
|
+
let { apiGatewayUrl: r } = e();
|
|
75
|
+
return s({
|
|
75
76
|
queryKey: [
|
|
76
77
|
"atheletebridge",
|
|
77
78
|
"team",
|
|
78
79
|
t
|
|
79
80
|
],
|
|
80
|
-
queryFn: async () =>
|
|
81
|
+
queryFn: async () => {
|
|
82
|
+
let e = (await p(`query AthTeam($id: ID!) {
|
|
81
83
|
athTeam(id: $id) {
|
|
82
|
-
${
|
|
83
|
-
members { items { ${
|
|
84
|
-
fixtures { items { ${
|
|
84
|
+
${h}
|
|
85
|
+
members { items { ${g} } }
|
|
86
|
+
fixtures { items { ${v} } }
|
|
85
87
|
}
|
|
86
|
-
}`, { id: t },
|
|
88
|
+
}`, { id: t }, r)).athTeam;
|
|
89
|
+
return e?.fixtures ? {
|
|
90
|
+
...e,
|
|
91
|
+
fixtures: {
|
|
92
|
+
...e.fixtures,
|
|
93
|
+
items: e.fixtures.items.map(n)
|
|
94
|
+
}
|
|
95
|
+
} : e;
|
|
96
|
+
},
|
|
87
97
|
enabled: !!t
|
|
88
98
|
});
|
|
89
|
-
},
|
|
99
|
+
}, D = (t, n) => {
|
|
90
100
|
let { apiGatewayUrl: r } = e();
|
|
91
|
-
return
|
|
101
|
+
return s({
|
|
92
102
|
queryKey: [
|
|
93
103
|
"atheletebridge",
|
|
94
104
|
"members",
|
|
95
105
|
t,
|
|
96
106
|
n
|
|
97
107
|
],
|
|
98
|
-
queryFn: async () => (await
|
|
99
|
-
athListMembers(teamId: $teamId, status: $status) { items { ${
|
|
108
|
+
queryFn: async () => (await p(`query AthListMembers($teamId: ID!, $status: AthMemberStatus) {
|
|
109
|
+
athListMembers(teamId: $teamId, status: $status) { items { ${g} } }
|
|
100
110
|
}`, {
|
|
101
111
|
teamId: t,
|
|
102
112
|
status: n
|
|
103
113
|
}, r)).athListMembers.items,
|
|
104
114
|
enabled: !!t
|
|
105
115
|
});
|
|
106
|
-
},
|
|
107
|
-
let t =
|
|
108
|
-
return
|
|
109
|
-
mutationFn: async (e) => (await
|
|
110
|
-
athCreateTeam(input: $input) { ${
|
|
116
|
+
}, O = () => {
|
|
117
|
+
let t = c(), { apiGatewayUrl: n } = e();
|
|
118
|
+
return o({
|
|
119
|
+
mutationFn: async (e) => (await p(`mutation AthCreateTeam($input: AthCreateTeamInput!) {
|
|
120
|
+
athCreateTeam(input: $input) { ${h} }
|
|
111
121
|
}`, { input: e }, n)).athCreateTeam,
|
|
112
122
|
onSuccess: () => {
|
|
113
123
|
t.invalidateQueries({ queryKey: ["atheletebridge", "teams"] });
|
|
114
124
|
}
|
|
115
125
|
});
|
|
116
|
-
},
|
|
117
|
-
let t =
|
|
118
|
-
return
|
|
119
|
-
mutationFn: async ({ id: e, input: t }) => (await
|
|
120
|
-
athUpdateTeam(id: $id, input: $input) { ${
|
|
126
|
+
}, k = () => {
|
|
127
|
+
let t = c(), { apiGatewayUrl: n } = e();
|
|
128
|
+
return o({
|
|
129
|
+
mutationFn: async ({ id: e, input: t }) => (await p(`mutation AthUpdateTeam($id: ID!, $input: AthUpdateTeamInput!) {
|
|
130
|
+
athUpdateTeam(id: $id, input: $input) { ${h} }
|
|
121
131
|
}`, {
|
|
122
132
|
id: e,
|
|
123
133
|
input: t
|
|
@@ -130,19 +140,19 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
|
|
|
130
140
|
] });
|
|
131
141
|
}
|
|
132
142
|
});
|
|
133
|
-
},
|
|
134
|
-
let t =
|
|
135
|
-
return
|
|
136
|
-
mutationFn: async (e) => (await
|
|
143
|
+
}, A = () => {
|
|
144
|
+
let t = c(), { apiGatewayUrl: n } = e();
|
|
145
|
+
return o({
|
|
146
|
+
mutationFn: async (e) => (await p("mutation AthArchiveTeam($id: ID!) { athArchiveTeam(id: $id) }", { id: e }, n)).athArchiveTeam,
|
|
137
147
|
onSuccess: () => {
|
|
138
148
|
t.invalidateQueries({ queryKey: ["atheletebridge", "teams"] });
|
|
139
149
|
}
|
|
140
150
|
});
|
|
141
|
-
},
|
|
142
|
-
let t =
|
|
143
|
-
return
|
|
144
|
-
mutationFn: async (e) => (await
|
|
145
|
-
athAddMember(input: $input) { ${
|
|
151
|
+
}, j = () => {
|
|
152
|
+
let t = c(), { apiGatewayUrl: n } = e();
|
|
153
|
+
return o({
|
|
154
|
+
mutationFn: async (e) => (await p(`mutation AthAddMember($input: AthAddMemberInput!) {
|
|
155
|
+
athAddMember(input: $input) { ${g} }
|
|
146
156
|
}`, { input: e }, n)).athAddMember,
|
|
147
157
|
onSuccess: (e) => {
|
|
148
158
|
t.invalidateQueries({ queryKey: [
|
|
@@ -156,10 +166,10 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
|
|
|
156
166
|
] });
|
|
157
167
|
}
|
|
158
168
|
});
|
|
159
|
-
},
|
|
160
|
-
let n =
|
|
161
|
-
return
|
|
162
|
-
mutationFn: async (e) => (await
|
|
169
|
+
}, M = (t) => {
|
|
170
|
+
let n = c(), { apiGatewayUrl: r } = e();
|
|
171
|
+
return o({
|
|
172
|
+
mutationFn: async (e) => (await p("mutation AthRemoveMember($id: ID!) { athRemoveMember(id: $id) }", { id: e }, r)).athRemoveMember,
|
|
163
173
|
onSuccess: () => {
|
|
164
174
|
n.invalidateQueries({ queryKey: [
|
|
165
175
|
"atheletebridge",
|
|
@@ -172,70 +182,76 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
|
|
|
172
182
|
] });
|
|
173
183
|
}
|
|
174
184
|
});
|
|
175
|
-
},
|
|
176
|
-
let { apiGatewayUrl:
|
|
177
|
-
return
|
|
185
|
+
}, N = (t = {}) => {
|
|
186
|
+
let { apiGatewayUrl: r } = e();
|
|
187
|
+
return s({
|
|
178
188
|
queryKey: [
|
|
179
189
|
"atheletebridge",
|
|
180
190
|
"fixtures",
|
|
181
191
|
t
|
|
182
192
|
],
|
|
183
|
-
queryFn: async () =>
|
|
193
|
+
queryFn: async () => {
|
|
194
|
+
let e = await p(`query AthListFixtures($status: AthFixtureStatus, $teamId: ID, $pagination: PaginationInput) {
|
|
184
195
|
athListFixtures(status: $status, teamId: $teamId, pagination: $pagination) {
|
|
185
|
-
items { ${
|
|
196
|
+
items { ${v} }
|
|
186
197
|
pageInfo { cursor hasMore }
|
|
187
198
|
}
|
|
188
199
|
}`, {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
200
|
+
status: t.status,
|
|
201
|
+
teamId: t.teamId,
|
|
202
|
+
pagination: t.pagination
|
|
203
|
+
}, r);
|
|
204
|
+
return {
|
|
205
|
+
...e.athListFixtures,
|
|
206
|
+
items: e.athListFixtures.items.map(n)
|
|
207
|
+
};
|
|
208
|
+
}
|
|
193
209
|
});
|
|
194
|
-
},
|
|
210
|
+
}, P = (t) => {
|
|
195
211
|
let { apiGatewayUrl: n } = e();
|
|
196
|
-
return
|
|
212
|
+
return s({
|
|
197
213
|
queryKey: [
|
|
198
214
|
"atheletebridge",
|
|
199
215
|
"fixture",
|
|
200
216
|
t
|
|
201
217
|
],
|
|
202
|
-
queryFn: async () => (await
|
|
203
|
-
athFixture(id: $id) { ${
|
|
204
|
-
}`, { id: t }, n)).athFixture,
|
|
218
|
+
queryFn: async () => r((await p(`query AthFixture($id: ID!) {
|
|
219
|
+
athFixture(id: $id) { ${v} }
|
|
220
|
+
}`, { id: t }, n)).athFixture),
|
|
205
221
|
enabled: !!t
|
|
206
222
|
});
|
|
207
|
-
},
|
|
223
|
+
}, F = (t) => {
|
|
208
224
|
let { apiGatewayUrl: n } = e();
|
|
209
|
-
return
|
|
225
|
+
return s({
|
|
210
226
|
queryKey: [
|
|
211
227
|
"atheletebridge",
|
|
212
228
|
"standings",
|
|
213
229
|
t
|
|
214
230
|
],
|
|
215
|
-
queryFn: async () => (await
|
|
216
|
-
athStandings(competition: $competition) { items { ${
|
|
231
|
+
queryFn: async () => (await p(`query AthStandings($competition: String!) {
|
|
232
|
+
athStandings(competition: $competition) { items { ${y} } }
|
|
217
233
|
}`, { competition: t }, n)).athStandings.items,
|
|
218
234
|
enabled: !!t
|
|
219
235
|
});
|
|
220
|
-
},
|
|
221
|
-
let t =
|
|
222
|
-
return
|
|
223
|
-
mutationFn: async (e) => (await
|
|
224
|
-
athScheduleFixture(input: $input) { ${
|
|
225
|
-
}`, { input: e },
|
|
236
|
+
}, I = () => {
|
|
237
|
+
let t = c(), { apiGatewayUrl: r } = e();
|
|
238
|
+
return o({
|
|
239
|
+
mutationFn: async (e) => n((await p(`mutation AthScheduleFixture($input: AthCreateFixtureInput!) {
|
|
240
|
+
athScheduleFixture(input: $input) { ${v} }
|
|
241
|
+
}`, { input: e }, r)).athScheduleFixture),
|
|
226
242
|
onSuccess: () => {
|
|
227
243
|
t.invalidateQueries({ queryKey: ["atheletebridge", "fixtures"] });
|
|
228
244
|
}
|
|
229
245
|
});
|
|
230
|
-
},
|
|
231
|
-
let t =
|
|
232
|
-
return
|
|
233
|
-
mutationFn: async ({ id: e, input: t }) => (await
|
|
234
|
-
athRecordFixtureResult(id: $id, input: $input) { ${
|
|
246
|
+
}, L = () => {
|
|
247
|
+
let t = c(), { apiGatewayUrl: r } = e();
|
|
248
|
+
return o({
|
|
249
|
+
mutationFn: async ({ id: e, input: t }) => n((await p(`mutation AthRecordFixtureResult($id: ID!, $input: AthRecordResultInput!) {
|
|
250
|
+
athRecordFixtureResult(id: $id, input: $input) { ${v} }
|
|
235
251
|
}`, {
|
|
236
252
|
id: e,
|
|
237
253
|
input: t
|
|
238
|
-
},
|
|
254
|
+
}, r)).athRecordFixtureResult),
|
|
239
255
|
onSuccess: (e) => {
|
|
240
256
|
t.invalidateQueries({ queryKey: ["atheletebridge", "fixtures"] }), t.invalidateQueries({ queryKey: [
|
|
241
257
|
"atheletebridge",
|
|
@@ -244,17 +260,17 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
|
|
|
244
260
|
] }), t.invalidateQueries({ queryKey: ["atheletebridge", "standings"] });
|
|
245
261
|
}
|
|
246
262
|
});
|
|
247
|
-
},
|
|
263
|
+
}, ee = (t = {}) => {
|
|
248
264
|
let { apiGatewayUrl: n } = e();
|
|
249
|
-
return
|
|
265
|
+
return s({
|
|
250
266
|
queryKey: [
|
|
251
267
|
"atheletebridge",
|
|
252
268
|
"programs",
|
|
253
269
|
t
|
|
254
270
|
],
|
|
255
|
-
queryFn: async () => (await
|
|
271
|
+
queryFn: async () => (await p(`query AthListPrograms($sport: AthSport, $level: AthProgramLevel, $status: AthProgramStatus, $pagination: PaginationInput) {
|
|
256
272
|
athListPrograms(sport: $sport, level: $level, status: $status, pagination: $pagination) {
|
|
257
|
-
items { ${
|
|
273
|
+
items { ${x} drills { items { id } } }
|
|
258
274
|
pageInfo { cursor hasMore }
|
|
259
275
|
}
|
|
260
276
|
}`, {
|
|
@@ -264,37 +280,37 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
|
|
|
264
280
|
pagination: t.pagination
|
|
265
281
|
}, n)).athListPrograms
|
|
266
282
|
});
|
|
267
|
-
},
|
|
283
|
+
}, te = (t) => {
|
|
268
284
|
let { apiGatewayUrl: n } = e();
|
|
269
|
-
return
|
|
285
|
+
return s({
|
|
270
286
|
queryKey: [
|
|
271
287
|
"atheletebridge",
|
|
272
288
|
"program",
|
|
273
289
|
t
|
|
274
290
|
],
|
|
275
|
-
queryFn: async () => (await
|
|
291
|
+
queryFn: async () => (await p(`query AthProgram($id: ID!) {
|
|
276
292
|
athProgram(id: $id) {
|
|
277
|
-
${
|
|
278
|
-
drills { items { ${
|
|
293
|
+
${x}
|
|
294
|
+
drills { items { ${b} } }
|
|
279
295
|
}
|
|
280
296
|
}`, { id: t }, n)).athProgram,
|
|
281
297
|
enabled: !!t
|
|
282
298
|
});
|
|
283
|
-
},
|
|
284
|
-
let t =
|
|
285
|
-
return
|
|
286
|
-
mutationFn: async (e) => (await
|
|
287
|
-
athCreateProgram(input: $input) { ${
|
|
299
|
+
}, ne = () => {
|
|
300
|
+
let t = c(), { apiGatewayUrl: n } = e();
|
|
301
|
+
return o({
|
|
302
|
+
mutationFn: async (e) => (await p(`mutation AthCreateProgram($input: AthCreateProgramInput!) {
|
|
303
|
+
athCreateProgram(input: $input) { ${x} }
|
|
288
304
|
}`, { input: e }, n)).athCreateProgram,
|
|
289
305
|
onSuccess: () => {
|
|
290
306
|
t.invalidateQueries({ queryKey: ["atheletebridge", "programs"] });
|
|
291
307
|
}
|
|
292
308
|
});
|
|
293
|
-
},
|
|
294
|
-
let t =
|
|
295
|
-
return
|
|
296
|
-
mutationFn: async ({ id: e, input: t }) => (await
|
|
297
|
-
athUpdateProgram(id: $id, input: $input) { ${
|
|
309
|
+
}, re = () => {
|
|
310
|
+
let t = c(), { apiGatewayUrl: n } = e();
|
|
311
|
+
return o({
|
|
312
|
+
mutationFn: async ({ id: e, input: t }) => (await p(`mutation AthUpdateProgram($id: ID!, $input: AthUpdateProgramInput!) {
|
|
313
|
+
athUpdateProgram(id: $id, input: $input) { ${x} }
|
|
298
314
|
}`, {
|
|
299
315
|
id: e,
|
|
300
316
|
input: t
|
|
@@ -307,11 +323,11 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
|
|
|
307
323
|
] });
|
|
308
324
|
}
|
|
309
325
|
});
|
|
310
|
-
},
|
|
311
|
-
let t =
|
|
312
|
-
return
|
|
313
|
-
mutationFn: async ({ id: e, status: t }) => (await
|
|
314
|
-
athTransitionProgram(id: $id, status: $status) { ${
|
|
326
|
+
}, ie = () => {
|
|
327
|
+
let t = c(), { apiGatewayUrl: n } = e();
|
|
328
|
+
return o({
|
|
329
|
+
mutationFn: async ({ id: e, status: t }) => (await p(`mutation AthTransitionProgram($id: ID!, $status: AthProgramStatus!) {
|
|
330
|
+
athTransitionProgram(id: $id, status: $status) { ${x} }
|
|
315
331
|
}`, {
|
|
316
332
|
id: e,
|
|
317
333
|
status: t
|
|
@@ -324,19 +340,19 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
|
|
|
324
340
|
] });
|
|
325
341
|
}
|
|
326
342
|
});
|
|
327
|
-
},
|
|
328
|
-
let t =
|
|
329
|
-
return
|
|
330
|
-
mutationFn: async (e) => (await
|
|
343
|
+
}, ae = () => {
|
|
344
|
+
let t = c(), { apiGatewayUrl: n } = e();
|
|
345
|
+
return o({
|
|
346
|
+
mutationFn: async (e) => (await p("mutation AthArchiveProgram($id: ID!) { athArchiveProgram(id: $id) }", { id: e }, n)).athArchiveProgram,
|
|
331
347
|
onSuccess: () => {
|
|
332
348
|
t.invalidateQueries({ queryKey: ["atheletebridge", "programs"] });
|
|
333
349
|
}
|
|
334
350
|
});
|
|
335
|
-
},
|
|
336
|
-
let t =
|
|
337
|
-
return
|
|
338
|
-
mutationFn: async (e) => (await
|
|
339
|
-
athAddDrill(input: $input) { ${
|
|
351
|
+
}, oe = () => {
|
|
352
|
+
let t = c(), { apiGatewayUrl: n } = e();
|
|
353
|
+
return o({
|
|
354
|
+
mutationFn: async (e) => (await p(`mutation AthAddDrill($input: AthAddDrillInput!) {
|
|
355
|
+
athAddDrill(input: $input) { ${b} }
|
|
340
356
|
}`, { input: e }, n)).athAddDrill,
|
|
341
357
|
onSuccess: (e) => {
|
|
342
358
|
t.invalidateQueries({ queryKey: [
|
|
@@ -346,10 +362,10 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
|
|
|
346
362
|
] });
|
|
347
363
|
}
|
|
348
364
|
});
|
|
349
|
-
},
|
|
350
|
-
let n =
|
|
351
|
-
return
|
|
352
|
-
mutationFn: async (e) => (await
|
|
365
|
+
}, se = (t) => {
|
|
366
|
+
let n = c(), { apiGatewayUrl: r } = e();
|
|
367
|
+
return o({
|
|
368
|
+
mutationFn: async (e) => (await p("mutation AthRemoveDrill($id: ID!) { athRemoveDrill(id: $id) }", { id: e }, r)).athRemoveDrill,
|
|
353
369
|
onSuccess: () => {
|
|
354
370
|
n.invalidateQueries({ queryKey: [
|
|
355
371
|
"atheletebridge",
|
|
@@ -358,17 +374,17 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
|
|
|
358
374
|
] });
|
|
359
375
|
}
|
|
360
376
|
});
|
|
361
|
-
},
|
|
377
|
+
}, R = (t = {}) => {
|
|
362
378
|
let { apiGatewayUrl: n } = e();
|
|
363
|
-
return
|
|
379
|
+
return s({
|
|
364
380
|
queryKey: [
|
|
365
381
|
"atheletebridge",
|
|
366
382
|
"sessions",
|
|
367
383
|
t
|
|
368
384
|
],
|
|
369
|
-
queryFn: async () => (await
|
|
385
|
+
queryFn: async () => (await p(`query AthListSessions($athleteId: ID, $coachId: ID, $status: AthSessionStatus, $pagination: PaginationInput) {
|
|
370
386
|
athListSessions(athleteId: $athleteId, coachId: $coachId, status: $status, pagination: $pagination) {
|
|
371
|
-
items { ${
|
|
387
|
+
items { ${S} }
|
|
372
388
|
pageInfo { cursor hasMore }
|
|
373
389
|
}
|
|
374
390
|
}`, {
|
|
@@ -378,34 +394,34 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
|
|
|
378
394
|
pagination: t.pagination
|
|
379
395
|
}, n)).athListSessions
|
|
380
396
|
});
|
|
381
|
-
},
|
|
397
|
+
}, z = (t) => {
|
|
382
398
|
let { apiGatewayUrl: n } = e();
|
|
383
|
-
return
|
|
399
|
+
return s({
|
|
384
400
|
queryKey: [
|
|
385
401
|
"atheletebridge",
|
|
386
402
|
"session",
|
|
387
403
|
t
|
|
388
404
|
],
|
|
389
|
-
queryFn: async () => (await
|
|
390
|
-
athSession(id: $id) { ${
|
|
405
|
+
queryFn: async () => (await p(`query AthSession($id: ID!) {
|
|
406
|
+
athSession(id: $id) { ${S} }
|
|
391
407
|
}`, { id: t }, n)).athSession,
|
|
392
408
|
enabled: !!t
|
|
393
409
|
});
|
|
394
|
-
},
|
|
395
|
-
let t =
|
|
396
|
-
return
|
|
397
|
-
mutationFn: async (e) => (await
|
|
398
|
-
athBookSession(input: $input) { ${
|
|
410
|
+
}, B = () => {
|
|
411
|
+
let t = c(), { apiGatewayUrl: n } = e();
|
|
412
|
+
return o({
|
|
413
|
+
mutationFn: async (e) => (await p(`mutation AthBookSession($input: AthBookSessionInput!) {
|
|
414
|
+
athBookSession(input: $input) { ${S} }
|
|
399
415
|
}`, { input: e }, n)).athBookSession,
|
|
400
416
|
onSuccess: () => {
|
|
401
417
|
t.invalidateQueries({ queryKey: ["atheletebridge", "sessions"] });
|
|
402
418
|
}
|
|
403
419
|
});
|
|
404
|
-
},
|
|
405
|
-
let t =
|
|
406
|
-
return
|
|
407
|
-
mutationFn: async (e) => (await
|
|
408
|
-
athConfirmSession(id: $id) { ${
|
|
420
|
+
}, V = () => {
|
|
421
|
+
let t = c(), { apiGatewayUrl: n } = e();
|
|
422
|
+
return o({
|
|
423
|
+
mutationFn: async (e) => (await p(`mutation AthConfirmSession($id: ID!) {
|
|
424
|
+
athConfirmSession(id: $id) { ${S} }
|
|
409
425
|
}`, { id: e }, n)).athConfirmSession,
|
|
410
426
|
onSuccess: (e) => {
|
|
411
427
|
t.invalidateQueries({ queryKey: ["atheletebridge", "sessions"] }), t.invalidateQueries({ queryKey: [
|
|
@@ -415,11 +431,11 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
|
|
|
415
431
|
] });
|
|
416
432
|
}
|
|
417
433
|
});
|
|
418
|
-
},
|
|
419
|
-
let t =
|
|
420
|
-
return
|
|
421
|
-
mutationFn: async ({ id: e, input: t }) => (await
|
|
422
|
-
athCompleteSession(id: $id, input: $input) { ${
|
|
434
|
+
}, H = () => {
|
|
435
|
+
let t = c(), { apiGatewayUrl: n } = e();
|
|
436
|
+
return o({
|
|
437
|
+
mutationFn: async ({ id: e, input: t }) => (await p(`mutation AthCompleteSession($id: ID!, $input: AthCompleteSessionInput) {
|
|
438
|
+
athCompleteSession(id: $id, input: $input) { ${S} }
|
|
423
439
|
}`, {
|
|
424
440
|
id: e,
|
|
425
441
|
input: t
|
|
@@ -432,11 +448,11 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
|
|
|
432
448
|
] });
|
|
433
449
|
}
|
|
434
450
|
});
|
|
435
|
-
},
|
|
436
|
-
let t =
|
|
437
|
-
return
|
|
438
|
-
mutationFn: async (e) => (await
|
|
439
|
-
athCancelSession(id: $id) { ${
|
|
451
|
+
}, U = () => {
|
|
452
|
+
let t = c(), { apiGatewayUrl: n } = e();
|
|
453
|
+
return o({
|
|
454
|
+
mutationFn: async (e) => (await p(`mutation AthCancelSession($id: ID!) {
|
|
455
|
+
athCancelSession(id: $id) { ${S} }
|
|
440
456
|
}`, { id: e }, n)).athCancelSession,
|
|
441
457
|
onSuccess: (e) => {
|
|
442
458
|
t.invalidateQueries({ queryKey: ["atheletebridge", "sessions"] }), t.invalidateQueries({ queryKey: [
|
|
@@ -446,17 +462,17 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
|
|
|
446
462
|
] });
|
|
447
463
|
}
|
|
448
464
|
});
|
|
449
|
-
},
|
|
465
|
+
}, W = (t = {}) => {
|
|
450
466
|
let { apiGatewayUrl: n } = e();
|
|
451
|
-
return
|
|
467
|
+
return s({
|
|
452
468
|
queryKey: [
|
|
453
469
|
"atheletebridge",
|
|
454
470
|
"workout-logs",
|
|
455
471
|
t
|
|
456
472
|
],
|
|
457
|
-
queryFn: async () => (await
|
|
473
|
+
queryFn: async () => (await p(`query AthListWorkoutLogs($athleteId: ID, $programId: ID, $pagination: PaginationInput) {
|
|
458
474
|
athListWorkoutLogs(athleteId: $athleteId, programId: $programId, pagination: $pagination) {
|
|
459
|
-
items { ${
|
|
475
|
+
items { ${C} }
|
|
460
476
|
pageInfo { cursor hasMore }
|
|
461
477
|
}
|
|
462
478
|
}`, {
|
|
@@ -465,18 +481,18 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
|
|
|
465
481
|
pagination: t.pagination
|
|
466
482
|
}, n)).athListWorkoutLogs
|
|
467
483
|
});
|
|
468
|
-
},
|
|
484
|
+
}, G = (t, n) => {
|
|
469
485
|
let { apiGatewayUrl: r } = e();
|
|
470
|
-
return
|
|
486
|
+
return s({
|
|
471
487
|
queryKey: [
|
|
472
488
|
"atheletebridge",
|
|
473
489
|
"metrics",
|
|
474
490
|
t,
|
|
475
491
|
n ?? null
|
|
476
492
|
],
|
|
477
|
-
queryFn: async () => (await
|
|
493
|
+
queryFn: async () => (await p(`query AthPerformanceMetrics($athleteId: ID!, $pagination: PaginationInput) {
|
|
478
494
|
athPerformanceMetrics(athleteId: $athleteId, pagination: $pagination) {
|
|
479
|
-
items { ${
|
|
495
|
+
items { ${w} }
|
|
480
496
|
}
|
|
481
497
|
}`, {
|
|
482
498
|
athleteId: t,
|
|
@@ -484,51 +500,51 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
|
|
|
484
500
|
}, r)).athPerformanceMetrics.items,
|
|
485
501
|
enabled: !!t
|
|
486
502
|
});
|
|
487
|
-
},
|
|
488
|
-
let t =
|
|
489
|
-
return
|
|
490
|
-
mutationFn: async (e) => (await
|
|
491
|
-
athLogWorkout(input: $input) { ${
|
|
503
|
+
}, K = () => {
|
|
504
|
+
let t = c(), { apiGatewayUrl: n } = e();
|
|
505
|
+
return o({
|
|
506
|
+
mutationFn: async (e) => (await p(`mutation AthLogWorkout($input: AthLogWorkoutInput!) {
|
|
507
|
+
athLogWorkout(input: $input) { ${C} }
|
|
492
508
|
}`, { input: e }, n)).athLogWorkout,
|
|
493
509
|
onSuccess: () => {
|
|
494
510
|
t.invalidateQueries({ queryKey: ["atheletebridge", "workout-logs"] });
|
|
495
511
|
}
|
|
496
512
|
});
|
|
497
|
-
},
|
|
498
|
-
let t =
|
|
499
|
-
return
|
|
500
|
-
mutationFn: async (e) => (await
|
|
501
|
-
athRecordMetric(input: $input) { ${
|
|
513
|
+
}, ce = () => {
|
|
514
|
+
let t = c(), { apiGatewayUrl: n } = e();
|
|
515
|
+
return o({
|
|
516
|
+
mutationFn: async (e) => (await p(`mutation AthRecordMetric($input: AthRecordMetricInput!) {
|
|
517
|
+
athRecordMetric(input: $input) { ${w} }
|
|
502
518
|
}`, { input: e }, n)).athRecordMetric,
|
|
503
519
|
onSuccess: () => {
|
|
504
520
|
t.invalidateQueries({ queryKey: ["atheletebridge", "metrics"] });
|
|
505
521
|
}
|
|
506
522
|
});
|
|
507
|
-
},
|
|
508
|
-
let { apiGatewayUrl: n } = e(), { fixtureId: r, sessionId:
|
|
509
|
-
return
|
|
523
|
+
}, q = "\n id workspaceId memberId fixtureId sessionId response respondedAt note\n createdAt updatedAt\n member { id displayName role }\n", le = (t) => {
|
|
524
|
+
let { apiGatewayUrl: n } = e(), { fixtureId: r, sessionId: i } = t;
|
|
525
|
+
return s({
|
|
510
526
|
queryKey: [
|
|
511
527
|
"atheletebridge",
|
|
512
528
|
"availability",
|
|
513
529
|
r ?? null,
|
|
514
|
-
|
|
530
|
+
i ?? null
|
|
515
531
|
],
|
|
516
|
-
queryFn: async () => (await
|
|
532
|
+
queryFn: async () => (await p(`query AthListAvailability($fixtureId: ID, $sessionId: ID) {
|
|
517
533
|
athListAvailability(fixtureId: $fixtureId, sessionId: $sessionId) {
|
|
518
|
-
items { ${
|
|
534
|
+
items { ${q} }
|
|
519
535
|
pageInfo { cursor hasMore }
|
|
520
536
|
}
|
|
521
537
|
}`, {
|
|
522
538
|
fixtureId: r,
|
|
523
|
-
sessionId:
|
|
539
|
+
sessionId: i
|
|
524
540
|
}, n)).athListAvailability.items,
|
|
525
|
-
enabled: !!(r ||
|
|
541
|
+
enabled: !!(r || i)
|
|
526
542
|
});
|
|
527
|
-
},
|
|
528
|
-
let t =
|
|
529
|
-
return
|
|
530
|
-
mutationFn: async (e) => (await
|
|
531
|
-
athSetAvailability(input: $input) { ${
|
|
543
|
+
}, ue = () => {
|
|
544
|
+
let t = c(), { apiGatewayUrl: n } = e();
|
|
545
|
+
return o({
|
|
546
|
+
mutationFn: async (e) => (await p(`mutation AthSetAvailability($input: AthSetAvailabilityInput!) {
|
|
547
|
+
athSetAvailability(input: $input) { ${q} }
|
|
532
548
|
}`, { input: e }, n)).athSetAvailability,
|
|
533
549
|
onSuccess: (e) => {
|
|
534
550
|
t.invalidateQueries({ queryKey: [
|
|
@@ -539,22 +555,22 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
|
|
|
539
555
|
] });
|
|
540
556
|
}
|
|
541
557
|
});
|
|
542
|
-
},
|
|
558
|
+
}, de = () => {
|
|
543
559
|
let { apiGatewayUrl: t } = e();
|
|
544
|
-
return
|
|
545
|
-
},
|
|
560
|
+
return o({ mutationFn: async (e) => (await p("mutation AthRemindAvailability($fixtureId: ID, $sessionId: ID) {\n athRemindAvailability(fixtureId: $fixtureId, sessionId: $sessionId)\n }", e, t)).athRemindAvailability });
|
|
561
|
+
}, fe = (e) => {
|
|
546
562
|
let t = e.lastIndexOf(".");
|
|
547
563
|
return t >= 0 ? e.slice(t + 1).toLowerCase() : "bin";
|
|
548
|
-
},
|
|
549
|
-
let { apiGatewayUrl:
|
|
550
|
-
return
|
|
551
|
-
let
|
|
564
|
+
}, pe = () => {
|
|
565
|
+
let { apiGatewayUrl: t } = e();
|
|
566
|
+
return i(async (e) => {
|
|
567
|
+
let n = await p("mutation AthInitiateUpload($input: InitiateUploadInput!) {\n initiateUpload(input: $input) { uploadUrl session { id } }\n }", { input: {
|
|
552
568
|
fileName: e.name,
|
|
553
|
-
extension:
|
|
569
|
+
extension: fe(e.name),
|
|
554
570
|
fileSize: e.size,
|
|
555
571
|
mimeType: e.type || "application/octet-stream",
|
|
556
572
|
visibility: "WORKSPACE"
|
|
557
|
-
} },
|
|
573
|
+
} }, t), r = n.initiateUpload.uploadUrl, i = n.initiateUpload.session.id;
|
|
558
574
|
if (!r || !i) throw Error("Upload could not be initialised.");
|
|
559
575
|
let a = await fetch(r, {
|
|
560
576
|
method: "PUT",
|
|
@@ -562,29 +578,29 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
|
|
|
562
578
|
headers: { "Content-Type": e.type || "application/octet-stream" }
|
|
563
579
|
});
|
|
564
580
|
if (!a.ok) throw Error(`Storage rejected the upload (HTTP ${a.status}).`);
|
|
565
|
-
return (await
|
|
566
|
-
}, [
|
|
567
|
-
},
|
|
581
|
+
return (await p("mutation AthCompleteUpload($input: CompleteUploadInput!) {\n completeUpload(input: $input) { fileId }\n }", { input: { sessionId: i } }, t)).completeUpload.fileId;
|
|
582
|
+
}, [t]);
|
|
583
|
+
}, me = (t) => {
|
|
568
584
|
let { apiGatewayUrl: n } = e();
|
|
569
|
-
return
|
|
585
|
+
return s({
|
|
570
586
|
queryKey: [
|
|
571
587
|
"atheletebridge",
|
|
572
588
|
"file",
|
|
573
589
|
t
|
|
574
590
|
],
|
|
575
|
-
queryFn: async () => (await
|
|
591
|
+
queryFn: async () => (await p("query AthGetFile($id: ID!) {\n getFile(id: $id) { id name downloadUrl }\n }", { id: t }, n)).getFile,
|
|
576
592
|
enabled: !!t,
|
|
577
593
|
staleTime: 6e4
|
|
578
594
|
});
|
|
579
|
-
}, J = (e) => e.name?.trim() ? e.name.trim() : [e.firstName, e.lastName].filter(Boolean).join(" ").trim() || (e.username?.trim() ? e.username.trim() : e.email),
|
|
595
|
+
}, J = (e) => e.name?.trim() ? e.name.trim() : [e.firstName, e.lastName].filter(Boolean).join(" ").trim() || (e.username?.trim() ? e.username.trim() : e.email), he = (e) => {
|
|
580
596
|
let t = e.trim();
|
|
581
|
-
return
|
|
597
|
+
return s({
|
|
582
598
|
queryKey: [
|
|
583
599
|
"atheletebridge",
|
|
584
600
|
"user-search",
|
|
585
601
|
t
|
|
586
602
|
],
|
|
587
|
-
queryFn: async () => (await
|
|
603
|
+
queryFn: async () => (await m("query AthUserSearch($filter: UserFilterInput, $pagination: PaginationInput) {\n users(filter: $filter, pagination: $pagination) {\n users { id name firstName lastName email username }\n hasMore\n }\n }", {
|
|
588
604
|
filter: { search: t },
|
|
589
605
|
pagination: {
|
|
590
606
|
limit: 8,
|
|
@@ -596,8 +612,8 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
|
|
|
596
612
|
retry: !1
|
|
597
613
|
});
|
|
598
614
|
}, Y = (e) => {
|
|
599
|
-
let t =
|
|
600
|
-
return
|
|
615
|
+
let t = a(() => Array.from(new Set(e.filter((e) => !!(e && e.trim())))).sort(), [e]);
|
|
616
|
+
return s({
|
|
601
617
|
queryKey: [
|
|
602
618
|
"atheletebridge",
|
|
603
619
|
"users-by-id",
|
|
@@ -609,7 +625,7 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
|
|
|
609
625
|
t.forEach((e, t) => {
|
|
610
626
|
r[`id${t}`] = e;
|
|
611
627
|
});
|
|
612
|
-
let i = (await
|
|
628
|
+
let i = (await u({
|
|
613
629
|
gateway: "global",
|
|
614
630
|
query: `query AthUsersByIds(${e}) {\n${n}\n}`,
|
|
615
631
|
variables: r,
|
|
@@ -626,7 +642,7 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
|
|
|
626
642
|
staleTime: 5 * 6e4,
|
|
627
643
|
retry: !1
|
|
628
644
|
});
|
|
629
|
-
},
|
|
645
|
+
}, ge = (e) => {
|
|
630
646
|
let t = Y(e), n = t.data ?? {};
|
|
631
647
|
return {
|
|
632
648
|
byId: n,
|
|
@@ -635,10 +651,10 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
|
|
|
635
651
|
nameOf: (e) => e ? n[e]?.name : void 0,
|
|
636
652
|
emailOf: (e) => e ? n[e]?.email : void 0
|
|
637
653
|
};
|
|
638
|
-
},
|
|
639
|
-
let
|
|
654
|
+
}, _e = ({ teams: e = [], fixtures: t = [], sessions: n = [], programs: r = [], limit: i = 8 }) => a(() => {
|
|
655
|
+
let a = [];
|
|
640
656
|
for (let t of e) {
|
|
641
|
-
|
|
657
|
+
a.push({
|
|
642
658
|
id: `team-${t.id}`,
|
|
643
659
|
type: "team-created",
|
|
644
660
|
title: `Team ${t.name} created`,
|
|
@@ -646,7 +662,7 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
|
|
|
646
662
|
entityId: t.id,
|
|
647
663
|
entityKind: "team"
|
|
648
664
|
});
|
|
649
|
-
for (let e of t.members?.items ?? [])
|
|
665
|
+
for (let e of t.members?.items ?? []) a.push({
|
|
650
666
|
id: `member-${e.id}`,
|
|
651
667
|
type: "member-added",
|
|
652
668
|
title: `${e.displayName} added to ${t.name}`,
|
|
@@ -655,7 +671,7 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
|
|
|
655
671
|
entityKind: "team"
|
|
656
672
|
});
|
|
657
673
|
}
|
|
658
|
-
for (let e of
|
|
674
|
+
for (let e of r) e.status === "PUBLISHED" && a.push({
|
|
659
675
|
id: `program-${e.id}`,
|
|
660
676
|
type: "program-published",
|
|
661
677
|
title: `${e.name} published`,
|
|
@@ -664,18 +680,18 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
|
|
|
664
680
|
entityKind: "program"
|
|
665
681
|
});
|
|
666
682
|
for (let e of t) {
|
|
667
|
-
let t = e.homeTeam?.name ?? "Home",
|
|
668
|
-
|
|
683
|
+
let t = e.homeTeam?.name ?? "Home", n = e.awayTeam?.name ?? (e.awayTeamId ? "Away" : "TBD"), r = e.homeScore !== null && e.awayScore !== null;
|
|
684
|
+
a.push({
|
|
669
685
|
id: `fixture-${e.id}`,
|
|
670
686
|
type: "fixture-updated",
|
|
671
|
-
title:
|
|
687
|
+
title: r ? `${t} ${e.homeScore}–${e.awayScore} ${n}` : `Fixture ${t} vs ${n} updated`,
|
|
672
688
|
subtitle: e.competition ?? void 0,
|
|
673
689
|
at: e.updatedAt,
|
|
674
690
|
entityId: e.id,
|
|
675
691
|
entityKind: "fixture"
|
|
676
692
|
});
|
|
677
693
|
}
|
|
678
|
-
for (let e of
|
|
694
|
+
for (let e of n) e.status === "COMPLETED" && a.push({
|
|
679
695
|
id: `session-${e.id}`,
|
|
680
696
|
type: "session-completed",
|
|
681
697
|
title: `Session "${e.title}" completed`,
|
|
@@ -684,29 +700,29 @@ var c = "AI_PROVIDER_UNAVAILABLE", l = class extends Error {
|
|
|
684
700
|
entityId: e.id,
|
|
685
701
|
entityKind: "session"
|
|
686
702
|
});
|
|
687
|
-
return
|
|
703
|
+
return a.filter((e) => !!e.at && !Number.isNaN(new Date(e.at).getTime())).sort((e, t) => new Date(t.at).getTime() - new Date(e.at).getTime()).slice(0, i);
|
|
688
704
|
}, [
|
|
689
705
|
e,
|
|
690
706
|
t,
|
|
707
|
+
n,
|
|
691
708
|
r,
|
|
692
|
-
i
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
athleteId: a,
|
|
709
|
+
i
|
|
710
|
+
]), ve = (e, t) => {
|
|
711
|
+
let n = D(e), r = a(() => (n.data ?? []).find((e) => e.id === t) ?? null, [n.data, t]), i = r?.userId, o = G(i), s = W({
|
|
712
|
+
athleteId: i,
|
|
697
713
|
pagination: { limit: 100 }
|
|
698
|
-
}), c =
|
|
699
|
-
athleteId:
|
|
714
|
+
}), c = R({
|
|
715
|
+
athleteId: i,
|
|
700
716
|
pagination: { limit: 100 }
|
|
701
717
|
});
|
|
702
718
|
return {
|
|
703
|
-
member:
|
|
704
|
-
athleteId:
|
|
719
|
+
member: r,
|
|
720
|
+
athleteId: i,
|
|
705
721
|
metrics: o.data ?? [],
|
|
706
722
|
workouts: s.data?.items ?? [],
|
|
707
723
|
sessions: c.data?.items ?? [],
|
|
708
|
-
isLoading:
|
|
709
|
-
isError:
|
|
724
|
+
isLoading: n.isLoading || !!i && (o.isLoading || s.isLoading || c.isLoading),
|
|
725
|
+
isError: n.isError || o.isError || s.isError || c.isError
|
|
710
726
|
};
|
|
711
727
|
};
|
|
712
728
|
function X(e, t, n, r = 8) {
|
|
@@ -727,17 +743,17 @@ function X(e, t, n, r = 8) {
|
|
|
727
743
|
};
|
|
728
744
|
});
|
|
729
745
|
}
|
|
730
|
-
var
|
|
731
|
-
let { competition: t, sampleLimit:
|
|
746
|
+
var ye = (e = {}) => {
|
|
747
|
+
let { competition: t, sampleLimit: n = 200 } = e, r = R({ pagination: { limit: n } }), i = W({ pagination: { limit: n } }), o = N({ pagination: { limit: n } }), s = a(() => r.data?.items ?? [], [r.data]), c = a(() => i.data?.items ?? [], [i.data]), l = a(() => o.data?.items ?? [], [o.data]), u = a(() => {
|
|
732
748
|
if (t) return t;
|
|
733
749
|
let e = /* @__PURE__ */ new Map();
|
|
734
750
|
for (let t of l) t.competition && e.set(t.competition, (e.get(t.competition) ?? 0) + 1);
|
|
735
751
|
let n = null, r = 0;
|
|
736
752
|
for (let [t, i] of e) i > r && (r = i, n = t);
|
|
737
753
|
return n;
|
|
738
|
-
}, [t, l]), d =
|
|
739
|
-
return
|
|
740
|
-
let e = s.length, t = s.filter((e) => e.rating !== null), n = t.length,
|
|
754
|
+
}, [t, l]), d = F(u ?? void 0);
|
|
755
|
+
return a(() => {
|
|
756
|
+
let e = s.length, t = s.filter((e) => e.rating !== null), n = t.length, a = n > 0 ? t.reduce((e, t) => e + (t.rating ?? 0), 0) / n : null, l = s.filter((e) => e.status === "COMPLETED").length, f = e > 0 ? l / e * 100 : 0, p = [
|
|
741
757
|
"REQUESTED",
|
|
742
758
|
"CONFIRMED",
|
|
743
759
|
"COMPLETED",
|
|
@@ -785,11 +801,11 @@ var ge = (e = {}) => {
|
|
|
785
801
|
workoutCount: t.workoutCount,
|
|
786
802
|
loadedCount: t.loadedCount
|
|
787
803
|
};
|
|
788
|
-
}).sort((e, t) => t.acute - e.acute || t.chronic - e.chronic), A = (
|
|
804
|
+
}).sort((e, t) => t.acute - e.acute || t.chronic - e.chronic), A = (i.data?.pageInfo.hasMore ?? !1) && T > S, j = X(c, (e) => e.performedAt, (e) => e.totalLoad ?? 0), M = X(s, (e) => e.scheduledAt, () => 1);
|
|
789
805
|
return {
|
|
790
806
|
totalSessions: e,
|
|
791
807
|
ratedCount: n,
|
|
792
|
-
avgRating:
|
|
808
|
+
avgRating: a,
|
|
793
809
|
completedCount: l,
|
|
794
810
|
completedPct: f,
|
|
795
811
|
sessionsByStatus: h,
|
|
@@ -807,43 +823,43 @@ var ge = (e = {}) => {
|
|
|
807
823
|
sessionTrend: M,
|
|
808
824
|
standings: d.data ?? [],
|
|
809
825
|
competition: u,
|
|
810
|
-
isLoading:
|
|
811
|
-
isError:
|
|
826
|
+
isLoading: r.isLoading || i.isLoading || o.isLoading || !!u && d.isLoading,
|
|
827
|
+
isError: r.isError || i.isError || o.isError || d.isError
|
|
812
828
|
};
|
|
813
829
|
}, [
|
|
814
830
|
s,
|
|
815
831
|
c,
|
|
816
|
-
|
|
832
|
+
i.data,
|
|
817
833
|
u,
|
|
818
834
|
d.data,
|
|
819
835
|
d.isLoading,
|
|
820
836
|
d.isError,
|
|
837
|
+
r.isLoading,
|
|
838
|
+
r.isError,
|
|
821
839
|
i.isLoading,
|
|
822
840
|
i.isError,
|
|
823
|
-
a.isLoading,
|
|
824
|
-
a.isError,
|
|
825
841
|
o.isLoading,
|
|
826
842
|
o.isError
|
|
827
843
|
]);
|
|
828
|
-
}, Z = "\n id workspaceId actorId actorType provider model trigger status error\n promptSummary inputRefs decision tokensIn tokensOut latencyMs costUsd\n createdAt\n", Q = "\n workspaceId provider model autoPilotEnabled autoPilotLastRunAt updatedAt\n",
|
|
844
|
+
}, Z = "\n id workspaceId actorId actorType provider model trigger status error\n promptSummary inputRefs decision tokensIn tokensOut latencyMs costUsd\n createdAt\n", Q = "\n workspaceId provider model autoPilotEnabled autoPilotLastRunAt updatedAt\n", be = () => {
|
|
829
845
|
let { apiGatewayUrl: t } = e();
|
|
830
|
-
return
|
|
846
|
+
return s({
|
|
831
847
|
queryKey: ["atheletebridge", "ai-model-catalog"],
|
|
832
|
-
queryFn: async () => (await
|
|
848
|
+
queryFn: async () => (await p("query AthAiModelCatalog {\n athAiModelCatalog { provider model label isDefault capabilities configured }\n }", {}, t)).athAiModelCatalog,
|
|
833
849
|
staleTime: 30 * 6e4
|
|
834
850
|
});
|
|
835
|
-
},
|
|
851
|
+
}, $ = () => {
|
|
836
852
|
let { apiGatewayUrl: t } = e();
|
|
837
|
-
return
|
|
853
|
+
return s({
|
|
838
854
|
queryKey: ["atheletebridge", "ai-config"],
|
|
839
|
-
queryFn: async () => (await
|
|
855
|
+
queryFn: async () => (await p(`query AthWorkspaceAiConfig {
|
|
840
856
|
athWorkspaceAiConfig { ${Q} }
|
|
841
857
|
}`, {}, t)).athWorkspaceAiConfig
|
|
842
858
|
});
|
|
843
|
-
},
|
|
844
|
-
let t =
|
|
845
|
-
return
|
|
846
|
-
mutationFn: async ({ provider: e, model: t }) => (await
|
|
859
|
+
}, xe = () => {
|
|
860
|
+
let t = c(), { apiGatewayUrl: n } = e();
|
|
861
|
+
return o({
|
|
862
|
+
mutationFn: async ({ provider: e, model: t }) => (await p(`mutation AthSetWorkspaceAiModel($provider: String!, $model: String!) {
|
|
847
863
|
athSetWorkspaceAiModel(provider: $provider, model: $model) { ${Q} }
|
|
848
864
|
}`, {
|
|
849
865
|
provider: e,
|
|
@@ -853,10 +869,10 @@ var ge = (e = {}) => {
|
|
|
853
869
|
t.setQueryData(["atheletebridge", "ai-config"], e);
|
|
854
870
|
}
|
|
855
871
|
});
|
|
856
|
-
},
|
|
857
|
-
let t =
|
|
858
|
-
return
|
|
859
|
-
mutationFn: async (e) => (await
|
|
872
|
+
}, Se = () => {
|
|
873
|
+
let t = c(), { apiGatewayUrl: n } = e();
|
|
874
|
+
return o({
|
|
875
|
+
mutationFn: async (e) => (await p(`mutation AthSetWorkspaceAutoPilot($enabled: Boolean!) {
|
|
860
876
|
athSetWorkspaceAutoPilot(enabled: $enabled) { ${Q} }
|
|
861
877
|
}`, { enabled: e }, n)).athSetWorkspaceAutoPilot,
|
|
862
878
|
onSuccess: (e) => {
|
|
@@ -864,21 +880,21 @@ var ge = (e = {}) => {
|
|
|
864
880
|
}
|
|
865
881
|
});
|
|
866
882
|
};
|
|
867
|
-
function
|
|
883
|
+
function Ce(e) {
|
|
868
884
|
let t = {};
|
|
869
885
|
return e.athleteId && (t.athleteId = e.athleteId), e.teamId && (t.teamId = e.teamId), e.programId && (t.programId = e.programId), Object.keys(t).length > 0 ? t : null;
|
|
870
886
|
}
|
|
871
|
-
var
|
|
872
|
-
let { apiGatewayUrl: n } = e(), { limit: r = 10, offset:
|
|
873
|
-
return
|
|
887
|
+
var we = (t = {}) => {
|
|
888
|
+
let { apiGatewayUrl: n } = e(), { limit: r = 10, offset: i = 0 } = t, a = Ce(t);
|
|
889
|
+
return s({
|
|
874
890
|
queryKey: [
|
|
875
891
|
"atheletebridge",
|
|
876
892
|
"agent-runs",
|
|
877
893
|
r,
|
|
878
|
-
|
|
879
|
-
|
|
894
|
+
i,
|
|
895
|
+
a
|
|
880
896
|
],
|
|
881
|
-
queryFn: async () => (await
|
|
897
|
+
queryFn: async () => (await p(`query AthAgentRuns($pagination: PaginationInput, $filter: AthAgentRunFilter) {
|
|
882
898
|
athAgentRuns(pagination: $pagination, filter: $filter) {
|
|
883
899
|
items { ${Z} }
|
|
884
900
|
pageInfo { cursor hasMore }
|
|
@@ -886,56 +902,56 @@ var xe = (t = {}) => {
|
|
|
886
902
|
}`, {
|
|
887
903
|
pagination: {
|
|
888
904
|
limit: r,
|
|
889
|
-
offset:
|
|
905
|
+
offset: i
|
|
890
906
|
},
|
|
891
|
-
filter:
|
|
907
|
+
filter: a
|
|
892
908
|
}, n)).athAgentRuns
|
|
893
909
|
});
|
|
894
|
-
},
|
|
910
|
+
}, Te = (t) => {
|
|
895
911
|
let { apiGatewayUrl: n } = e();
|
|
896
|
-
return
|
|
912
|
+
return s({
|
|
897
913
|
queryKey: [
|
|
898
914
|
"atheletebridge",
|
|
899
915
|
"agent-run",
|
|
900
916
|
t
|
|
901
917
|
],
|
|
902
|
-
queryFn: async () => (await
|
|
918
|
+
queryFn: async () => (await p(`query AthAgentRun($id: ID!) {
|
|
903
919
|
athAgentRun(id: $id) { ${Z} }
|
|
904
920
|
}`, { id: t }, n)).athAgentRun,
|
|
905
921
|
enabled: !!t,
|
|
906
922
|
retry: !1
|
|
907
923
|
});
|
|
908
|
-
},
|
|
924
|
+
}, Ee = (t) => {
|
|
909
925
|
let { apiGatewayUrl: n } = e();
|
|
910
|
-
return
|
|
926
|
+
return s({
|
|
911
927
|
queryKey: [
|
|
912
928
|
"atheletebridge",
|
|
913
929
|
"program-ai-state",
|
|
914
930
|
t
|
|
915
931
|
],
|
|
916
|
-
queryFn: async () => (await
|
|
932
|
+
queryFn: async () => (await p("query AthProgramAiState($id: ID!) {\n athProgram(id: $id) { id name status context }\n }", { id: t }, n)).athProgram,
|
|
917
933
|
enabled: !!t,
|
|
918
934
|
retry: !1
|
|
919
935
|
});
|
|
920
|
-
},
|
|
921
|
-
let t =
|
|
922
|
-
return
|
|
923
|
-
mutationFn: async (e) => (await
|
|
936
|
+
}, De = () => {
|
|
937
|
+
let t = c(), { apiGatewayUrl: n } = e();
|
|
938
|
+
return o({
|
|
939
|
+
mutationFn: async (e) => (await p(`mutation AthGenerateProgram($input: AthGenerateProgramInput!) {
|
|
924
940
|
athGenerateProgram(input: $input) {
|
|
925
941
|
agentRunId
|
|
926
942
|
drillCount
|
|
927
943
|
sessionCount
|
|
928
|
-
program { ${
|
|
944
|
+
program { ${x} }
|
|
929
945
|
}
|
|
930
946
|
}`, { input: e }, n)).athGenerateProgram,
|
|
931
947
|
onSuccess: () => {
|
|
932
948
|
t.invalidateQueries({ queryKey: ["atheletebridge", "agent-runs"] }), t.invalidateQueries({ queryKey: ["atheletebridge", "programs"] }), t.invalidateQueries({ queryKey: ["atheletebridge", "sessions"] });
|
|
933
949
|
}
|
|
934
950
|
});
|
|
935
|
-
},
|
|
936
|
-
let t =
|
|
937
|
-
return
|
|
938
|
-
mutationFn: async ({ athleteId: e, programId: t, requestedProvider: r }) => (await
|
|
951
|
+
}, Oe = () => {
|
|
952
|
+
let t = c(), { apiGatewayUrl: n } = e();
|
|
953
|
+
return o({
|
|
954
|
+
mutationFn: async ({ athleteId: e, programId: t, requestedProvider: r }) => (await p("mutation AthAdjustPlanFromPerformance($athleteId: ID!, $programId: ID!, $requestedProvider: String) {\n athAdjustPlanFromPerformance(athleteId: $athleteId, programId: $programId, requestedProvider: $requestedProvider) {\n agentRunId athleteId programId assessment rationale confidence\n recommendedWeeklyLoadChangePct flags appliedToProgram createdAt\n }\n }", {
|
|
939
955
|
athleteId: e,
|
|
940
956
|
programId: t,
|
|
941
957
|
requestedProvider: r
|
|
@@ -948,10 +964,10 @@ var xe = (t = {}) => {
|
|
|
948
964
|
] });
|
|
949
965
|
}
|
|
950
966
|
});
|
|
951
|
-
},
|
|
952
|
-
let t =
|
|
953
|
-
return
|
|
954
|
-
mutationFn: async ({ runId: e, programId: t, assessment: r, note: i }) => (await
|
|
967
|
+
}, ke = () => {
|
|
968
|
+
let t = c(), { apiGatewayUrl: n } = e();
|
|
969
|
+
return o({
|
|
970
|
+
mutationFn: async ({ runId: e, programId: t, assessment: r, note: i }) => (await p("mutation AthOverrideAgentRun($runId: ID!, $programId: ID!, $assessment: AthAiAssessment!, $note: String!) {\n athOverrideAgentRun(runId: $runId, programId: $programId, assessment: $assessment, note: $note) {\n id workspaceId programId supersedesRunId assessment note\n appliedToProgram createdAt\n }\n }", {
|
|
955
971
|
runId: e,
|
|
956
972
|
programId: t,
|
|
957
973
|
assessment: r,
|
|
@@ -967,6 +983,6 @@ var xe = (t = {}) => {
|
|
|
967
983
|
});
|
|
968
984
|
};
|
|
969
985
|
//#endregion
|
|
970
|
-
export {
|
|
986
|
+
export { d as AI_PROVIDER_UNAVAILABLE, f as AthApiError, p as athQuery, J as directoryUserName, oe as useAddDrill, j as useAddMember, Oe as useAdjustPlanFromPerformance, Te as useAgentRun, we as useAgentRuns, be as useAiModelCatalog, ae as useArchiveProgram, A as useArchiveTeam, ve as useAthleteProfile, le as useAvailability, B as useBookSession, U as useCancelSession, ye as useCoachAnalytics, H as useCompleteSession, V as useConfirmSession, ne as useCreateProgram, O as useCreateTeam, me as useFile, P as useFixture, N as useFixtures, De as useGenerateProgram, K as useLogWorkout, ke as useOverrideAgentRun, G as usePerformanceMetrics, te as useProgram, Ee as useProgramAiState, ee as usePrograms, _e as useRecentActivity, L as useRecordFixtureResult, ce as useRecordMetric, de as useRemindAvailability, se as useRemoveDrill, M as useRemoveMember, I as useScheduleFixture, z as useSession, R as useSessions, ue as useSetAvailability, xe as useSetWorkspaceAiModel, Se as useSetWorkspaceAutoPilot, F as useStandings, E as useTeam, D as useTeamMembers, T as useTeams, ie as useTransitionProgram, re as useUpdateProgram, k as useUpdateTeam, pe as useUploadFile, ge as useUserDirectory, he as useUserSearch, Y as useUsersByIds, W as useWorkoutLogs, $ as useWorkspaceAiConfig };
|
|
971
987
|
|
|
972
988
|
//# sourceMappingURL=useAthleteBridgeApi.js.map
|