@burdenoff/cli-sdk 2026.627.5 → 2026.629.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/modules/adaptercloud/index.cjs +308 -0
- package/dist/modules/adaptercloud/index.d.cts +7 -0
- package/dist/modules/adaptercloud/index.d.ts +7 -0
- package/dist/modules/adaptercloud/index.js +308 -0
- package/dist/modules/atheletebridge/index.cjs +276 -0
- package/dist/modules/atheletebridge/index.d.cts +7 -0
- package/dist/modules/atheletebridge/index.d.ts +7 -0
- package/dist/modules/atheletebridge/index.js +276 -0
- package/dist/modules/coolandlovely/index.cjs +282 -0
- package/dist/modules/coolandlovely/index.d.cts +7 -0
- package/dist/modules/coolandlovely/index.d.ts +7 -0
- package/dist/modules/coolandlovely/index.js +282 -0
- package/dist/modules/hookmovies/index.cjs +304 -0
- package/dist/modules/hookmovies/index.d.cts +7 -0
- package/dist/modules/hookmovies/index.d.ts +7 -0
- package/dist/modules/hookmovies/index.js +304 -0
- package/dist/modules/labsofscience/index.cjs +343 -0
- package/dist/modules/labsofscience/index.d.cts +7 -0
- package/dist/modules/labsofscience/index.d.ts +7 -0
- package/dist/modules/labsofscience/index.js +343 -0
- package/dist/modules/subscriberbot/index.cjs +325 -0
- package/dist/modules/subscriberbot/index.d.cts +7 -0
- package/dist/modules/subscriberbot/index.d.ts +7 -0
- package/dist/modules/subscriberbot/index.js +325 -0
- package/package.json +1 -1
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var p=class extends Error{exitCode;hint;constructor(r,n){super(r),this.name="CliUserError",this.exitCode=n?.exitCode??1,this.hint=n?.hint;}},I=class extends p{constructor(r,n){super(r,{exitCode:2,hint:n?.hint??"Run `<product> auth login` to authenticate."}),this.name="CliAuthError";}},f=class extends Error{cause;constructor(r,n){super(r),this.name="CliInternalError",this.cause=n;}};var C=null;function S(i){C=i;}function w(){if(!C)throw new f("vibecontrols module helpers used before setHelpersContext was called");return C}function xt(){let i=w();if(!i.auth.isAuthenticated())throw new I(`Authentication required. Run \`${i.productName} auth login\`.`)}async function u(i,r){return xt(),w().gql.workspace.request(i,r)}async function k(i,r){return w().gql.workspaceAuthOnly.request(i,r)}function s(i){let r=i instanceof Error?i.message:String(i);throw new p(r)}function a(i,r,n){w().output.formatAndOutput(i,r,n);}function d(i){w().output.printSuccess(i);}function l(i,r){return w().output.truncate(i,r)}var T=`
|
|
2
|
+
query AthListTeams(
|
|
3
|
+
$pagination: PaginationInput
|
|
4
|
+
$sport: AthSport
|
|
5
|
+
$status: AthTeamStatus
|
|
6
|
+
) {
|
|
7
|
+
athListTeams(pagination: $pagination, sport: $sport, status: $status) {
|
|
8
|
+
items {
|
|
9
|
+
id name sport status season ageGroup homeVenue headCoachId
|
|
10
|
+
tags createdAt updatedAt workspaceId
|
|
11
|
+
}
|
|
12
|
+
pageInfo { cursor hasMore }
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
`,x=`
|
|
16
|
+
query AthTeam($id: ID!) {
|
|
17
|
+
athTeam(id: $id) {
|
|
18
|
+
id name description sport status season ageGroup homeVenue headCoachId
|
|
19
|
+
tags createdAt updatedAt workspaceId
|
|
20
|
+
members { id displayName role status jerseyNumber position userId }
|
|
21
|
+
fixtures { id homeTeamId awayTeamId scheduledAt status type competition }
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
`,E=`
|
|
25
|
+
mutation AthCreateTeam($input: AthCreateTeamInput!) {
|
|
26
|
+
athCreateTeam(input: $input) {
|
|
27
|
+
id name description sport status season ageGroup homeVenue headCoachId
|
|
28
|
+
tags createdAt workspaceId
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
`,R=`
|
|
32
|
+
mutation AthUpdateTeam($id: ID!, $input: AthUpdateTeamInput!) {
|
|
33
|
+
athUpdateTeam(id: $id, input: $input) {
|
|
34
|
+
id name description sport status season ageGroup homeVenue headCoachId
|
|
35
|
+
tags updatedAt
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
`,v=`
|
|
39
|
+
mutation AthArchiveTeam($id: ID!) {
|
|
40
|
+
athArchiveTeam(id: $id)
|
|
41
|
+
}
|
|
42
|
+
`,O=`
|
|
43
|
+
query AthListMembers($teamId: ID!, $status: AthMemberStatus) {
|
|
44
|
+
athListMembers(teamId: $teamId, status: $status) {
|
|
45
|
+
id teamId userId displayName role status jerseyNumber position
|
|
46
|
+
dominantSide height weight joinedAt notes createdAt updatedAt workspaceId
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
`,D=`
|
|
50
|
+
mutation AthAddMember($input: AthAddMemberInput!) {
|
|
51
|
+
athAddMember(input: $input) {
|
|
52
|
+
id teamId userId displayName role status jerseyNumber position
|
|
53
|
+
dominantSide height weight joinedAt notes createdAt workspaceId
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
`,$=`
|
|
57
|
+
mutation AthUpdateMember($id: ID!, $input: AthUpdateMemberInput!) {
|
|
58
|
+
athUpdateMember(id: $id, input: $input) {
|
|
59
|
+
id teamId userId displayName role status jerseyNumber position
|
|
60
|
+
dominantSide height weight notes updatedAt
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
`,L=`
|
|
64
|
+
mutation AthRemoveMember($id: ID!) {
|
|
65
|
+
athRemoveMember(id: $id)
|
|
66
|
+
}
|
|
67
|
+
`,P=`
|
|
68
|
+
query AthListPrograms(
|
|
69
|
+
$pagination: PaginationInput
|
|
70
|
+
$level: AthProgramLevel
|
|
71
|
+
$sport: AthSport
|
|
72
|
+
$status: AthProgramStatus
|
|
73
|
+
) {
|
|
74
|
+
athListPrograms(
|
|
75
|
+
pagination: $pagination
|
|
76
|
+
level: $level
|
|
77
|
+
sport: $sport
|
|
78
|
+
status: $status
|
|
79
|
+
) {
|
|
80
|
+
items {
|
|
81
|
+
id name summary sport level status weeks isTemplate coachId
|
|
82
|
+
tags createdAt updatedAt workspaceId
|
|
83
|
+
}
|
|
84
|
+
pageInfo { cursor hasMore }
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
`,M=`
|
|
88
|
+
query AthProgram($id: ID!) {
|
|
89
|
+
athProgram(id: $id) {
|
|
90
|
+
id name summary sport level status weeks isTemplate coachId
|
|
91
|
+
tags createdAt updatedAt workspaceId
|
|
92
|
+
drills {
|
|
93
|
+
id name description weekNumber orderIndex sets reps durationSec
|
|
94
|
+
restSec
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
`,N=`
|
|
99
|
+
mutation AthCreateProgram($input: AthCreateProgramInput!) {
|
|
100
|
+
athCreateProgram(input: $input) {
|
|
101
|
+
id name summary sport level status weeks isTemplate coachId
|
|
102
|
+
tags createdAt workspaceId
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
`,_=`
|
|
106
|
+
mutation AthUpdateProgram($id: ID!, $input: AthUpdateProgramInput!) {
|
|
107
|
+
athUpdateProgram(id: $id, input: $input) {
|
|
108
|
+
id name summary sport level status weeks isTemplate tags updatedAt
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
`,F=`
|
|
112
|
+
mutation AthTransitionProgram($id: ID!, $status: AthProgramStatus!) {
|
|
113
|
+
athTransitionProgram(id: $id, status: $status) {
|
|
114
|
+
id name status updatedAt
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
`,U=`
|
|
118
|
+
mutation AthArchiveProgram($id: ID!) {
|
|
119
|
+
athArchiveProgram(id: $id)
|
|
120
|
+
}
|
|
121
|
+
`,q=`
|
|
122
|
+
mutation AthAddDrill($input: AthAddDrillInput!) {
|
|
123
|
+
athAddDrill(input: $input) {
|
|
124
|
+
id programId name description weekNumber orderIndex sets reps
|
|
125
|
+
durationSec restSec createdAt workspaceId
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
`,G=`
|
|
129
|
+
mutation AthRemoveDrill($id: ID!) {
|
|
130
|
+
athRemoveDrill(id: $id)
|
|
131
|
+
}
|
|
132
|
+
`,W=`
|
|
133
|
+
query AthListSessions(
|
|
134
|
+
$pagination: PaginationInput
|
|
135
|
+
$athleteId: ID
|
|
136
|
+
$coachId: ID
|
|
137
|
+
$status: AthSessionStatus
|
|
138
|
+
) {
|
|
139
|
+
athListSessions(
|
|
140
|
+
pagination: $pagination
|
|
141
|
+
athleteId: $athleteId
|
|
142
|
+
coachId: $coachId
|
|
143
|
+
status: $status
|
|
144
|
+
) {
|
|
145
|
+
items {
|
|
146
|
+
id title type status athleteId coachId programId scheduledAt
|
|
147
|
+
durationMin location meetingUrl completedAt rating feedback
|
|
148
|
+
createdAt updatedAt workspaceId
|
|
149
|
+
}
|
|
150
|
+
pageInfo { cursor hasMore }
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
`,j=`
|
|
154
|
+
query AthSession($id: ID!) {
|
|
155
|
+
athSession(id: $id) {
|
|
156
|
+
id title type status athleteId coachId programId scheduledAt
|
|
157
|
+
durationMin location meetingUrl completedAt rating feedback
|
|
158
|
+
createdAt updatedAt workspaceId
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
`,H=`
|
|
162
|
+
mutation AthBookSession($input: AthBookSessionInput!) {
|
|
163
|
+
athBookSession(input: $input) {
|
|
164
|
+
id title type status athleteId coachId programId scheduledAt
|
|
165
|
+
durationMin location meetingUrl createdAt workspaceId
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
`,B=`
|
|
169
|
+
mutation AthConfirmSession($id: ID!) {
|
|
170
|
+
athConfirmSession(id: $id) {
|
|
171
|
+
id title status scheduledAt updatedAt
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
`,V=`
|
|
175
|
+
mutation AthCancelSession($id: ID!) {
|
|
176
|
+
athCancelSession(id: $id) {
|
|
177
|
+
id title status updatedAt
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
`,z=`
|
|
181
|
+
mutation AthCompleteSession($id: ID!, $input: AthCompleteSessionInput) {
|
|
182
|
+
athCompleteSession(id: $id, input: $input) {
|
|
183
|
+
id title status completedAt rating feedback updatedAt
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
`,J=`
|
|
187
|
+
query AthListWorkoutLogs(
|
|
188
|
+
$pagination: PaginationInput
|
|
189
|
+
$athleteId: ID
|
|
190
|
+
$programId: ID
|
|
191
|
+
) {
|
|
192
|
+
athListWorkoutLogs(
|
|
193
|
+
pagination: $pagination
|
|
194
|
+
athleteId: $athleteId
|
|
195
|
+
programId: $programId
|
|
196
|
+
) {
|
|
197
|
+
items {
|
|
198
|
+
id title status athleteId programId performedAt durationMin
|
|
199
|
+
totalLoad rpe notes metrics createdAt updatedAt workspaceId
|
|
200
|
+
}
|
|
201
|
+
pageInfo { cursor hasMore }
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
`,K=`
|
|
205
|
+
mutation AthLogWorkout($input: AthLogWorkoutInput!) {
|
|
206
|
+
athLogWorkout(input: $input) {
|
|
207
|
+
id title status athleteId programId performedAt durationMin
|
|
208
|
+
totalLoad rpe notes metrics createdAt workspaceId
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
`,Y=`
|
|
212
|
+
query AthPerformanceMetrics($athleteId: ID!, $type: AthMetricType) {
|
|
213
|
+
athPerformanceMetrics(athleteId: $athleteId, type: $type) {
|
|
214
|
+
id athleteId label type value unit source recordedAt
|
|
215
|
+
createdAt updatedAt workspaceId
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
`,X=`
|
|
219
|
+
mutation AthRecordMetric($input: AthRecordMetricInput!) {
|
|
220
|
+
athRecordMetric(input: $input) {
|
|
221
|
+
id athleteId label type value unit source recordedAt
|
|
222
|
+
createdAt workspaceId
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
`,Q=`
|
|
226
|
+
query AthListFixtures(
|
|
227
|
+
$pagination: PaginationInput
|
|
228
|
+
$status: AthFixtureStatus
|
|
229
|
+
$teamId: ID
|
|
230
|
+
) {
|
|
231
|
+
athListFixtures(pagination: $pagination, status: $status, teamId: $teamId) {
|
|
232
|
+
items {
|
|
233
|
+
id type status competition round homeTeamId awayTeamId
|
|
234
|
+
homeScore awayScore scheduledAt kickoffAt venue notes
|
|
235
|
+
createdAt updatedAt workspaceId
|
|
236
|
+
}
|
|
237
|
+
pageInfo { cursor hasMore }
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
`,Z=`
|
|
241
|
+
query AthFixture($id: ID!) {
|
|
242
|
+
athFixture(id: $id) {
|
|
243
|
+
id type status competition round homeTeamId awayTeamId
|
|
244
|
+
homeScore awayScore scheduledAt kickoffAt venue notes
|
|
245
|
+
createdAt updatedAt workspaceId
|
|
246
|
+
homeTeam { id name }
|
|
247
|
+
awayTeam { id name }
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
`,tt=`
|
|
251
|
+
mutation AthScheduleFixture($input: AthCreateFixtureInput!) {
|
|
252
|
+
athScheduleFixture(input: $input) {
|
|
253
|
+
id type status competition round homeTeamId awayTeamId
|
|
254
|
+
scheduledAt kickoffAt venue notes createdAt workspaceId
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
`,et=`
|
|
258
|
+
mutation AthRecordFixtureResult($id: ID!, $input: AthRecordResultInput!) {
|
|
259
|
+
athRecordFixtureResult(id: $id, input: $input) {
|
|
260
|
+
id type status competition homeTeamId awayTeamId
|
|
261
|
+
homeScore awayScore updatedAt
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
`,nt=`
|
|
265
|
+
query AthStandings($competition: String!) {
|
|
266
|
+
athStandings(competition: $competition) {
|
|
267
|
+
id competition teamId rank played won drawn lost
|
|
268
|
+
goalsFor goalsAgainst points createdAt updatedAt workspaceId
|
|
269
|
+
team { id name }
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
`,rt=`
|
|
273
|
+
query AthHealth {
|
|
274
|
+
athHealth
|
|
275
|
+
}
|
|
276
|
+
`;function ot(i,r){try{return JSON.parse(r)}catch{throw new p(`--${i} must be valid JSON`)}}function c(i){let r=Number.parseInt(i,10);if(Number.isNaN(r))throw new p(`Expected an integer but got "${i}"`);return r}function g(i){let r=Number.parseFloat(i);if(Number.isNaN(r))throw new p(`Expected a number but got "${i}"`);return r}function y(i){return i.split(",").map(r=>r.trim()).filter(r=>r.length>0)}function it(i){let r=i.command("teams").description("AtheleteBridge teams");r.command("list").description("List teams").option("--sport <s>","Filter by sport").option("--status <s>","Filter by team status").option("--limit <n>","Page size",c,50).option("--offset <n>","Offset",c,0).option("-f, --format <format>","Output format").action(async n=>{try{let t=await u(T,{pagination:{limit:n.limit,offset:n.offset},sport:n.sport?n.sport.toUpperCase():void 0,status:n.status?n.status.toUpperCase():void 0});a(n,t.athListTeams.items,{headers:["ID","Name","Sport","Status","Season"],rows:t.athListTeams.items.map(e=>[l(e.id,12),e.name,e.sport,e.status,e.season??"-"])});}catch(t){s(t);}}),r.command("get").description("Get a team by id").argument("<id>","Team ID").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await u(x,{id:n});if(!e.athTeam)throw new p(`Team ${n} not found`);a(t,e.athTeam);}catch(e){s(e);}}),r.command("create").description("Create a team").requiredOption("--name <name>","Team name").option("--description <s>","Description").option("--sport <s>","Sport","OTHER").option("--status <s>","Team status","FORMING").option("--season <s>","Season").option("--age-group <s>","Age group").option("--home-venue <s>","Home venue").option("--head-coach-id <id>","Head coach user ID").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async n=>{try{let t={name:n.name,sport:(n.sport??"OTHER").toUpperCase(),status:(n.status??"FORMING").toUpperCase()};n.description&&(t.description=n.description),n.season&&(t.season=n.season),n.ageGroup&&(t.ageGroup=n.ageGroup),n.homeVenue&&(t.homeVenue=n.homeVenue),n.headCoachId&&(t.headCoachId=n.headCoachId),n.tags&&(t.tags=y(n.tags));let e=await u(E,{input:t});d(`Team created: ${e.athCreateTeam.name}`),a(n,e.athCreateTeam);}catch(t){s(t);}}),r.command("update").description("Update a team").argument("<id>","Team ID").option("--name <name>","Team name").option("--description <s>","Description").option("--sport <s>","Sport").option("--status <s>","Team status").option("--season <s>","Season").option("--age-group <s>","Age group").option("--home-venue <s>","Home venue").option("--head-coach-id <id>","Head coach user ID").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e={};if(t.name&&(e.name=t.name),t.description!==void 0&&(e.description=t.description),t.sport&&(e.sport=t.sport.toUpperCase()),t.status&&(e.status=t.status.toUpperCase()),t.season&&(e.season=t.season),t.ageGroup&&(e.ageGroup=t.ageGroup),t.homeVenue&&(e.homeVenue=t.homeVenue),t.headCoachId&&(e.headCoachId=t.headCoachId),t.tags&&(e.tags=y(t.tags)),!Object.keys(e).length)throw new p("No updates specified");let o=await u(R,{id:n,input:e});d("Team updated"),a(t,o.athUpdateTeam);}catch(e){s(e);}}),r.command("archive").description("Archive a team").argument("<id>","Team ID").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await u(v,{id:n});d(e.athArchiveTeam?`Team ${n} archived`:`Team ${n} not archived`),a(t,{archived:e.athArchiveTeam});}catch(e){s(e);}});}function st(i){let r=i.command("members").description("AtheleteBridge team members");r.command("list").description("List members of a team").requiredOption("--team <id>","Team ID").option("--status <s>","Filter by member status").option("-f, --format <format>","Output format").action(async n=>{try{let t=await u(O,{teamId:n.team,status:n.status?n.status.toUpperCase():void 0});a(n,t.athListMembers,{headers:["ID","Name","Role","Status","Jersey","Position"],rows:t.athListMembers.map(e=>[l(e.id,12),e.displayName,e.role,e.status,e.jerseyNumber!==void 0&&e.jerseyNumber!==null?String(e.jerseyNumber):"-",e.position??"-"])});}catch(t){s(t);}}),r.command("add").description("Add a member to a team").requiredOption("--team <id>","Team ID").requiredOption("--user <id>","User ID").requiredOption("--display-name <name>","Display name").option("--role <r>","Member role","PLAYER").option("--status <s>","Member status","ACTIVE").option("--jersey-number <n>","Jersey number",c).option("--position <s>","Position").option("--dominant-side <s>","Dominant side").option("--height <n>","Height",g).option("--weight <n>","Weight",g).option("--joined-at <iso>","Joined at (ISO timestamp)").option("--notes <s>","Notes").option("-f, --format <format>","Output format").action(async n=>{try{let t={teamId:n.team,userId:n.user,displayName:n.displayName,role:(n.role??"PLAYER").toUpperCase(),status:(n.status??"ACTIVE").toUpperCase()};n.jerseyNumber!==void 0&&(t.jerseyNumber=n.jerseyNumber),n.position&&(t.position=n.position),n.dominantSide&&(t.dominantSide=n.dominantSide),n.height!==void 0&&(t.height=n.height),n.weight!==void 0&&(t.weight=n.weight),n.joinedAt&&(t.joinedAt=n.joinedAt),n.notes&&(t.notes=n.notes);let e=await u(D,{input:t});d(`Member added: ${e.athAddMember.displayName}`),a(n,e.athAddMember);}catch(t){s(t);}}),r.command("update").description("Update a team member").argument("<id>","Member ID").option("--display-name <name>","Display name").option("--role <r>","Member role").option("--status <s>","Member status").option("--jersey-number <n>","Jersey number",c).option("--position <s>","Position").option("--dominant-side <s>","Dominant side").option("--height <n>","Height",g).option("--weight <n>","Weight",g).option("--notes <s>","Notes").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e={};if(t.displayName&&(e.displayName=t.displayName),t.role&&(e.role=t.role.toUpperCase()),t.status&&(e.status=t.status.toUpperCase()),t.jerseyNumber!==void 0&&(e.jerseyNumber=t.jerseyNumber),t.position&&(e.position=t.position),t.dominantSide&&(e.dominantSide=t.dominantSide),t.height!==void 0&&(e.height=t.height),t.weight!==void 0&&(e.weight=t.weight),t.notes!==void 0&&(e.notes=t.notes),!Object.keys(e).length)throw new p("No updates specified");let o=await u($,{id:n,input:e});d("Member updated"),a(t,o.athUpdateMember);}catch(e){s(e);}}),r.command("remove").description("Remove a team member").argument("<id>","Member ID").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await u(L,{id:n});d(e.athRemoveMember?`Member ${n} removed`:`Member ${n} not removed`),a(t,{removed:e.athRemoveMember});}catch(e){s(e);}});}function at(i){let r=i.command("programs").description("AtheleteBridge training programs");r.command("list").description("List training programs").option("--level <l>","Filter by program level").option("--sport <s>","Filter by sport").option("--status <s>","Filter by program status").option("--limit <n>","Page size",c,50).option("--offset <n>","Offset",c,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await u(P,{pagination:{limit:t.limit,offset:t.offset},level:t.level?t.level.toUpperCase():void 0,sport:t.sport?t.sport.toUpperCase():void 0,status:t.status?t.status.toUpperCase():void 0});a(t,e.athListPrograms.items,{headers:["ID","Name","Sport","Level","Status","Weeks"],rows:e.athListPrograms.items.map(o=>[l(o.id,12),o.name,o.sport,o.level,o.status,o.weeks!==void 0&&o.weeks!==null?String(o.weeks):"-"])});}catch(e){s(e);}}),r.command("get").description("Get a training program by id").argument("<id>","Program ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let o=await u(M,{id:t});if(!o.athProgram)throw new p(`Program ${t} not found`);a(e,o.athProgram);}catch(o){s(o);}}),r.command("create").description("Create a training program").requiredOption("--name <name>","Program name").option("--summary <s>","Summary").option("--sport <s>","Sport","OTHER").option("--level <l>","Level","BEGINNER").option("--weeks <n>","Number of weeks",c).option("--template","Mark as a template").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async t=>{try{let e={name:t.name,sport:(t.sport??"OTHER").toUpperCase(),level:(t.level??"BEGINNER").toUpperCase(),isTemplate:!!t.template};t.summary&&(e.summary=t.summary),t.weeks!==void 0&&(e.weeks=t.weeks),t.tags&&(e.tags=y(t.tags));let o=await u(N,{input:e});d(`Program created: ${o.athCreateProgram.name}`),a(t,o.athCreateProgram);}catch(e){s(e);}}),r.command("update").description("Update a training program").argument("<id>","Program ID").option("--name <name>","Program name").option("--summary <s>","Summary").option("--sport <s>","Sport").option("--level <l>","Level").option("--weeks <n>","Number of weeks",c).option("--template <bool>","Template flag (true|false)").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let o={};if(e.name&&(o.name=e.name),e.summary!==void 0&&(o.summary=e.summary),e.sport&&(o.sport=e.sport.toUpperCase()),e.level&&(o.level=e.level.toUpperCase()),e.weeks!==void 0&&(o.weeks=e.weeks),e.template!==void 0&&(o.isTemplate=e.template==="true"),e.tags&&(o.tags=y(e.tags)),!Object.keys(o).length)throw new p("No updates specified");let gt=await u(_,{id:t,input:o});d("Program updated"),a(e,gt.athUpdateProgram);}catch(o){s(o);}}),r.command("transition").description("Advance a program through its publish lifecycle (DRAFT -> PUBLISHED -> ARCHIVED)").argument("<id>","Program ID").requiredOption("--status <s>","Target status: DRAFT|PUBLISHED|ARCHIVED").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let o=await u(F,{id:t,status:e.status.toUpperCase()});d(`Program transitioned to ${o.athTransitionProgram.status}`),a(e,o.athTransitionProgram);}catch(o){s(o);}}),r.command("archive").description("Archive a training program").argument("<id>","Program ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let o=await u(U,{id:t});d(o.athArchiveProgram?`Program ${t} archived`:`Program ${t} not archived`),a(e,{archived:o.athArchiveProgram});}catch(o){s(o);}});let n=r.command("drills").description("AtheleteBridge program drills");n.command("add").description("Add a drill to a program").requiredOption("--program <id>","Program ID").requiredOption("--name <name>","Drill name").option("--description <s>","Description").option("--week-number <n>","Week number",c,1).option("--order-index <n>","Order index",c,0).option("--sets <n>","Sets",c).option("--reps <n>","Reps",c).option("--duration-sec <n>","Duration (seconds)",c).option("--rest-sec <n>","Rest (seconds)",c).option("--video-file-id <id>","Video file ID (wspace-files-svc)").option("-f, --format <format>","Output format").action(async t=>{try{let e={programId:t.program,name:t.name,weekNumber:t.weekNumber??1,orderIndex:t.orderIndex??0};t.description&&(e.description=t.description),t.sets!==void 0&&(e.sets=t.sets),t.reps!==void 0&&(e.reps=t.reps),t.durationSec!==void 0&&(e.durationSec=t.durationSec),t.restSec!==void 0&&(e.restSec=t.restSec),t.videoFileId&&(e.videoFileId=t.videoFileId);let o=await u(q,{input:e});d(`Drill added: ${o.athAddDrill.name}`),a(t,o.athAddDrill);}catch(e){s(e);}}),n.command("remove").description("Remove a drill").argument("<id>","Drill ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let o=await u(G,{id:t});d(o.athRemoveDrill?`Drill ${t} removed`:`Drill ${t} not removed`),a(e,{removed:o.athRemoveDrill});}catch(o){s(o);}});}function ut(i){let r=i.command("sessions").description("AtheleteBridge coaching sessions");r.command("list").description("List sessions").option("--athlete <id>","Filter by athlete ID").option("--coach <id>","Filter by coach ID").option("--status <s>","Filter by session status").option("--limit <n>","Page size",c,50).option("--offset <n>","Offset",c,0).option("-f, --format <format>","Output format").action(async n=>{try{let t=await u(W,{pagination:{limit:n.limit,offset:n.offset},athleteId:n.athlete,coachId:n.coach,status:n.status?n.status.toUpperCase():void 0});a(n,t.athListSessions.items,{headers:["ID","Title","Type","Status","Scheduled"],rows:t.athListSessions.items.map(e=>[l(e.id,12),e.title,e.type,e.status,e.scheduledAt])});}catch(t){s(t);}}),r.command("get").description("Get a session by id").argument("<id>","Session ID").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await u(j,{id:n});if(!e.athSession)throw new p(`Session ${n} not found`);a(t,e.athSession);}catch(e){s(e);}}),r.command("book").description("Book a coaching session").requiredOption("--athlete <id>","Athlete ID").requiredOption("--coach <id>","Coach ID").requiredOption("--title <s>","Session title").requiredOption("--scheduled-at <iso>","Scheduled at (ISO timestamp)").option("--type <t>","Session type","IN_PERSON").option("--duration-min <n>","Duration (minutes)",c).option("--location <s>","Location").option("--meeting-url <url>","Meeting URL").option("--program <id>","Program ID").option("-f, --format <format>","Output format").action(async n=>{try{let t={athleteId:n.athlete,coachId:n.coach,title:n.title,scheduledAt:n.scheduledAt,type:(n.type??"IN_PERSON").toUpperCase()};n.durationMin!==void 0&&(t.durationMin=n.durationMin),n.location&&(t.location=n.location),n.meetingUrl&&(t.meetingUrl=n.meetingUrl),n.program&&(t.programId=n.program);let e=await u(H,{input:t});d(`Session booked: ${e.athBookSession.title}`),a(n,e.athBookSession);}catch(t){s(t);}}),r.command("confirm").description("Confirm a requested session").argument("<id>","Session ID").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await u(B,{id:n});d(`Session confirmed: ${e.athConfirmSession.status}`),a(t,e.athConfirmSession);}catch(e){s(e);}}),r.command("cancel").description("Cancel a session").argument("<id>","Session ID").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await u(V,{id:n});d(`Session cancelled: ${e.athCancelSession.status}`),a(t,e.athCancelSession);}catch(e){s(e);}}),r.command("complete").description("Complete a session (optionally with rating and feedback)").argument("<id>","Session ID").option("--rating <n>","Rating",c).option("--feedback <s>","Feedback").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e={};t.rating!==void 0&&(e.rating=t.rating),t.feedback&&(e.feedback=t.feedback);let o=await u(z,{id:n,input:Object.keys(e).length?e:void 0});d(`Session completed: ${o.athCompleteSession.status}`),a(t,o.athCompleteSession);}catch(e){s(e);}});}function ct(i){let r=i.command("workouts").description("AtheleteBridge workout logs");r.command("list").description("List workout logs").option("--athlete <id>","Filter by athlete ID").option("--program <id>","Filter by program ID").option("--limit <n>","Page size",c,50).option("--offset <n>","Offset",c,0).option("-f, --format <format>","Output format").action(async n=>{try{let t=await u(J,{pagination:{limit:n.limit,offset:n.offset},athleteId:n.athlete,programId:n.program});a(n,t.athListWorkoutLogs.items,{headers:["ID","Title","Status","Performed","Load","RPE"],rows:t.athListWorkoutLogs.items.map(e=>[l(e.id,12),e.title,e.status,e.performedAt,e.totalLoad!==void 0&&e.totalLoad!==null?String(e.totalLoad):"-",e.rpe!==void 0&&e.rpe!==null?String(e.rpe):"-"])});}catch(t){s(t);}}),r.command("log").description("Log a workout").requiredOption("--title <s>","Workout title").requiredOption("--performed-at <iso>","Performed at (ISO timestamp)").option("--athlete <id>","Athlete ID").option("--program <id>","Program ID").option("--status <s>","Workout status","COMPLETED").option("--duration-min <n>","Duration (minutes)",c).option("--total-load <n>","Total load",g).option("--rpe <n>","Rate of perceived exertion",c).option("--notes <s>","Notes").option("--metrics <json>","Metrics JSON object").option("-f, --format <format>","Output format").action(async n=>{try{let t={title:n.title,performedAt:n.performedAt,status:(n.status??"COMPLETED").toUpperCase()};n.athlete&&(t.athleteId=n.athlete),n.program&&(t.programId=n.program),n.durationMin!==void 0&&(t.durationMin=n.durationMin),n.totalLoad!==void 0&&(t.totalLoad=n.totalLoad),n.rpe!==void 0&&(t.rpe=n.rpe),n.notes&&(t.notes=n.notes),n.metrics&&(t.metrics=ot("metrics",n.metrics));let e=await u(K,{input:t});d(`Workout logged: ${e.athLogWorkout.title}`),a(n,e.athLogWorkout);}catch(t){s(t);}});}function dt(i){let r=i.command("metrics").description("AtheleteBridge performance metrics");r.command("list").description("List performance metrics for an athlete").requiredOption("--athlete <id>","Athlete ID").option("--type <t>","Filter by metric type").option("-f, --format <format>","Output format").action(async n=>{try{let t=await u(Y,{athleteId:n.athlete,type:n.type?n.type.toUpperCase():void 0});a(n,t.athPerformanceMetrics,{headers:["ID","Label","Type","Value","Unit","Recorded"],rows:t.athPerformanceMetrics.map(e=>[l(e.id,12),e.label,e.type,String(e.value),e.unit??"-",e.recordedAt])});}catch(t){s(t);}}),r.command("record").description("Record a performance metric").requiredOption("--label <s>","Metric label").requiredOption("--value <n>","Metric value",g).requiredOption("--recorded-at <iso>","Recorded at (ISO timestamp)").option("--athlete <id>","Athlete ID").option("--type <t>","Metric type","CUSTOM").option("--unit <s>","Unit").option("--source <s>","Source").option("-f, --format <format>","Output format").action(async n=>{try{let t={label:n.label,value:n.value,recordedAt:n.recordedAt,type:(n.type??"CUSTOM").toUpperCase()};n.athlete&&(t.athleteId=n.athlete),n.unit&&(t.unit=n.unit),n.source&&(t.source=n.source);let e=await u(X,{input:t});d(`Metric recorded: ${e.athRecordMetric.label}`),a(n,e.athRecordMetric);}catch(t){s(t);}});}function pt(i){let r=i.command("fixtures").description("AtheleteBridge fixtures");r.command("list").description("List fixtures").option("--team <id>","Filter by team ID").option("--status <s>","Filter by fixture status").option("--limit <n>","Page size",c,50).option("--offset <n>","Offset",c,0).option("-f, --format <format>","Output format").action(async n=>{try{let t=await u(Q,{pagination:{limit:n.limit,offset:n.offset},status:n.status?n.status.toUpperCase():void 0,teamId:n.team});a(n,t.athListFixtures.items,{headers:["ID","Type","Status","Competition","Scheduled","Score"],rows:t.athListFixtures.items.map(e=>[l(e.id,12),e.type,e.status,e.competition??"-",e.scheduledAt,e.homeScore!==void 0&&e.homeScore!==null&&e.awayScore!==void 0&&e.awayScore!==null?`${e.homeScore}-${e.awayScore}`:"-"])});}catch(t){s(t);}}),r.command("get").description("Get a fixture by id").argument("<id>","Fixture ID").option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await u(Z,{id:n});if(!e.athFixture)throw new p(`Fixture ${n} not found`);a(t,e.athFixture);}catch(e){s(e);}}),r.command("schedule").description("Schedule a fixture").requiredOption("--home-team <id>","Home team ID").requiredOption("--scheduled-at <iso>","Scheduled at (ISO timestamp)").option("--away-team <id>","Away team ID").option("--type <t>","Fixture type","FRIENDLY").option("--competition <s>","Competition").option("--round <s>","Round").option("--kickoff-at <iso>","Kickoff at (ISO timestamp)").option("--venue <s>","Venue").option("--notes <s>","Notes").option("-f, --format <format>","Output format").action(async n=>{try{let t={homeTeamId:n.homeTeam,scheduledAt:n.scheduledAt,type:(n.type??"FRIENDLY").toUpperCase()};n.awayTeam&&(t.awayTeamId=n.awayTeam),n.competition&&(t.competition=n.competition),n.round&&(t.round=n.round),n.kickoffAt&&(t.kickoffAt=n.kickoffAt),n.venue&&(t.venue=n.venue),n.notes&&(t.notes=n.notes);let e=await u(tt,{input:t});d(`Fixture scheduled: ${e.athScheduleFixture.id}`),a(n,e.athScheduleFixture);}catch(t){s(t);}}),r.command("record-result").description("Record a final result for a fixture and recompute standings").argument("<id>","Fixture ID").requiredOption("--home-score <n>","Home score",c).requiredOption("--away-score <n>","Away score",c).option("-f, --format <format>","Output format").action(async(n,t)=>{try{let e=await u(et,{id:n,input:{homeScore:t.homeScore,awayScore:t.awayScore}});d(`Result recorded: ${e.athRecordFixtureResult.homeScore??0}-${e.athRecordFixtureResult.awayScore??0}`),a(t,e.athRecordFixtureResult);}catch(e){s(e);}});}function mt(i){i.command("standings").description("AtheleteBridge standings").command("list").description("List standings for a competition").requiredOption("--competition <s>","Competition name").option("-f, --format <format>","Output format").action(async n=>{try{let t=await u(nt,{competition:n.competition});a(n,t.athStandings,{headers:["Rank","Team","P","W","D","L","Pts"],rows:t.athStandings.map(e=>[e.rank!==void 0&&e.rank!==null?String(e.rank):"-",l(e.teamId,12),String(e.played),String(e.won),String(e.drawn),String(e.lost),String(e.points)])});}catch(t){s(t);}});}function lt(i){i.command("health").description("AtheleteBridge service health check (public)").option("-f, --format <format>","Output format").action(async r=>{try{let n=await k(rt);d(n.athHealth),a(r,{health:n.athHealth});}catch(n){s(n);}});}var Et={id:"atheletebridge",version:"1.0.0",displayName:"AtheleteBridge",dependsOn:["auth","workspaces"],register(i,r){S(r);let n=i.command("atheletebridge").description("AtheleteBridge sports team & athlete management");it(n),st(n),at(n),ut(n),ct(n),dt(n),pt(n),mt(n),lt(n);}},ln=Et;module.exports=ln;
|