@globalscoutme/api-client 1.0.13 → 1.0.15
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/README.md +197 -119
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/sdk.gen.d.ts +82 -30
- package/dist/sdk.gen.js +143 -29
- package/dist/types.gen.d.ts +603 -144
- package/index.ts +191 -114
- package/package.json +1 -1
- package/sdk.gen.ts +471 -201
- package/types.gen.ts +719 -170
package/dist/sdk.gen.js
CHANGED
|
@@ -23,19 +23,19 @@ class HeyApiRegistry {
|
|
|
23
23
|
}
|
|
24
24
|
export class Auth extends HeyApiClient {
|
|
25
25
|
getAuthMe(options) {
|
|
26
|
-
return (options?.client ?? this.client).get({ url: '/auth/me', ...options });
|
|
26
|
+
return (options?.client ?? this.client).get({ url: '/api/auth/me', ...options });
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
export class Players extends HeyApiClient {
|
|
30
30
|
deleteMe(options) {
|
|
31
|
-
return (options?.client ?? this.client).delete({ url: '/players/me', ...options });
|
|
31
|
+
return (options?.client ?? this.client).delete({ url: '/api/players/me', ...options });
|
|
32
32
|
}
|
|
33
33
|
getMe(options) {
|
|
34
|
-
return (options?.client ?? this.client).get({ url: '/players/me', ...options });
|
|
34
|
+
return (options?.client ?? this.client).get({ url: '/api/players/me', ...options });
|
|
35
35
|
}
|
|
36
36
|
patchMe(options) {
|
|
37
37
|
return (options.client ?? this.client).patch({
|
|
38
|
-
url: '/players/me',
|
|
38
|
+
url: '/api/players/me',
|
|
39
39
|
...options,
|
|
40
40
|
headers: {
|
|
41
41
|
'Content-Type': 'application/json',
|
|
@@ -44,11 +44,24 @@ export class Players extends HeyApiClient {
|
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
46
|
getMyDashboard(options) {
|
|
47
|
-
return (options?.client ?? this.client).get({ url: '/players/me/dashboard', ...options });
|
|
47
|
+
return (options?.client ?? this.client).get({ url: '/api/players/me/dashboard', ...options });
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Ping presence; records login day and updates user timezone
|
|
51
|
+
*/
|
|
52
|
+
heartbeat(options) {
|
|
53
|
+
return (options.client ?? this.client).post({
|
|
54
|
+
url: '/api/players/me/heartbeat',
|
|
55
|
+
...options,
|
|
56
|
+
headers: {
|
|
57
|
+
'Content-Type': 'application/json',
|
|
58
|
+
...options.headers,
|
|
59
|
+
},
|
|
60
|
+
});
|
|
48
61
|
}
|
|
49
62
|
searchPlayers(options) {
|
|
50
63
|
return (options.client ?? this.client).post({
|
|
51
|
-
url: '/players/search',
|
|
64
|
+
url: '/api/players/search',
|
|
52
65
|
...options,
|
|
53
66
|
headers: {
|
|
54
67
|
'Content-Type': 'application/json',
|
|
@@ -57,16 +70,16 @@ export class Players extends HeyApiClient {
|
|
|
57
70
|
});
|
|
58
71
|
}
|
|
59
72
|
getPlayerById(options) {
|
|
60
|
-
return (options.client ?? this.client).get({ url: '/players/{id}', ...options });
|
|
73
|
+
return (options.client ?? this.client).get({ url: '/api/players/{id}', ...options });
|
|
61
74
|
}
|
|
62
75
|
}
|
|
63
76
|
export class Profile extends HeyApiClient {
|
|
64
77
|
getProfileMe(options) {
|
|
65
|
-
return (options?.client ?? this.client).get({ url: '/profile/me', ...options });
|
|
78
|
+
return (options?.client ?? this.client).get({ url: '/api/profile/me', ...options });
|
|
66
79
|
}
|
|
67
80
|
updateProfileMe(options) {
|
|
68
81
|
return (options.client ?? this.client).put({
|
|
69
|
-
url: '/profile/me',
|
|
82
|
+
url: '/api/profile/me',
|
|
70
83
|
...options,
|
|
71
84
|
headers: {
|
|
72
85
|
'Content-Type': 'application/json',
|
|
@@ -77,19 +90,61 @@ export class Profile extends HeyApiClient {
|
|
|
77
90
|
}
|
|
78
91
|
export class Achievements extends HeyApiClient {
|
|
79
92
|
getAchievementsCatalog(options) {
|
|
80
|
-
return (options?.client ?? this.client).get({ url: '/achievements', ...options });
|
|
93
|
+
return (options?.client ?? this.client).get({ url: '/api/achievements', ...options });
|
|
81
94
|
}
|
|
82
95
|
getMyAchievements(options) {
|
|
83
|
-
return (options?.client ?? this.client).get({ url: '/achievements/me', ...options });
|
|
96
|
+
return (options?.client ?? this.client).get({ url: '/api/achievements/me', ...options });
|
|
84
97
|
}
|
|
85
98
|
}
|
|
86
99
|
export class Body extends HeyApiClient {
|
|
87
100
|
getMyMeasurements(options) {
|
|
88
|
-
return (options?.client ?? this.client).get({ url: '/body/measurements/me', ...options });
|
|
101
|
+
return (options?.client ?? this.client).get({ url: '/api/body/measurements/me', ...options });
|
|
89
102
|
}
|
|
90
103
|
createMeasurement(options) {
|
|
91
104
|
return (options.client ?? this.client).post({
|
|
92
|
-
url: '/body/measurements',
|
|
105
|
+
url: '/api/body/measurements',
|
|
106
|
+
...options,
|
|
107
|
+
headers: {
|
|
108
|
+
'Content-Type': 'application/json',
|
|
109
|
+
...options.headers,
|
|
110
|
+
},
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
export class Challenges extends HeyApiClient {
|
|
115
|
+
/**
|
|
116
|
+
* List all active challenges
|
|
117
|
+
*/
|
|
118
|
+
getChallengesCatalog(options) {
|
|
119
|
+
return (options?.client ?? this.client).get({ url: '/api/challenges', ...options });
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Get the current user's active + recently-expired challenges
|
|
123
|
+
*/
|
|
124
|
+
getMyChallenges(options) {
|
|
125
|
+
return (options?.client ?? this.client).get({ url: '/api/challenges/me', ...options });
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
export class Clubs extends HeyApiClient {
|
|
129
|
+
getMyClubs(options) {
|
|
130
|
+
return (options?.client ?? this.client).get({ url: '/api/clubs/me', ...options });
|
|
131
|
+
}
|
|
132
|
+
createMyClub(options) {
|
|
133
|
+
return (options.client ?? this.client).post({
|
|
134
|
+
url: '/api/clubs/me',
|
|
135
|
+
...options,
|
|
136
|
+
headers: {
|
|
137
|
+
'Content-Type': 'application/json',
|
|
138
|
+
...options.headers,
|
|
139
|
+
},
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
deleteMyClub(options) {
|
|
143
|
+
return (options.client ?? this.client).delete({ url: '/api/clubs/me/{id}', ...options });
|
|
144
|
+
}
|
|
145
|
+
updateMyClub(options) {
|
|
146
|
+
return (options.client ?? this.client).patch({
|
|
147
|
+
url: '/api/clubs/me/{id}',
|
|
93
148
|
...options,
|
|
94
149
|
headers: {
|
|
95
150
|
'Content-Type': 'application/json',
|
|
@@ -100,11 +155,11 @@ export class Body extends HeyApiClient {
|
|
|
100
155
|
}
|
|
101
156
|
export class Documents extends HeyApiClient {
|
|
102
157
|
getMyDocuments(options) {
|
|
103
|
-
return (options?.client ?? this.client).get({ url: '/documents/me', ...options });
|
|
158
|
+
return (options?.client ?? this.client).get({ url: '/api/documents/me', ...options });
|
|
104
159
|
}
|
|
105
160
|
createDocument(options) {
|
|
106
161
|
return (options.client ?? this.client).post({
|
|
107
|
-
url: '/documents',
|
|
162
|
+
url: '/api/documents',
|
|
108
163
|
...options,
|
|
109
164
|
headers: {
|
|
110
165
|
'Content-Type': 'application/json',
|
|
@@ -115,16 +170,16 @@ export class Documents extends HeyApiClient {
|
|
|
115
170
|
}
|
|
116
171
|
export class Index extends HeyApiClient {
|
|
117
172
|
getIndexItems(options) {
|
|
118
|
-
return (options.client ?? this.client).get({ url: '/index/{tableName}', ...options });
|
|
173
|
+
return (options.client ?? this.client).get({ url: '/api/index/{tableName}', ...options });
|
|
119
174
|
}
|
|
120
175
|
}
|
|
121
176
|
export class Offers extends HeyApiClient {
|
|
122
177
|
listConversations(options) {
|
|
123
|
-
return (options?.client ?? this.client).get({ url: '/offers/conversations', ...options });
|
|
178
|
+
return (options?.client ?? this.client).get({ url: '/api/offers/conversations', ...options });
|
|
124
179
|
}
|
|
125
180
|
createConversation(options) {
|
|
126
181
|
return (options.client ?? this.client).post({
|
|
127
|
-
url: '/offers/conversations',
|
|
182
|
+
url: '/api/offers/conversations',
|
|
128
183
|
...options,
|
|
129
184
|
headers: {
|
|
130
185
|
'Content-Type': 'application/json',
|
|
@@ -133,11 +188,11 @@ export class Offers extends HeyApiClient {
|
|
|
133
188
|
});
|
|
134
189
|
}
|
|
135
190
|
listMessages(options) {
|
|
136
|
-
return (options.client ?? this.client).get({ url: '/offers/conversations/{id}/messages', ...options });
|
|
191
|
+
return (options.client ?? this.client).get({ url: '/api/offers/conversations/{id}/messages', ...options });
|
|
137
192
|
}
|
|
138
193
|
sendMessage(options) {
|
|
139
194
|
return (options.client ?? this.client).post({
|
|
140
|
-
url: '/offers/conversations/{id}/messages',
|
|
195
|
+
url: '/api/offers/conversations/{id}/messages',
|
|
141
196
|
...options,
|
|
142
197
|
headers: {
|
|
143
198
|
'Content-Type': 'application/json',
|
|
@@ -146,13 +201,13 @@ export class Offers extends HeyApiClient {
|
|
|
146
201
|
});
|
|
147
202
|
}
|
|
148
203
|
markConversationRead(options) {
|
|
149
|
-
return (options.client ?? this.client).patch({ url: '/offers/conversations/{id}/read', ...options });
|
|
204
|
+
return (options.client ?? this.client).patch({ url: '/api/offers/conversations/{id}/read', ...options });
|
|
150
205
|
}
|
|
151
206
|
}
|
|
152
207
|
export class Organizations extends HeyApiClient {
|
|
153
208
|
registerClub(options) {
|
|
154
209
|
return (options.client ?? this.client).post({
|
|
155
|
-
url: '/organizations/register-club',
|
|
210
|
+
url: '/api/organizations/register-club',
|
|
156
211
|
...options,
|
|
157
212
|
headers: {
|
|
158
213
|
'Content-Type': 'application/json',
|
|
@@ -161,11 +216,11 @@ export class Organizations extends HeyApiClient {
|
|
|
161
216
|
});
|
|
162
217
|
}
|
|
163
218
|
getMyOrganization(options) {
|
|
164
|
-
return (options?.client ?? this.client).get({ url: '/organizations/me', ...options });
|
|
219
|
+
return (options?.client ?? this.client).get({ url: '/api/organizations/me', ...options });
|
|
165
220
|
}
|
|
166
221
|
updateMyOrganization(options) {
|
|
167
222
|
return (options.client ?? this.client).put({
|
|
168
|
-
url: '/organizations/me',
|
|
223
|
+
url: '/api/organizations/me',
|
|
169
224
|
...options,
|
|
170
225
|
headers: {
|
|
171
226
|
'Content-Type': 'application/json',
|
|
@@ -177,7 +232,22 @@ export class Organizations extends HeyApiClient {
|
|
|
177
232
|
export class Storage extends HeyApiClient {
|
|
178
233
|
createUploadUrl(options) {
|
|
179
234
|
return (options.client ?? this.client).post({
|
|
180
|
-
url: '/storage/upload-url',
|
|
235
|
+
url: '/api/storage/upload-url',
|
|
236
|
+
...options,
|
|
237
|
+
headers: {
|
|
238
|
+
'Content-Type': 'application/json',
|
|
239
|
+
...options.headers,
|
|
240
|
+
},
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
export class Invitations extends HeyApiClient {
|
|
245
|
+
listInvitations(options) {
|
|
246
|
+
return (options?.client ?? this.client).get({ url: '/api/invitations', ...options });
|
|
247
|
+
}
|
|
248
|
+
sendInvitation(options) {
|
|
249
|
+
return (options.client ?? this.client).post({
|
|
250
|
+
url: '/api/invitations',
|
|
181
251
|
...options,
|
|
182
252
|
headers: {
|
|
183
253
|
'Content-Type': 'application/json',
|
|
@@ -185,14 +255,46 @@ export class Storage extends HeyApiClient {
|
|
|
185
255
|
},
|
|
186
256
|
});
|
|
187
257
|
}
|
|
258
|
+
resendInvitation(options) {
|
|
259
|
+
return (options.client ?? this.client).post({ url: '/api/invitations/{id}/resend', ...options });
|
|
260
|
+
}
|
|
261
|
+
deleteInvitation(options) {
|
|
262
|
+
return (options.client ?? this.client).delete({ url: '/api/invitations/{id}', ...options });
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Called by web app after Supabase auth callback to link invitee to their organization
|
|
266
|
+
*/
|
|
267
|
+
acceptInvitation(options) {
|
|
268
|
+
return (options?.client ?? this.client).post({ url: '/api/invitations/accept', ...options });
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
export class Training extends HeyApiClient {
|
|
272
|
+
/**
|
|
273
|
+
* Get training content grouped by category, top 3 per category
|
|
274
|
+
*/
|
|
275
|
+
getTrainingGrouped(options) {
|
|
276
|
+
return (options?.client ?? this.client).get({ url: '/api/training/grouped', ...options });
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* List training content, optionally filtered by category
|
|
280
|
+
*/
|
|
281
|
+
getTrainingList(options) {
|
|
282
|
+
return (options?.client ?? this.client).get({ url: '/api/training', ...options });
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Get full detail of a training content item
|
|
286
|
+
*/
|
|
287
|
+
getTrainingById(options) {
|
|
288
|
+
return (options.client ?? this.client).get({ url: '/api/training/{id}', ...options });
|
|
289
|
+
}
|
|
188
290
|
}
|
|
189
291
|
export class Videos extends HeyApiClient {
|
|
190
292
|
getMyVideos(options) {
|
|
191
|
-
return (options.client ?? this.client).get({ url: '/videos/me', ...options });
|
|
293
|
+
return (options.client ?? this.client).get({ url: '/api/videos/me', ...options });
|
|
192
294
|
}
|
|
193
295
|
createVideo(options) {
|
|
194
296
|
return (options.client ?? this.client).post({
|
|
195
|
-
url: '/videos',
|
|
297
|
+
url: '/api/videos',
|
|
196
298
|
...options,
|
|
197
299
|
headers: {
|
|
198
300
|
'Content-Type': 'application/json',
|
|
@@ -201,10 +303,10 @@ export class Videos extends HeyApiClient {
|
|
|
201
303
|
});
|
|
202
304
|
}
|
|
203
305
|
getVideoPlayUrl(options) {
|
|
204
|
-
return (options.client ?? this.client).get({ url: '/videos/{id}/play-url', ...options });
|
|
306
|
+
return (options.client ?? this.client).get({ url: '/api/videos/{id}/play-url', ...options });
|
|
205
307
|
}
|
|
206
308
|
deleteVideo(options) {
|
|
207
|
-
return (options.client ?? this.client).delete({ url: '/videos/{id}', ...options });
|
|
309
|
+
return (options.client ?? this.client).delete({ url: '/api/videos/{id}', ...options });
|
|
208
310
|
}
|
|
209
311
|
}
|
|
210
312
|
export class GlobalScoutMeClient extends HeyApiClient {
|
|
@@ -227,6 +329,12 @@ export class GlobalScoutMeClient extends HeyApiClient {
|
|
|
227
329
|
get body() {
|
|
228
330
|
return (this._body ?? (this._body = new Body({ client: this.client })));
|
|
229
331
|
}
|
|
332
|
+
get challenges() {
|
|
333
|
+
return (this._challenges ?? (this._challenges = new Challenges({ client: this.client })));
|
|
334
|
+
}
|
|
335
|
+
get clubs() {
|
|
336
|
+
return (this._clubs ?? (this._clubs = new Clubs({ client: this.client })));
|
|
337
|
+
}
|
|
230
338
|
get documents() {
|
|
231
339
|
return (this._documents ?? (this._documents = new Documents({ client: this.client })));
|
|
232
340
|
}
|
|
@@ -242,6 +350,12 @@ export class GlobalScoutMeClient extends HeyApiClient {
|
|
|
242
350
|
get storage() {
|
|
243
351
|
return (this._storage ?? (this._storage = new Storage({ client: this.client })));
|
|
244
352
|
}
|
|
353
|
+
get invitations() {
|
|
354
|
+
return (this._invitations ?? (this._invitations = new Invitations({ client: this.client })));
|
|
355
|
+
}
|
|
356
|
+
get training() {
|
|
357
|
+
return (this._training ?? (this._training = new Training({ client: this.client })));
|
|
358
|
+
}
|
|
245
359
|
get videos() {
|
|
246
360
|
return (this._videos ?? (this._videos = new Videos({ client: this.client })));
|
|
247
361
|
}
|