@nativesquare/soma 0.9.4 → 0.10.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.
Files changed (203) hide show
  1. package/dist/client/index.d.ts +124 -144
  2. package/dist/client/index.d.ts.map +1 -1
  3. package/dist/client/index.js +157 -134
  4. package/dist/client/index.js.map +1 -1
  5. package/dist/component/_generated/api.d.ts +18 -0
  6. package/dist/component/_generated/api.d.ts.map +1 -1
  7. package/dist/component/_generated/api.js.map +1 -1
  8. package/dist/component/_generated/component.d.ts +113 -22
  9. package/dist/component/_generated/component.d.ts.map +1 -1
  10. package/dist/component/garmin/auth.d.ts +0 -4
  11. package/dist/component/garmin/auth.d.ts.map +1 -1
  12. package/dist/component/garmin/auth.js +0 -8
  13. package/dist/component/garmin/auth.js.map +1 -1
  14. package/dist/component/garmin/private.d.ts +10 -1
  15. package/dist/component/garmin/private.d.ts.map +1 -1
  16. package/dist/component/garmin/private.js +49 -9
  17. package/dist/component/garmin/private.js.map +1 -1
  18. package/dist/component/garmin/public.d.ts +237 -62
  19. package/dist/component/garmin/public.d.ts.map +1 -1
  20. package/dist/component/garmin/public.js +689 -254
  21. package/dist/component/garmin/public.js.map +1 -1
  22. package/dist/component/garmin/utils.d.ts +8 -0
  23. package/dist/component/garmin/utils.d.ts.map +1 -1
  24. package/dist/component/garmin/utils.js +9 -0
  25. package/dist/component/garmin/utils.js.map +1 -1
  26. package/dist/component/schema.d.ts +2 -2
  27. package/dist/component/schema.d.ts.map +1 -1
  28. package/dist/component/schema.js +5 -3
  29. package/dist/component/schema.js.map +1 -1
  30. package/dist/{strava → component/strava}/auth.d.ts +15 -48
  31. package/dist/component/strava/auth.d.ts.map +1 -0
  32. package/dist/{strava → component/strava}/auth.js +4 -39
  33. package/dist/component/strava/auth.js.map +1 -0
  34. package/dist/component/strava/client.d.ts +8 -0
  35. package/dist/component/strava/client.d.ts.map +1 -0
  36. package/dist/component/strava/client.js +18 -0
  37. package/dist/component/strava/client.js.map +1 -0
  38. package/dist/component/strava/private.d.ts +19 -0
  39. package/dist/component/strava/private.d.ts.map +1 -1
  40. package/dist/component/strava/private.js +52 -2
  41. package/dist/component/strava/private.js.map +1 -1
  42. package/dist/component/strava/public.d.ts +54 -19
  43. package/dist/component/strava/public.d.ts.map +1 -1
  44. package/dist/component/strava/public.js +159 -109
  45. package/dist/component/strava/public.js.map +1 -1
  46. package/dist/component/strava/transform/activity.d.ts +19 -0
  47. package/dist/component/strava/transform/activity.d.ts.map +1 -0
  48. package/dist/{strava → component/strava/transform}/activity.js +31 -45
  49. package/dist/component/strava/transform/activity.js.map +1 -0
  50. package/dist/{strava → component/strava/transform}/athlete.d.ts +4 -10
  51. package/dist/component/strava/transform/athlete.d.ts.map +1 -0
  52. package/dist/{strava → component/strava/transform}/athlete.js +2 -8
  53. package/dist/component/strava/transform/athlete.js.map +1 -0
  54. package/dist/component/strava/transform/maps/sportType.d.ts +7 -0
  55. package/dist/component/strava/transform/maps/sportType.d.ts.map +1 -0
  56. package/dist/{strava/maps/sport-type.js → component/strava/transform/maps/sportType.js} +4 -2
  57. package/dist/component/strava/transform/maps/sportType.js.map +1 -0
  58. package/dist/component/strava/types/stravaApi/client/client.gen.d.ts +3 -0
  59. package/dist/component/strava/types/stravaApi/client/client.gen.d.ts.map +1 -0
  60. package/dist/component/strava/types/stravaApi/client/client.gen.js +236 -0
  61. package/dist/component/strava/types/stravaApi/client/client.gen.js.map +1 -0
  62. package/dist/component/strava/types/stravaApi/client/index.d.ts +9 -0
  63. package/dist/component/strava/types/stravaApi/client/index.d.ts.map +1 -0
  64. package/dist/component/strava/types/stravaApi/client/index.js +7 -0
  65. package/dist/component/strava/types/stravaApi/client/index.js.map +1 -0
  66. package/dist/component/strava/types/stravaApi/client/types.gen.d.ts +118 -0
  67. package/dist/component/strava/types/stravaApi/client/types.gen.d.ts.map +1 -0
  68. package/dist/component/strava/types/stravaApi/client/types.gen.js +3 -0
  69. package/dist/component/strava/types/stravaApi/client/types.gen.js.map +1 -0
  70. package/dist/component/strava/types/stravaApi/client/utils.gen.d.ts +34 -0
  71. package/dist/component/strava/types/stravaApi/client/utils.gen.d.ts.map +1 -0
  72. package/dist/component/strava/types/stravaApi/client/utils.gen.js +229 -0
  73. package/dist/component/strava/types/stravaApi/client/utils.gen.js.map +1 -0
  74. package/dist/component/strava/types/stravaApi/client.gen.d.ts +13 -0
  75. package/dist/component/strava/types/stravaApi/client.gen.d.ts.map +1 -0
  76. package/dist/component/strava/types/stravaApi/client.gen.js +4 -0
  77. package/dist/component/strava/types/stravaApi/client.gen.js.map +1 -0
  78. package/dist/component/strava/types/stravaApi/core/auth.gen.d.ts +19 -0
  79. package/dist/component/strava/types/stravaApi/core/auth.gen.d.ts.map +1 -0
  80. package/dist/component/strava/types/stravaApi/core/auth.gen.js +15 -0
  81. package/dist/component/strava/types/stravaApi/core/auth.gen.js.map +1 -0
  82. package/dist/component/strava/types/stravaApi/core/bodySerializer.gen.d.ts +26 -0
  83. package/dist/component/strava/types/stravaApi/core/bodySerializer.gen.d.ts.map +1 -0
  84. package/dist/component/strava/types/stravaApi/core/bodySerializer.gen.js +58 -0
  85. package/dist/component/strava/types/stravaApi/core/bodySerializer.gen.js.map +1 -0
  86. package/dist/component/strava/types/stravaApi/core/params.gen.d.ts +44 -0
  87. package/dist/component/strava/types/stravaApi/core/params.gen.d.ts.map +1 -0
  88. package/dist/component/strava/types/stravaApi/core/params.gen.js +101 -0
  89. package/dist/component/strava/types/stravaApi/core/params.gen.js.map +1 -0
  90. package/dist/component/strava/types/stravaApi/core/pathSerializer.gen.d.ts +34 -0
  91. package/dist/component/strava/types/stravaApi/core/pathSerializer.gen.d.ts.map +1 -0
  92. package/dist/component/strava/types/stravaApi/core/pathSerializer.gen.js +107 -0
  93. package/dist/component/strava/types/stravaApi/core/pathSerializer.gen.js.map +1 -0
  94. package/dist/component/strava/types/stravaApi/core/queryKeySerializer.gen.d.ts +19 -0
  95. package/dist/component/strava/types/stravaApi/core/queryKeySerializer.gen.d.ts.map +1 -0
  96. package/dist/component/strava/types/stravaApi/core/queryKeySerializer.gen.js +93 -0
  97. package/dist/component/strava/types/stravaApi/core/queryKeySerializer.gen.js.map +1 -0
  98. package/dist/component/strava/types/stravaApi/core/serverSentEvents.gen.d.ts +72 -0
  99. package/dist/component/strava/types/stravaApi/core/serverSentEvents.gen.d.ts.map +1 -0
  100. package/dist/component/strava/types/stravaApi/core/serverSentEvents.gen.js +134 -0
  101. package/dist/component/strava/types/stravaApi/core/serverSentEvents.gen.js.map +1 -0
  102. package/dist/component/strava/types/stravaApi/core/types.gen.d.ts +79 -0
  103. package/dist/component/strava/types/stravaApi/core/types.gen.d.ts.map +1 -0
  104. package/dist/component/strava/types/stravaApi/core/types.gen.js +3 -0
  105. package/dist/component/strava/types/stravaApi/core/types.gen.js.map +1 -0
  106. package/dist/component/strava/types/stravaApi/core/utils.gen.d.ts +20 -0
  107. package/dist/component/strava/types/stravaApi/core/utils.gen.d.ts.map +1 -0
  108. package/dist/component/strava/types/stravaApi/core/utils.gen.js +88 -0
  109. package/dist/component/strava/types/stravaApi/core/utils.gen.js.map +1 -0
  110. package/dist/component/strava/types/stravaApi/index.d.ts +3 -0
  111. package/dist/component/strava/types/stravaApi/index.d.ts.map +1 -0
  112. package/dist/component/strava/types/stravaApi/index.js +3 -0
  113. package/dist/component/strava/types/stravaApi/index.js.map +1 -0
  114. package/dist/component/strava/types/stravaApi/sdk.gen.d.ts +224 -0
  115. package/dist/component/strava/types/stravaApi/sdk.gen.d.ts.map +1 -0
  116. package/dist/component/strava/types/stravaApi/sdk.gen.js +361 -0
  117. package/dist/component/strava/types/stravaApi/sdk.gen.js.map +1 -0
  118. package/dist/component/strava/types/stravaApi/types.gen.d.ts +2209 -0
  119. package/dist/component/strava/types/stravaApi/types.gen.d.ts.map +1 -0
  120. package/dist/component/strava/types/stravaApi/types.gen.js +3 -0
  121. package/dist/component/strava/types/stravaApi/types.gen.js.map +1 -0
  122. package/dist/component/strava/types/stravaApi/zod.gen.d.ts +5332 -0
  123. package/dist/component/strava/types/stravaApi/zod.gen.d.ts.map +1 -0
  124. package/dist/component/strava/types/stravaApi/zod.gen.js +1009 -0
  125. package/dist/component/strava/types/stravaApi/zod.gen.js.map +1 -0
  126. package/dist/component/strava/utils.d.ts +15 -0
  127. package/dist/component/strava/utils.d.ts.map +1 -0
  128. package/dist/component/strava/utils.js +36 -0
  129. package/dist/component/strava/utils.js.map +1 -0
  130. package/dist/component/utils.d.ts +5 -0
  131. package/dist/component/utils.d.ts.map +1 -0
  132. package/dist/component/utils.js +11 -0
  133. package/dist/component/utils.js.map +1 -0
  134. package/package.json +131 -130
  135. package/src/client/index.ts +285 -164
  136. package/src/component/_generated/api.ts +18 -0
  137. package/src/component/_generated/component.ts +191 -24
  138. package/src/component/garmin/auth.ts +0 -9
  139. package/src/component/garmin/private.ts +84 -12
  140. package/src/component/garmin/public.ts +812 -348
  141. package/src/component/garmin/utils.ts +17 -0
  142. package/src/component/schema.ts +5 -3
  143. package/src/{strava → component/strava}/auth.ts +143 -185
  144. package/src/component/strava/client.ts +20 -0
  145. package/src/component/strava/private.ts +147 -89
  146. package/src/component/strava/public.ts +191 -139
  147. package/src/{strava → component/strava/transform}/activity.ts +256 -276
  148. package/src/{strava → component/strava/transform}/athlete.ts +41 -47
  149. package/src/{strava/maps/sport-type.ts → component/strava/transform/maps/sportType.ts} +100 -99
  150. package/src/component/strava/types/specs/strava-api.json +4796 -0
  151. package/src/component/strava/types/stravaApi/client/client.gen.ts +290 -0
  152. package/src/component/strava/types/stravaApi/client/index.ts +25 -0
  153. package/src/component/strava/types/stravaApi/client/types.gen.ts +214 -0
  154. package/src/component/strava/types/stravaApi/client/utils.gen.ts +316 -0
  155. package/src/component/strava/types/stravaApi/client.gen.ts +16 -0
  156. package/src/component/strava/types/stravaApi/core/auth.gen.ts +41 -0
  157. package/src/component/strava/types/stravaApi/core/bodySerializer.gen.ts +82 -0
  158. package/src/component/strava/types/stravaApi/core/params.gen.ts +169 -0
  159. package/src/component/strava/types/stravaApi/core/pathSerializer.gen.ts +171 -0
  160. package/src/component/strava/types/stravaApi/core/queryKeySerializer.gen.ts +117 -0
  161. package/src/component/strava/types/stravaApi/core/serverSentEvents.gen.ts +243 -0
  162. package/src/component/strava/types/stravaApi/core/types.gen.ts +104 -0
  163. package/src/component/strava/types/stravaApi/core/utils.gen.ts +140 -0
  164. package/src/component/strava/types/stravaApi/index.ts +4 -0
  165. package/src/component/strava/types/stravaApi/sdk.gen.ts +410 -0
  166. package/src/component/strava/types/stravaApi/types.gen.ts +2435 -0
  167. package/src/component/strava/types/stravaApi/zod.gen.ts +1132 -0
  168. package/src/component/strava/utils.ts +52 -0
  169. package/src/component/utils.ts +11 -0
  170. package/dist/strava/activity.d.ts +0 -121
  171. package/dist/strava/activity.d.ts.map +0 -1
  172. package/dist/strava/activity.js.map +0 -1
  173. package/dist/strava/athlete.d.ts.map +0 -1
  174. package/dist/strava/athlete.js.map +0 -1
  175. package/dist/strava/auth.d.ts.map +0 -1
  176. package/dist/strava/auth.js.map +0 -1
  177. package/dist/strava/client.d.ts +0 -93
  178. package/dist/strava/client.d.ts.map +0 -1
  179. package/dist/strava/client.js +0 -158
  180. package/dist/strava/client.js.map +0 -1
  181. package/dist/strava/index.d.ts +0 -13
  182. package/dist/strava/index.d.ts.map +0 -1
  183. package/dist/strava/index.js +0 -17
  184. package/dist/strava/index.js.map +0 -1
  185. package/dist/strava/maps/sport-type.d.ts +0 -7
  186. package/dist/strava/maps/sport-type.d.ts.map +0 -1
  187. package/dist/strava/maps/sport-type.js.map +0 -1
  188. package/dist/strava/sync.d.ts +0 -104
  189. package/dist/strava/sync.d.ts.map +0 -1
  190. package/dist/strava/sync.js +0 -87
  191. package/dist/strava/sync.js.map +0 -1
  192. package/dist/strava/types.d.ts +0 -266
  193. package/dist/strava/types.d.ts.map +0 -1
  194. package/dist/strava/types.js +0 -8
  195. package/dist/strava/types.js.map +0 -1
  196. package/src/strava/activity.test.ts +0 -415
  197. package/src/strava/athlete.test.ts +0 -139
  198. package/src/strava/auth.test.ts +0 -78
  199. package/src/strava/client.ts +0 -212
  200. package/src/strava/index.ts +0 -54
  201. package/src/strava/maps/sport-type.test.ts +0 -69
  202. package/src/strava/sync.ts +0 -168
  203. package/src/strava/types.ts +0 -361
@@ -0,0 +1,140 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+
3
+ import type { BodySerializer, QuerySerializer } from './bodySerializer.gen';
4
+ import {
5
+ type ArraySeparatorStyle,
6
+ serializeArrayParam,
7
+ serializeObjectParam,
8
+ serializePrimitiveParam,
9
+ } from './pathSerializer.gen';
10
+
11
+ export interface PathSerializer {
12
+ path: Record<string, unknown>;
13
+ url: string;
14
+ }
15
+
16
+ export const PATH_PARAM_RE = /\{[^{}]+\}/g;
17
+
18
+ export const defaultPathSerializer = ({ path, url: _url }: PathSerializer) => {
19
+ let url = _url;
20
+ const matches = _url.match(PATH_PARAM_RE);
21
+ if (matches) {
22
+ for (const match of matches) {
23
+ let explode = false;
24
+ let name = match.substring(1, match.length - 1);
25
+ let style: ArraySeparatorStyle = 'simple';
26
+
27
+ if (name.endsWith('*')) {
28
+ explode = true;
29
+ name = name.substring(0, name.length - 1);
30
+ }
31
+
32
+ if (name.startsWith('.')) {
33
+ name = name.substring(1);
34
+ style = 'label';
35
+ } else if (name.startsWith(';')) {
36
+ name = name.substring(1);
37
+ style = 'matrix';
38
+ }
39
+
40
+ const value = path[name];
41
+
42
+ if (value === undefined || value === null) {
43
+ continue;
44
+ }
45
+
46
+ if (Array.isArray(value)) {
47
+ url = url.replace(match, serializeArrayParam({ explode, name, style, value }));
48
+ continue;
49
+ }
50
+
51
+ if (typeof value === 'object') {
52
+ url = url.replace(
53
+ match,
54
+ serializeObjectParam({
55
+ explode,
56
+ name,
57
+ style,
58
+ value: value as Record<string, unknown>,
59
+ valueOnly: true,
60
+ }),
61
+ );
62
+ continue;
63
+ }
64
+
65
+ if (style === 'matrix') {
66
+ url = url.replace(
67
+ match,
68
+ `;${serializePrimitiveParam({
69
+ name,
70
+ value: value as string,
71
+ })}`,
72
+ );
73
+ continue;
74
+ }
75
+
76
+ const replaceValue = encodeURIComponent(
77
+ style === 'label' ? `.${value as string}` : (value as string),
78
+ );
79
+ url = url.replace(match, replaceValue);
80
+ }
81
+ }
82
+ return url;
83
+ };
84
+
85
+ export const getUrl = ({
86
+ baseUrl,
87
+ path,
88
+ query,
89
+ querySerializer,
90
+ url: _url,
91
+ }: {
92
+ baseUrl?: string;
93
+ path?: Record<string, unknown>;
94
+ query?: Record<string, unknown>;
95
+ querySerializer: QuerySerializer;
96
+ url: string;
97
+ }) => {
98
+ const pathUrl = _url.startsWith('/') ? _url : `/${_url}`;
99
+ let url = (baseUrl ?? '') + pathUrl;
100
+ if (path) {
101
+ url = defaultPathSerializer({ path, url });
102
+ }
103
+ let search = query ? querySerializer(query) : '';
104
+ if (search.startsWith('?')) {
105
+ search = search.substring(1);
106
+ }
107
+ if (search) {
108
+ url += `?${search}`;
109
+ }
110
+ return url;
111
+ };
112
+
113
+ export function getValidRequestBody(options: {
114
+ body?: unknown;
115
+ bodySerializer?: BodySerializer | null;
116
+ serializedBody?: unknown;
117
+ }) {
118
+ const hasBody = options.body !== undefined;
119
+ const isSerializedBody = hasBody && options.bodySerializer;
120
+
121
+ if (isSerializedBody) {
122
+ if ('serializedBody' in options) {
123
+ const hasSerializedBody =
124
+ options.serializedBody !== undefined && options.serializedBody !== '';
125
+
126
+ return hasSerializedBody ? options.serializedBody : null;
127
+ }
128
+
129
+ // not all clients implement a serializedBody property (i.e., client-axios)
130
+ return options.body !== '' ? options.body : null;
131
+ }
132
+
133
+ // plain/text body
134
+ if (hasBody) {
135
+ return options.body;
136
+ }
137
+
138
+ // no body was provided
139
+ return undefined;
140
+ }
@@ -0,0 +1,4 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+
3
+ export { createActivity, createUpload, exploreSegments, getActivityById, getActivityStreams, getClubActivitiesById, getClubAdminsById, getClubById, getClubMembersById, getCommentsByActivityId, getEffortsBySegmentId, getGearById, getKudoersByActivityId, getLapsByActivityId, getLoggedInAthlete, getLoggedInAthleteActivities, getLoggedInAthleteClubs, getLoggedInAthleteStarredSegments, getLoggedInAthleteZones, getRouteAsGpx, getRouteAsTcx, getRouteById, getRoutesByAthleteId, getRouteStreams, getSegmentById, getSegmentEffortById, getSegmentEffortStreams, getSegmentStreams, getStats, getUploadById, getZonesByActivityId, type Options, starSegment, updateActivityById, updateLoggedInAthlete } from './sdk.gen';
4
+ export type { ActivityStats, ActivityTotal, ActivityType, ActivityZone, AltitudeStream, BaseStream, CadenceStream, ClientOptions, ClubActivity, ClubAthlete, Comment, CreateActivityData, CreateActivityError, CreateActivityErrors, CreateActivityResponse, CreateActivityResponses, CreateUploadData, CreateUploadError, CreateUploadErrors, CreateUploadResponse, CreateUploadResponses, DetailedActivity, DetailedAthlete, DetailedClub, DetailedGear, DetailedSegment, DetailedSegmentEffort, DistanceStream, Error, ExplorerResponse, ExplorerSegment, ExploreSegmentsData, ExploreSegmentsError, ExploreSegmentsErrors, ExploreSegmentsResponse, ExploreSegmentsResponses, Fault, GetActivityByIdData, GetActivityByIdError, GetActivityByIdErrors, GetActivityByIdResponse, GetActivityByIdResponses, GetActivityStreamsData, GetActivityStreamsError, GetActivityStreamsErrors, GetActivityStreamsResponse, GetActivityStreamsResponses, GetClubActivitiesByIdData, GetClubActivitiesByIdError, GetClubActivitiesByIdErrors, GetClubActivitiesByIdResponse, GetClubActivitiesByIdResponses, GetClubAdminsByIdData, GetClubAdminsByIdError, GetClubAdminsByIdErrors, GetClubAdminsByIdResponse, GetClubAdminsByIdResponses, GetClubByIdData, GetClubByIdError, GetClubByIdErrors, GetClubByIdResponse, GetClubByIdResponses, GetClubMembersByIdData, GetClubMembersByIdError, GetClubMembersByIdErrors, GetClubMembersByIdResponse, GetClubMembersByIdResponses, GetCommentsByActivityIdData, GetCommentsByActivityIdError, GetCommentsByActivityIdErrors, GetCommentsByActivityIdResponse, GetCommentsByActivityIdResponses, GetEffortsBySegmentIdData, GetEffortsBySegmentIdError, GetEffortsBySegmentIdErrors, GetEffortsBySegmentIdResponse, GetEffortsBySegmentIdResponses, GetGearByIdData, GetGearByIdError, GetGearByIdErrors, GetGearByIdResponse, GetGearByIdResponses, GetKudoersByActivityIdData, GetKudoersByActivityIdError, GetKudoersByActivityIdErrors, GetKudoersByActivityIdResponse, GetKudoersByActivityIdResponses, GetLapsByActivityIdData, GetLapsByActivityIdError, GetLapsByActivityIdErrors, GetLapsByActivityIdResponse, GetLapsByActivityIdResponses, GetLoggedInAthleteActivitiesData, GetLoggedInAthleteActivitiesError, GetLoggedInAthleteActivitiesErrors, GetLoggedInAthleteActivitiesResponse, GetLoggedInAthleteActivitiesResponses, GetLoggedInAthleteClubsData, GetLoggedInAthleteClubsError, GetLoggedInAthleteClubsErrors, GetLoggedInAthleteClubsResponse, GetLoggedInAthleteClubsResponses, GetLoggedInAthleteData, GetLoggedInAthleteError, GetLoggedInAthleteErrors, GetLoggedInAthleteResponse, GetLoggedInAthleteResponses, GetLoggedInAthleteStarredSegmentsData, GetLoggedInAthleteStarredSegmentsError, GetLoggedInAthleteStarredSegmentsErrors, GetLoggedInAthleteStarredSegmentsResponse, GetLoggedInAthleteStarredSegmentsResponses, GetLoggedInAthleteZonesData, GetLoggedInAthleteZonesError, GetLoggedInAthleteZonesErrors, GetLoggedInAthleteZonesResponse, GetLoggedInAthleteZonesResponses, GetRouteAsGpxData, GetRouteAsGpxError, GetRouteAsGpxErrors, GetRouteAsGpxResponses, GetRouteAsTcxData, GetRouteAsTcxError, GetRouteAsTcxErrors, GetRouteAsTcxResponses, GetRouteByIdData, GetRouteByIdError, GetRouteByIdErrors, GetRouteByIdResponse, GetRouteByIdResponses, GetRoutesByAthleteIdData, GetRoutesByAthleteIdError, GetRoutesByAthleteIdErrors, GetRoutesByAthleteIdResponse, GetRoutesByAthleteIdResponses, GetRouteStreamsData, GetRouteStreamsError, GetRouteStreamsErrors, GetRouteStreamsResponse, GetRouteStreamsResponses, GetSegmentByIdData, GetSegmentByIdError, GetSegmentByIdErrors, GetSegmentByIdResponse, GetSegmentByIdResponses, GetSegmentEffortByIdData, GetSegmentEffortByIdError, GetSegmentEffortByIdErrors, GetSegmentEffortByIdResponse, GetSegmentEffortByIdResponses, GetSegmentEffortStreamsData, GetSegmentEffortStreamsError, GetSegmentEffortStreamsErrors, GetSegmentEffortStreamsResponse, GetSegmentEffortStreamsResponses, GetSegmentStreamsData, GetSegmentStreamsError, GetSegmentStreamsErrors, GetSegmentStreamsResponse, GetSegmentStreamsResponses, GetStatsData, GetStatsError, GetStatsErrors, GetStatsResponse, GetStatsResponses, GetUploadByIdData, GetUploadByIdError, GetUploadByIdErrors, GetUploadByIdResponse, GetUploadByIdResponses, GetZonesByActivityIdData, GetZonesByActivityIdError, GetZonesByActivityIdErrors, GetZonesByActivityIdResponse, GetZonesByActivityIdResponses, HeartrateStream, HeartRateZoneRanges, Lap, LatLng, LatLngStream, MetaActivity, MetaAthlete, MetaClub, MovingStream, PhotosSummary, PolylineMap, PowerStream, PowerZoneRanges, Route, SmoothGradeStream, SmoothVelocityStream, Split, SportType, StarSegmentData, StarSegmentError, StarSegmentErrors, StarSegmentResponse, StarSegmentResponses, StreamSet, SummaryActivity, SummaryAthlete, SummaryClub, SummaryGear, SummaryPrSegmentEffort, SummarySegment, SummarySegmentEffort, TemperatureStream, TimedZoneDistribution, TimedZoneRange, TimeStream, UpdatableActivity, UpdateActivityByIdData, UpdateActivityByIdError, UpdateActivityByIdErrors, UpdateActivityByIdResponse, UpdateActivityByIdResponses, UpdateLoggedInAthleteData, UpdateLoggedInAthleteError, UpdateLoggedInAthleteErrors, UpdateLoggedInAthleteResponse, UpdateLoggedInAthleteResponses, Upload, Waypoint, ZoneRange, ZoneRanges, Zones } from './types.gen';
@@ -0,0 +1,410 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+
3
+ import { type Client, formDataBodySerializer, type Options as Options2, type TDataShape } from './client';
4
+ import { client } from './client.gen';
5
+ import type { CreateActivityData, CreateActivityErrors, CreateActivityResponses, CreateUploadData, CreateUploadErrors, CreateUploadResponses, ExploreSegmentsData, ExploreSegmentsErrors, ExploreSegmentsResponses, GetActivityByIdData, GetActivityByIdErrors, GetActivityByIdResponses, GetActivityStreamsData, GetActivityStreamsErrors, GetActivityStreamsResponses, GetClubActivitiesByIdData, GetClubActivitiesByIdErrors, GetClubActivitiesByIdResponses, GetClubAdminsByIdData, GetClubAdminsByIdErrors, GetClubAdminsByIdResponses, GetClubByIdData, GetClubByIdErrors, GetClubByIdResponses, GetClubMembersByIdData, GetClubMembersByIdErrors, GetClubMembersByIdResponses, GetCommentsByActivityIdData, GetCommentsByActivityIdErrors, GetCommentsByActivityIdResponses, GetEffortsBySegmentIdData, GetEffortsBySegmentIdErrors, GetEffortsBySegmentIdResponses, GetGearByIdData, GetGearByIdErrors, GetGearByIdResponses, GetKudoersByActivityIdData, GetKudoersByActivityIdErrors, GetKudoersByActivityIdResponses, GetLapsByActivityIdData, GetLapsByActivityIdErrors, GetLapsByActivityIdResponses, GetLoggedInAthleteActivitiesData, GetLoggedInAthleteActivitiesErrors, GetLoggedInAthleteActivitiesResponses, GetLoggedInAthleteClubsData, GetLoggedInAthleteClubsErrors, GetLoggedInAthleteClubsResponses, GetLoggedInAthleteData, GetLoggedInAthleteErrors, GetLoggedInAthleteResponses, GetLoggedInAthleteStarredSegmentsData, GetLoggedInAthleteStarredSegmentsErrors, GetLoggedInAthleteStarredSegmentsResponses, GetLoggedInAthleteZonesData, GetLoggedInAthleteZonesErrors, GetLoggedInAthleteZonesResponses, GetRouteAsGpxData, GetRouteAsGpxErrors, GetRouteAsGpxResponses, GetRouteAsTcxData, GetRouteAsTcxErrors, GetRouteAsTcxResponses, GetRouteByIdData, GetRouteByIdErrors, GetRouteByIdResponses, GetRoutesByAthleteIdData, GetRoutesByAthleteIdErrors, GetRoutesByAthleteIdResponses, GetRouteStreamsData, GetRouteStreamsErrors, GetRouteStreamsResponses, GetSegmentByIdData, GetSegmentByIdErrors, GetSegmentByIdResponses, GetSegmentEffortByIdData, GetSegmentEffortByIdErrors, GetSegmentEffortByIdResponses, GetSegmentEffortStreamsData, GetSegmentEffortStreamsErrors, GetSegmentEffortStreamsResponses, GetSegmentStreamsData, GetSegmentStreamsErrors, GetSegmentStreamsResponses, GetStatsData, GetStatsErrors, GetStatsResponses, GetUploadByIdData, GetUploadByIdErrors, GetUploadByIdResponses, GetZonesByActivityIdData, GetZonesByActivityIdErrors, GetZonesByActivityIdResponses, StarSegmentData, StarSegmentErrors, StarSegmentResponses, UpdateActivityByIdData, UpdateActivityByIdErrors, UpdateActivityByIdResponses, UpdateLoggedInAthleteData, UpdateLoggedInAthleteErrors, UpdateLoggedInAthleteResponses } from './types.gen';
6
+
7
+ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<TData, ThrowOnError> & {
8
+ /**
9
+ * You can provide a client instance returned by `createClient()` instead of
10
+ * individual options. This might be also useful if you want to implement a
11
+ * custom client.
12
+ */
13
+ client?: Client;
14
+ /**
15
+ * You can pass arbitrary values through the `meta` object. This can be
16
+ * used to access values that aren't defined as part of the SDK function.
17
+ */
18
+ meta?: Record<string, unknown>;
19
+ };
20
+
21
+ /**
22
+ * Get Athlete Stats
23
+ *
24
+ * Returns the activity stats of an athlete. Only includes data from activities set to Everyone visibilty.
25
+ */
26
+ export const getStats = <ThrowOnError extends boolean = false>(options: Options<GetStatsData, ThrowOnError>) => (options.client ?? client).get<GetStatsResponses, GetStatsErrors, ThrowOnError>({
27
+ security: [{ scheme: 'bearer', type: 'http' }],
28
+ url: '/athletes/{id}/stats',
29
+ ...options
30
+ });
31
+
32
+ /**
33
+ * Get Authenticated Athlete
34
+ *
35
+ * Returns the currently authenticated athlete. Tokens with profile:read_all scope will receive a detailed athlete representation; all others will receive a summary representation.
36
+ */
37
+ export const getLoggedInAthlete = <ThrowOnError extends boolean = false>(options?: Options<GetLoggedInAthleteData, ThrowOnError>) => (options?.client ?? client).get<GetLoggedInAthleteResponses, GetLoggedInAthleteErrors, ThrowOnError>({
38
+ security: [{ scheme: 'bearer', type: 'http' }],
39
+ url: '/athlete',
40
+ ...options
41
+ });
42
+
43
+ /**
44
+ * Update Athlete
45
+ *
46
+ * Update the currently authenticated athlete. Requires profile:write scope.
47
+ */
48
+ export const updateLoggedInAthlete = <ThrowOnError extends boolean = false>(options: Options<UpdateLoggedInAthleteData, ThrowOnError>) => (options.client ?? client).put<UpdateLoggedInAthleteResponses, UpdateLoggedInAthleteErrors, ThrowOnError>({
49
+ security: [{ scheme: 'bearer', type: 'http' }],
50
+ url: '/athlete',
51
+ ...options
52
+ });
53
+
54
+ /**
55
+ * Get Zones
56
+ *
57
+ * Returns the the authenticated athlete's heart rate and power zones. Requires profile:read_all.
58
+ */
59
+ export const getLoggedInAthleteZones = <ThrowOnError extends boolean = false>(options?: Options<GetLoggedInAthleteZonesData, ThrowOnError>) => (options?.client ?? client).get<GetLoggedInAthleteZonesResponses, GetLoggedInAthleteZonesErrors, ThrowOnError>({
60
+ security: [{ scheme: 'bearer', type: 'http' }],
61
+ url: '/athlete/zones',
62
+ ...options
63
+ });
64
+
65
+ /**
66
+ * Get Segment
67
+ *
68
+ * Returns the specified segment. read_all scope required in order to retrieve athlete-specific segment information, or to retrieve private segments.
69
+ */
70
+ export const getSegmentById = <ThrowOnError extends boolean = false>(options: Options<GetSegmentByIdData, ThrowOnError>) => (options.client ?? client).get<GetSegmentByIdResponses, GetSegmentByIdErrors, ThrowOnError>({
71
+ security: [{ scheme: 'bearer', type: 'http' }],
72
+ url: '/segments/{id}',
73
+ ...options
74
+ });
75
+
76
+ /**
77
+ * List Starred Segments
78
+ *
79
+ * List of the authenticated athlete's starred segments. Private segments are filtered out unless requested by a token with read_all scope.
80
+ */
81
+ export const getLoggedInAthleteStarredSegments = <ThrowOnError extends boolean = false>(options?: Options<GetLoggedInAthleteStarredSegmentsData, ThrowOnError>) => (options?.client ?? client).get<GetLoggedInAthleteStarredSegmentsResponses, GetLoggedInAthleteStarredSegmentsErrors, ThrowOnError>({
82
+ security: [{ scheme: 'bearer', type: 'http' }],
83
+ url: '/segments/starred',
84
+ ...options
85
+ });
86
+
87
+ /**
88
+ * Star Segment
89
+ *
90
+ * Stars/Unstars the given segment for the authenticated athlete. Requires profile:write scope.
91
+ */
92
+ export const starSegment = <ThrowOnError extends boolean = false>(options: Options<StarSegmentData, ThrowOnError>) => (options.client ?? client).put<StarSegmentResponses, StarSegmentErrors, ThrowOnError>({
93
+ security: [{ scheme: 'bearer', type: 'http' }],
94
+ url: '/segments/{id}/starred',
95
+ ...options
96
+ });
97
+
98
+ /**
99
+ * List Segment Efforts
100
+ *
101
+ * Returns a set of the authenticated athlete's segment efforts for a given segment. Requires subscription.
102
+ */
103
+ export const getEffortsBySegmentId = <ThrowOnError extends boolean = false>(options: Options<GetEffortsBySegmentIdData, ThrowOnError>) => (options.client ?? client).get<GetEffortsBySegmentIdResponses, GetEffortsBySegmentIdErrors, ThrowOnError>({
104
+ security: [{ scheme: 'bearer', type: 'http' }],
105
+ url: '/segment_efforts',
106
+ ...options
107
+ });
108
+
109
+ /**
110
+ * Explore segments
111
+ *
112
+ * Returns the top 10 segments matching a specified query.
113
+ */
114
+ export const exploreSegments = <ThrowOnError extends boolean = false>(options: Options<ExploreSegmentsData, ThrowOnError>) => (options.client ?? client).get<ExploreSegmentsResponses, ExploreSegmentsErrors, ThrowOnError>({
115
+ querySerializer: { parameters: { bounds: { array: { explode: false } } } },
116
+ security: [{ scheme: 'bearer', type: 'http' }],
117
+ url: '/segments/explore',
118
+ ...options
119
+ });
120
+
121
+ /**
122
+ * Get Segment Effort
123
+ *
124
+ * Returns a segment effort from an activity that is owned by the authenticated athlete. Requires subscription.
125
+ */
126
+ export const getSegmentEffortById = <ThrowOnError extends boolean = false>(options: Options<GetSegmentEffortByIdData, ThrowOnError>) => (options.client ?? client).get<GetSegmentEffortByIdResponses, GetSegmentEffortByIdErrors, ThrowOnError>({
127
+ security: [{ scheme: 'bearer', type: 'http' }],
128
+ url: '/segment_efforts/{id}',
129
+ ...options
130
+ });
131
+
132
+ /**
133
+ * Create an Activity
134
+ *
135
+ * Creates a manual activity for an athlete, requires activity:write scope.
136
+ */
137
+ export const createActivity = <ThrowOnError extends boolean = false>(options?: Options<CreateActivityData, ThrowOnError>) => (options?.client ?? client).post<CreateActivityResponses, CreateActivityErrors, ThrowOnError>({
138
+ security: [{ scheme: 'bearer', type: 'http' }],
139
+ url: '/activities',
140
+ ...options
141
+ });
142
+
143
+ /**
144
+ * Get Activity
145
+ *
146
+ * Returns the given activity that is owned by the authenticated athlete. Requires activity:read for Everyone and Followers activities. Requires activity:read_all for Only Me activities.
147
+ *
148
+ * We strongly encourage you to display the appropriate attribution that identifies Garmin as the data source and the device name in your application. Please see example below from VeloViewer (that provides an attribution for a Garmin Forerunner device).
149
+ *
150
+ * ![Attribution](/images/device-attribution-image.png)
151
+ */
152
+ export const getActivityById = <ThrowOnError extends boolean = false>(options: Options<GetActivityByIdData, ThrowOnError>) => (options.client ?? client).get<GetActivityByIdResponses, GetActivityByIdErrors, ThrowOnError>({
153
+ security: [{ scheme: 'bearer', type: 'http' }],
154
+ url: '/activities/{id}',
155
+ ...options
156
+ });
157
+
158
+ /**
159
+ * Update Activity
160
+ *
161
+ * Updates the given activity that is owned by the authenticated athlete. Requires activity:write. Also requires activity:read_all in order to update Only Me activities
162
+ */
163
+ export const updateActivityById = <ThrowOnError extends boolean = false>(options: Options<UpdateActivityByIdData, ThrowOnError>) => (options.client ?? client).put<UpdateActivityByIdResponses, UpdateActivityByIdErrors, ThrowOnError>({
164
+ security: [{ scheme: 'bearer', type: 'http' }],
165
+ url: '/activities/{id}',
166
+ ...options,
167
+ headers: {
168
+ 'Content-Type': 'application/json',
169
+ ...options.headers
170
+ }
171
+ });
172
+
173
+ /**
174
+ * List Athlete Activities
175
+ *
176
+ * Returns the activities of an athlete for a specific identifier. Requires activity:read. Only Me activities will be filtered out unless requested by a token with activity:read_all.
177
+ */
178
+ export const getLoggedInAthleteActivities = <ThrowOnError extends boolean = false>(options?: Options<GetLoggedInAthleteActivitiesData, ThrowOnError>) => (options?.client ?? client).get<GetLoggedInAthleteActivitiesResponses, GetLoggedInAthleteActivitiesErrors, ThrowOnError>({
179
+ security: [{ scheme: 'bearer', type: 'http' }],
180
+ url: '/athlete/activities',
181
+ ...options
182
+ });
183
+
184
+ /**
185
+ * List Activity Laps
186
+ *
187
+ * Returns the laps of an activity identified by an identifier. Requires activity:read for Everyone and Followers activities. Requires activity:read_all for Only Me activities.
188
+ */
189
+ export const getLapsByActivityId = <ThrowOnError extends boolean = false>(options: Options<GetLapsByActivityIdData, ThrowOnError>) => (options.client ?? client).get<GetLapsByActivityIdResponses, GetLapsByActivityIdErrors, ThrowOnError>({
190
+ security: [{ scheme: 'bearer', type: 'http' }],
191
+ url: '/activities/{id}/laps',
192
+ ...options
193
+ });
194
+
195
+ /**
196
+ * Get Activity Zones
197
+ *
198
+ * Summit Feature. Returns the zones of a given activity. Requires activity:read for Everyone and Followers activities. Requires activity:read_all for Only Me activities.
199
+ */
200
+ export const getZonesByActivityId = <ThrowOnError extends boolean = false>(options: Options<GetZonesByActivityIdData, ThrowOnError>) => (options.client ?? client).get<GetZonesByActivityIdResponses, GetZonesByActivityIdErrors, ThrowOnError>({
201
+ security: [{ scheme: 'bearer', type: 'http' }],
202
+ url: '/activities/{id}/zones',
203
+ ...options
204
+ });
205
+
206
+ /**
207
+ * List Activity Comments
208
+ *
209
+ * Returns the comments on the given activity. Requires activity:read for Everyone and Followers activities. Requires activity:read_all for Only Me activities.
210
+ */
211
+ export const getCommentsByActivityId = <ThrowOnError extends boolean = false>(options: Options<GetCommentsByActivityIdData, ThrowOnError>) => (options.client ?? client).get<GetCommentsByActivityIdResponses, GetCommentsByActivityIdErrors, ThrowOnError>({
212
+ security: [{ scheme: 'bearer', type: 'http' }],
213
+ url: '/activities/{id}/comments',
214
+ ...options
215
+ });
216
+
217
+ /**
218
+ * List Activity Kudoers
219
+ *
220
+ * Returns the athletes who kudoed an activity identified by an identifier. Requires activity:read for Everyone and Followers activities. Requires activity:read_all for Only Me activities.
221
+ */
222
+ export const getKudoersByActivityId = <ThrowOnError extends boolean = false>(options: Options<GetKudoersByActivityIdData, ThrowOnError>) => (options.client ?? client).get<GetKudoersByActivityIdResponses, GetKudoersByActivityIdErrors, ThrowOnError>({
223
+ security: [{ scheme: 'bearer', type: 'http' }],
224
+ url: '/activities/{id}/kudos',
225
+ ...options
226
+ });
227
+
228
+ /**
229
+ * Get Club
230
+ *
231
+ * Returns a given a club using its identifier.
232
+ */
233
+ export const getClubById = <ThrowOnError extends boolean = false>(options: Options<GetClubByIdData, ThrowOnError>) => (options.client ?? client).get<GetClubByIdResponses, GetClubByIdErrors, ThrowOnError>({
234
+ security: [{ scheme: 'bearer', type: 'http' }],
235
+ url: '/clubs/{id}',
236
+ ...options
237
+ });
238
+
239
+ /**
240
+ * List Club Members
241
+ *
242
+ * Returns a list of the athletes who are members of a given club.
243
+ */
244
+ export const getClubMembersById = <ThrowOnError extends boolean = false>(options: Options<GetClubMembersByIdData, ThrowOnError>) => (options.client ?? client).get<GetClubMembersByIdResponses, GetClubMembersByIdErrors, ThrowOnError>({
245
+ security: [{ scheme: 'bearer', type: 'http' }],
246
+ url: '/clubs/{id}/members',
247
+ ...options
248
+ });
249
+
250
+ /**
251
+ * List Club Administrators
252
+ *
253
+ * Returns a list of the administrators of a given club.
254
+ */
255
+ export const getClubAdminsById = <ThrowOnError extends boolean = false>(options: Options<GetClubAdminsByIdData, ThrowOnError>) => (options.client ?? client).get<GetClubAdminsByIdResponses, GetClubAdminsByIdErrors, ThrowOnError>({
256
+ security: [{ scheme: 'bearer', type: 'http' }],
257
+ url: '/clubs/{id}/admins',
258
+ ...options
259
+ });
260
+
261
+ /**
262
+ * List Club Activities
263
+ *
264
+ * Retrieve recent activities from members of a specific club. The authenticated athlete must belong to the requested club in order to hit this endpoint. Pagination is supported. Athlete profile visibility is respected for all activities.
265
+ */
266
+ export const getClubActivitiesById = <ThrowOnError extends boolean = false>(options: Options<GetClubActivitiesByIdData, ThrowOnError>) => (options.client ?? client).get<GetClubActivitiesByIdResponses, GetClubActivitiesByIdErrors, ThrowOnError>({
267
+ security: [{ scheme: 'bearer', type: 'http' }],
268
+ url: '/clubs/{id}/activities',
269
+ ...options
270
+ });
271
+
272
+ /**
273
+ * List Athlete Clubs
274
+ *
275
+ * Returns a list of the clubs whose membership includes the authenticated athlete.
276
+ */
277
+ export const getLoggedInAthleteClubs = <ThrowOnError extends boolean = false>(options?: Options<GetLoggedInAthleteClubsData, ThrowOnError>) => (options?.client ?? client).get<GetLoggedInAthleteClubsResponses, GetLoggedInAthleteClubsErrors, ThrowOnError>({
278
+ security: [{ scheme: 'bearer', type: 'http' }],
279
+ url: '/athlete/clubs',
280
+ ...options
281
+ });
282
+
283
+ /**
284
+ * Get Equipment
285
+ *
286
+ * Returns an equipment using its identifier.
287
+ */
288
+ export const getGearById = <ThrowOnError extends boolean = false>(options: Options<GetGearByIdData, ThrowOnError>) => (options.client ?? client).get<GetGearByIdResponses, GetGearByIdErrors, ThrowOnError>({
289
+ security: [{ scheme: 'bearer', type: 'http' }],
290
+ url: '/gear/{id}',
291
+ ...options
292
+ });
293
+
294
+ /**
295
+ * Get Route
296
+ *
297
+ * Returns a route using its identifier. Requires read_all scope for private routes.
298
+ */
299
+ export const getRouteById = <ThrowOnError extends boolean = false>(options: Options<GetRouteByIdData, ThrowOnError>) => (options.client ?? client).get<GetRouteByIdResponses, GetRouteByIdErrors, ThrowOnError>({
300
+ security: [{ scheme: 'bearer', type: 'http' }],
301
+ url: '/routes/{id}',
302
+ ...options
303
+ });
304
+
305
+ /**
306
+ * List Athlete Routes
307
+ *
308
+ * Returns a list of the routes created by the authenticated athlete. Private routes are filtered out unless requested by a token with read_all scope.
309
+ */
310
+ export const getRoutesByAthleteId = <ThrowOnError extends boolean = false>(options?: Options<GetRoutesByAthleteIdData, ThrowOnError>) => (options?.client ?? client).get<GetRoutesByAthleteIdResponses, GetRoutesByAthleteIdErrors, ThrowOnError>({
311
+ security: [{ scheme: 'bearer', type: 'http' }],
312
+ url: '/athletes/{id}/routes',
313
+ ...options
314
+ });
315
+
316
+ /**
317
+ * Export Route GPX
318
+ *
319
+ * Returns a GPX file of the route. Requires read_all scope for private routes.
320
+ */
321
+ export const getRouteAsGpx = <ThrowOnError extends boolean = false>(options: Options<GetRouteAsGpxData, ThrowOnError>) => (options.client ?? client).get<GetRouteAsGpxResponses, GetRouteAsGpxErrors, ThrowOnError>({
322
+ security: [{ scheme: 'bearer', type: 'http' }],
323
+ url: '/routes/{id}/export_gpx',
324
+ ...options
325
+ });
326
+
327
+ /**
328
+ * Export Route TCX
329
+ *
330
+ * Returns a TCX file of the route. Requires read_all scope for private routes.
331
+ */
332
+ export const getRouteAsTcx = <ThrowOnError extends boolean = false>(options: Options<GetRouteAsTcxData, ThrowOnError>) => (options.client ?? client).get<GetRouteAsTcxResponses, GetRouteAsTcxErrors, ThrowOnError>({
333
+ security: [{ scheme: 'bearer', type: 'http' }],
334
+ url: '/routes/{id}/export_tcx',
335
+ ...options
336
+ });
337
+
338
+ /**
339
+ * Upload Activity
340
+ *
341
+ * Uploads a new data file to create an activity from. Requires activity:write scope.
342
+ */
343
+ export const createUpload = <ThrowOnError extends boolean = false>(options?: Options<CreateUploadData, ThrowOnError>) => (options?.client ?? client).post<CreateUploadResponses, CreateUploadErrors, ThrowOnError>({
344
+ ...formDataBodySerializer,
345
+ security: [{ scheme: 'bearer', type: 'http' }],
346
+ url: '/uploads',
347
+ ...options,
348
+ headers: {
349
+ 'Content-Type': null,
350
+ ...options?.headers
351
+ }
352
+ });
353
+
354
+ /**
355
+ * Get Upload
356
+ *
357
+ * Returns an upload for a given identifier. Requires activity:write scope.
358
+ */
359
+ export const getUploadById = <ThrowOnError extends boolean = false>(options: Options<GetUploadByIdData, ThrowOnError>) => (options.client ?? client).get<GetUploadByIdResponses, GetUploadByIdErrors, ThrowOnError>({
360
+ security: [{ scheme: 'bearer', type: 'http' }],
361
+ url: '/uploads/{uploadId}',
362
+ ...options
363
+ });
364
+
365
+ /**
366
+ * Get Activity Streams
367
+ *
368
+ * Returns the given activity's streams. Requires activity:read scope. Requires activity:read_all scope for Only Me activities.
369
+ */
370
+ export const getActivityStreams = <ThrowOnError extends boolean = false>(options: Options<GetActivityStreamsData, ThrowOnError>) => (options.client ?? client).get<GetActivityStreamsResponses, GetActivityStreamsErrors, ThrowOnError>({
371
+ querySerializer: { parameters: { keys: { array: { explode: false } } } },
372
+ security: [{ scheme: 'bearer', type: 'http' }],
373
+ url: '/activities/{id}/streams',
374
+ ...options
375
+ });
376
+
377
+ /**
378
+ * Get Segment Effort Streams
379
+ *
380
+ * Returns a set of streams for a segment effort completed by the authenticated athlete. Requires read_all scope.
381
+ */
382
+ export const getSegmentEffortStreams = <ThrowOnError extends boolean = false>(options: Options<GetSegmentEffortStreamsData, ThrowOnError>) => (options.client ?? client).get<GetSegmentEffortStreamsResponses, GetSegmentEffortStreamsErrors, ThrowOnError>({
383
+ querySerializer: { parameters: { keys: { array: { explode: false } } } },
384
+ security: [{ scheme: 'bearer', type: 'http' }],
385
+ url: '/segment_efforts/{id}/streams',
386
+ ...options
387
+ });
388
+
389
+ /**
390
+ * Get Segment Streams
391
+ *
392
+ * Returns the given segment's streams. Requires read_all scope for private segments.
393
+ */
394
+ export const getSegmentStreams = <ThrowOnError extends boolean = false>(options: Options<GetSegmentStreamsData, ThrowOnError>) => (options.client ?? client).get<GetSegmentStreamsResponses, GetSegmentStreamsErrors, ThrowOnError>({
395
+ querySerializer: { parameters: { keys: { array: { explode: false } } } },
396
+ security: [{ scheme: 'bearer', type: 'http' }],
397
+ url: '/segments/{id}/streams',
398
+ ...options
399
+ });
400
+
401
+ /**
402
+ * Get Route Streams
403
+ *
404
+ * Returns the given route's streams. Requires read_all scope for private routes.
405
+ */
406
+ export const getRouteStreams = <ThrowOnError extends boolean = false>(options: Options<GetRouteStreamsData, ThrowOnError>) => (options.client ?? client).get<GetRouteStreamsResponses, GetRouteStreamsErrors, ThrowOnError>({
407
+ security: [{ scheme: 'bearer', type: 'http' }],
408
+ url: '/routes/{id}/streams',
409
+ ...options
410
+ });