@globalscoutme/api-client 1.0.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/client/client.gen.ts +311 -0
- package/client/index.ts +25 -0
- package/client/types.gen.ts +242 -0
- package/client/utils.gen.ts +337 -0
- package/client.gen.ts +23 -0
- package/core/auth.gen.ts +42 -0
- package/core/bodySerializer.gen.ts +100 -0
- package/core/params.gen.ts +176 -0
- package/core/pathSerializer.gen.ts +180 -0
- package/core/queryKeySerializer.gen.ts +136 -0
- package/core/serverSentEvents.gen.ts +266 -0
- package/core/types.gen.ts +118 -0
- package/core/utils.gen.ts +143 -0
- package/index.ts +115 -0
- package/package.json +22 -0
- package/sdk.gen.ts +434 -0
- package/types.gen.ts +1294 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
+
|
|
3
|
+
import type { BodySerializer, QuerySerializer } from './bodySerializer.gen.js';
|
|
4
|
+
import {
|
|
5
|
+
type ArraySeparatorStyle,
|
|
6
|
+
serializeArrayParam,
|
|
7
|
+
serializeObjectParam,
|
|
8
|
+
serializePrimitiveParam,
|
|
9
|
+
} from './pathSerializer.gen.js';
|
|
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(
|
|
48
|
+
match,
|
|
49
|
+
serializeArrayParam({ explode, name, style, value }),
|
|
50
|
+
);
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (typeof value === 'object') {
|
|
55
|
+
url = url.replace(
|
|
56
|
+
match,
|
|
57
|
+
serializeObjectParam({
|
|
58
|
+
explode,
|
|
59
|
+
name,
|
|
60
|
+
style,
|
|
61
|
+
value: value as Record<string, unknown>,
|
|
62
|
+
valueOnly: true,
|
|
63
|
+
}),
|
|
64
|
+
);
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (style === 'matrix') {
|
|
69
|
+
url = url.replace(
|
|
70
|
+
match,
|
|
71
|
+
`;${serializePrimitiveParam({
|
|
72
|
+
name,
|
|
73
|
+
value: value as string,
|
|
74
|
+
})}`,
|
|
75
|
+
);
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const replaceValue = encodeURIComponent(
|
|
80
|
+
style === 'label' ? `.${value as string}` : (value as string),
|
|
81
|
+
);
|
|
82
|
+
url = url.replace(match, replaceValue);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return url;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export const getUrl = ({
|
|
89
|
+
baseUrl,
|
|
90
|
+
path,
|
|
91
|
+
query,
|
|
92
|
+
querySerializer,
|
|
93
|
+
url: _url,
|
|
94
|
+
}: {
|
|
95
|
+
baseUrl?: string;
|
|
96
|
+
path?: Record<string, unknown>;
|
|
97
|
+
query?: Record<string, unknown>;
|
|
98
|
+
querySerializer: QuerySerializer;
|
|
99
|
+
url: string;
|
|
100
|
+
}) => {
|
|
101
|
+
const pathUrl = _url.startsWith('/') ? _url : `/${_url}`;
|
|
102
|
+
let url = (baseUrl ?? '') + pathUrl;
|
|
103
|
+
if (path) {
|
|
104
|
+
url = defaultPathSerializer({ path, url });
|
|
105
|
+
}
|
|
106
|
+
let search = query ? querySerializer(query) : '';
|
|
107
|
+
if (search.startsWith('?')) {
|
|
108
|
+
search = search.substring(1);
|
|
109
|
+
}
|
|
110
|
+
if (search) {
|
|
111
|
+
url += `?${search}`;
|
|
112
|
+
}
|
|
113
|
+
return url;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
export function getValidRequestBody(options: {
|
|
117
|
+
body?: unknown;
|
|
118
|
+
bodySerializer?: BodySerializer | null;
|
|
119
|
+
serializedBody?: unknown;
|
|
120
|
+
}) {
|
|
121
|
+
const hasBody = options.body !== undefined;
|
|
122
|
+
const isSerializedBody = hasBody && options.bodySerializer;
|
|
123
|
+
|
|
124
|
+
if (isSerializedBody) {
|
|
125
|
+
if ('serializedBody' in options) {
|
|
126
|
+
const hasSerializedBody =
|
|
127
|
+
options.serializedBody !== undefined && options.serializedBody !== '';
|
|
128
|
+
|
|
129
|
+
return hasSerializedBody ? options.serializedBody : null;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// not all clients implement a serializedBody property (i.e. client-axios)
|
|
133
|
+
return options.body !== '' ? options.body : null;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// plain/text body
|
|
137
|
+
if (hasBody) {
|
|
138
|
+
return options.body;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// no body was provided
|
|
142
|
+
return undefined;
|
|
143
|
+
}
|
package/index.ts
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
+
|
|
3
|
+
export {
|
|
4
|
+
Achievements,
|
|
5
|
+
Auth,
|
|
6
|
+
Body,
|
|
7
|
+
Documents,
|
|
8
|
+
GlobalScoutMeClient,
|
|
9
|
+
Index,
|
|
10
|
+
type Options,
|
|
11
|
+
Organizations,
|
|
12
|
+
Players,
|
|
13
|
+
Profile,
|
|
14
|
+
Videos,
|
|
15
|
+
} from './sdk.gen.js';
|
|
16
|
+
export type {
|
|
17
|
+
AchievementCatalogDto,
|
|
18
|
+
BodyMeasurementResponseDto,
|
|
19
|
+
CareerAchievementDto,
|
|
20
|
+
ClientOptions,
|
|
21
|
+
CreateBodyMeasurementDto,
|
|
22
|
+
CreateDocumentDto,
|
|
23
|
+
CreateVideoDto,
|
|
24
|
+
DashboardResponseDto,
|
|
25
|
+
DeletePlayersMeData,
|
|
26
|
+
DeletePlayersMeErrors,
|
|
27
|
+
DeletePlayersMeResponse,
|
|
28
|
+
DeletePlayersMeResponses,
|
|
29
|
+
DeleteVideosByIdData,
|
|
30
|
+
DeleteVideosByIdErrors,
|
|
31
|
+
DeleteVideosByIdResponse,
|
|
32
|
+
DeleteVideosByIdResponses,
|
|
33
|
+
DocumentResponseDto,
|
|
34
|
+
GetAchievementsData,
|
|
35
|
+
GetAchievementsMeData,
|
|
36
|
+
GetAchievementsMeErrors,
|
|
37
|
+
GetAchievementsMeResponse,
|
|
38
|
+
GetAchievementsMeResponses,
|
|
39
|
+
GetAchievementsResponse,
|
|
40
|
+
GetAchievementsResponses,
|
|
41
|
+
GetAuthMeData,
|
|
42
|
+
GetAuthMeResponses,
|
|
43
|
+
GetBodyMeasurementsMeData,
|
|
44
|
+
GetBodyMeasurementsMeErrors,
|
|
45
|
+
GetBodyMeasurementsMeResponse,
|
|
46
|
+
GetBodyMeasurementsMeResponses,
|
|
47
|
+
GetDocumentsMeData,
|
|
48
|
+
GetDocumentsMeErrors,
|
|
49
|
+
GetDocumentsMeResponse,
|
|
50
|
+
GetDocumentsMeResponses,
|
|
51
|
+
GetIndexByTableNameData,
|
|
52
|
+
GetIndexByTableNameErrors,
|
|
53
|
+
GetIndexByTableNameResponse,
|
|
54
|
+
GetIndexByTableNameResponses,
|
|
55
|
+
GetOrganizationsMeData,
|
|
56
|
+
GetOrganizationsMeErrors,
|
|
57
|
+
GetOrganizationsMeResponse,
|
|
58
|
+
GetOrganizationsMeResponses,
|
|
59
|
+
GetPlayersMeDashboardData,
|
|
60
|
+
GetPlayersMeDashboardErrors,
|
|
61
|
+
GetPlayersMeDashboardResponse,
|
|
62
|
+
GetPlayersMeDashboardResponses,
|
|
63
|
+
GetPlayersMeData,
|
|
64
|
+
GetPlayersMeErrors,
|
|
65
|
+
GetPlayersMeResponse,
|
|
66
|
+
GetPlayersMeResponses,
|
|
67
|
+
GetProfileMeData,
|
|
68
|
+
GetProfileMeErrors,
|
|
69
|
+
GetProfileMeResponse,
|
|
70
|
+
GetProfileMeResponses,
|
|
71
|
+
GetVideosMeData,
|
|
72
|
+
GetVideosMeErrors,
|
|
73
|
+
GetVideosMeResponse,
|
|
74
|
+
GetVideosMeResponses,
|
|
75
|
+
IndexItemDto,
|
|
76
|
+
OrganizationResponseDto,
|
|
77
|
+
PatchPlayersMeData,
|
|
78
|
+
PatchPlayersMeErrors,
|
|
79
|
+
PatchPlayersMeResponse,
|
|
80
|
+
PatchPlayersMeResponses,
|
|
81
|
+
PlayerResponseDto,
|
|
82
|
+
PostBodyMeasurementsData,
|
|
83
|
+
PostBodyMeasurementsErrors,
|
|
84
|
+
PostBodyMeasurementsResponse,
|
|
85
|
+
PostBodyMeasurementsResponses,
|
|
86
|
+
PostDocumentsData,
|
|
87
|
+
PostDocumentsErrors,
|
|
88
|
+
PostDocumentsResponse,
|
|
89
|
+
PostDocumentsResponses,
|
|
90
|
+
PostOrganizationsRegisterClubData,
|
|
91
|
+
PostOrganizationsRegisterClubErrors,
|
|
92
|
+
PostOrganizationsRegisterClubResponse,
|
|
93
|
+
PostOrganizationsRegisterClubResponses,
|
|
94
|
+
PostVideosData,
|
|
95
|
+
PostVideosErrors,
|
|
96
|
+
PostVideosResponse,
|
|
97
|
+
PostVideosResponses,
|
|
98
|
+
PreviousClubDto,
|
|
99
|
+
ProfileResponseDto,
|
|
100
|
+
PutOrganizationsMeData,
|
|
101
|
+
PutOrganizationsMeErrors,
|
|
102
|
+
PutOrganizationsMeResponse,
|
|
103
|
+
PutOrganizationsMeResponses,
|
|
104
|
+
PutProfileMeData,
|
|
105
|
+
PutProfileMeErrors,
|
|
106
|
+
PutProfileMeResponse,
|
|
107
|
+
PutProfileMeResponses,
|
|
108
|
+
RegisterClubDto,
|
|
109
|
+
RegisterClubResponseDto,
|
|
110
|
+
UpdateOrganizationDto,
|
|
111
|
+
UpdatePlayerDto,
|
|
112
|
+
UpdateProfileDto,
|
|
113
|
+
UserAchievementResponseDto,
|
|
114
|
+
VideoResponseDto,
|
|
115
|
+
} from './types.gen.js';
|
package/package.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@globalscoutme/api-client",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "GlobalScoutMe Player API client (generated)",
|
|
5
|
+
"author": "GlobalScoutMe",
|
|
6
|
+
"license": "UNLICENSED",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "./index.ts",
|
|
9
|
+
"types": "./index.ts",
|
|
10
|
+
"keywords": ["api-client","typescript"],
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@hey-api/client-axios": "^0.2.5",
|
|
13
|
+
"axios": "^1.6.1"
|
|
14
|
+
},
|
|
15
|
+
"peerDependencies": {
|
|
16
|
+
"typescript": "^5.0.0"
|
|
17
|
+
},
|
|
18
|
+
"publishConfig": {
|
|
19
|
+
"access": "public",
|
|
20
|
+
"registry": "https://registry.npmjs.org/"
|
|
21
|
+
}
|
|
22
|
+
}
|
package/sdk.gen.ts
ADDED
|
@@ -0,0 +1,434 @@
|
|
|
1
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
+
|
|
3
|
+
import { client } from './client.gen.js';
|
|
4
|
+
import type {
|
|
5
|
+
Client,
|
|
6
|
+
Options as Options2,
|
|
7
|
+
TDataShape,
|
|
8
|
+
} from './client/index.js';
|
|
9
|
+
import type {
|
|
10
|
+
DeletePlayersMeData,
|
|
11
|
+
DeletePlayersMeErrors,
|
|
12
|
+
DeletePlayersMeResponses,
|
|
13
|
+
DeleteVideosByIdData,
|
|
14
|
+
DeleteVideosByIdErrors,
|
|
15
|
+
DeleteVideosByIdResponses,
|
|
16
|
+
GetAchievementsData,
|
|
17
|
+
GetAchievementsMeData,
|
|
18
|
+
GetAchievementsMeErrors,
|
|
19
|
+
GetAchievementsMeResponses,
|
|
20
|
+
GetAchievementsResponses,
|
|
21
|
+
GetAuthMeData,
|
|
22
|
+
GetAuthMeResponses,
|
|
23
|
+
GetBodyMeasurementsMeData,
|
|
24
|
+
GetBodyMeasurementsMeErrors,
|
|
25
|
+
GetBodyMeasurementsMeResponses,
|
|
26
|
+
GetDocumentsMeData,
|
|
27
|
+
GetDocumentsMeErrors,
|
|
28
|
+
GetDocumentsMeResponses,
|
|
29
|
+
GetIndexByTableNameData,
|
|
30
|
+
GetIndexByTableNameErrors,
|
|
31
|
+
GetIndexByTableNameResponses,
|
|
32
|
+
GetOrganizationsMeData,
|
|
33
|
+
GetOrganizationsMeErrors,
|
|
34
|
+
GetOrganizationsMeResponses,
|
|
35
|
+
GetPlayersMeDashboardData,
|
|
36
|
+
GetPlayersMeDashboardErrors,
|
|
37
|
+
GetPlayersMeDashboardResponses,
|
|
38
|
+
GetPlayersMeData,
|
|
39
|
+
GetPlayersMeErrors,
|
|
40
|
+
GetPlayersMeResponses,
|
|
41
|
+
GetProfileMeData,
|
|
42
|
+
GetProfileMeErrors,
|
|
43
|
+
GetProfileMeResponses,
|
|
44
|
+
GetVideosMeData,
|
|
45
|
+
GetVideosMeErrors,
|
|
46
|
+
GetVideosMeResponses,
|
|
47
|
+
PatchPlayersMeData,
|
|
48
|
+
PatchPlayersMeErrors,
|
|
49
|
+
PatchPlayersMeResponses,
|
|
50
|
+
PostBodyMeasurementsData,
|
|
51
|
+
PostBodyMeasurementsErrors,
|
|
52
|
+
PostBodyMeasurementsResponses,
|
|
53
|
+
PostDocumentsData,
|
|
54
|
+
PostDocumentsErrors,
|
|
55
|
+
PostDocumentsResponses,
|
|
56
|
+
PostOrganizationsRegisterClubData,
|
|
57
|
+
PostOrganizationsRegisterClubErrors,
|
|
58
|
+
PostOrganizationsRegisterClubResponses,
|
|
59
|
+
PostVideosData,
|
|
60
|
+
PostVideosErrors,
|
|
61
|
+
PostVideosResponses,
|
|
62
|
+
PutOrganizationsMeData,
|
|
63
|
+
PutOrganizationsMeErrors,
|
|
64
|
+
PutOrganizationsMeResponses,
|
|
65
|
+
PutProfileMeData,
|
|
66
|
+
PutProfileMeErrors,
|
|
67
|
+
PutProfileMeResponses,
|
|
68
|
+
} from './types.gen.js';
|
|
69
|
+
|
|
70
|
+
export type Options<
|
|
71
|
+
TData extends TDataShape = TDataShape,
|
|
72
|
+
ThrowOnError extends boolean = boolean,
|
|
73
|
+
> = Options2<TData, ThrowOnError> & {
|
|
74
|
+
/**
|
|
75
|
+
* You can provide a client instance returned by `createClient()` instead of
|
|
76
|
+
* individual options. This might be also useful if you want to implement a
|
|
77
|
+
* custom client.
|
|
78
|
+
*/
|
|
79
|
+
client?: Client;
|
|
80
|
+
/**
|
|
81
|
+
* You can pass arbitrary values through the `meta` object. This can be
|
|
82
|
+
* used to access values that aren't defined as part of the SDK function.
|
|
83
|
+
*/
|
|
84
|
+
meta?: Record<string, unknown>;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
class HeyApiClient {
|
|
88
|
+
protected client: Client;
|
|
89
|
+
|
|
90
|
+
constructor(args?: { client?: Client }) {
|
|
91
|
+
this.client = args?.client ?? client;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
class HeyApiRegistry<T> {
|
|
96
|
+
private readonly defaultKey = 'default';
|
|
97
|
+
|
|
98
|
+
private readonly instances: Map<string, T> = new Map();
|
|
99
|
+
|
|
100
|
+
get(key?: string): T {
|
|
101
|
+
const instance = this.instances.get(key ?? this.defaultKey);
|
|
102
|
+
if (!instance) {
|
|
103
|
+
throw new Error(
|
|
104
|
+
`No SDK client found. Create one with "new GlobalScoutMeClient()" to fix this error.`,
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
return instance;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
set(value: T, key?: string): void {
|
|
111
|
+
this.instances.set(key ?? this.defaultKey, value);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export class Auth extends HeyApiClient {
|
|
116
|
+
public authControllerMe<ThrowOnError extends boolean = false>(
|
|
117
|
+
options?: Options<GetAuthMeData, ThrowOnError>,
|
|
118
|
+
) {
|
|
119
|
+
return (options?.client ?? this.client).get<
|
|
120
|
+
GetAuthMeResponses,
|
|
121
|
+
unknown,
|
|
122
|
+
ThrowOnError
|
|
123
|
+
>({ url: '/auth/me', ...options });
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export class Players extends HeyApiClient {
|
|
128
|
+
public deleteMe<ThrowOnError extends boolean = false>(
|
|
129
|
+
options?: Options<DeletePlayersMeData, ThrowOnError>,
|
|
130
|
+
) {
|
|
131
|
+
return (options?.client ?? this.client).delete<
|
|
132
|
+
DeletePlayersMeResponses,
|
|
133
|
+
DeletePlayersMeErrors,
|
|
134
|
+
ThrowOnError
|
|
135
|
+
>({ url: '/players/me', ...options });
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
public getMe<ThrowOnError extends boolean = false>(
|
|
139
|
+
options?: Options<GetPlayersMeData, ThrowOnError>,
|
|
140
|
+
) {
|
|
141
|
+
return (options?.client ?? this.client).get<
|
|
142
|
+
GetPlayersMeResponses,
|
|
143
|
+
GetPlayersMeErrors,
|
|
144
|
+
ThrowOnError
|
|
145
|
+
>({ url: '/players/me', ...options });
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
public patchMe<ThrowOnError extends boolean = false>(
|
|
149
|
+
options: Options<PatchPlayersMeData, ThrowOnError>,
|
|
150
|
+
) {
|
|
151
|
+
return (options.client ?? this.client).patch<
|
|
152
|
+
PatchPlayersMeResponses,
|
|
153
|
+
PatchPlayersMeErrors,
|
|
154
|
+
ThrowOnError
|
|
155
|
+
>({
|
|
156
|
+
url: '/players/me',
|
|
157
|
+
...options,
|
|
158
|
+
headers: {
|
|
159
|
+
'Content-Type': 'application/json',
|
|
160
|
+
...options.headers,
|
|
161
|
+
},
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
public getMyDashboard<ThrowOnError extends boolean = false>(
|
|
166
|
+
options?: Options<GetPlayersMeDashboardData, ThrowOnError>,
|
|
167
|
+
) {
|
|
168
|
+
return (options?.client ?? this.client).get<
|
|
169
|
+
GetPlayersMeDashboardResponses,
|
|
170
|
+
GetPlayersMeDashboardErrors,
|
|
171
|
+
ThrowOnError
|
|
172
|
+
>({ url: '/players/me/dashboard', ...options });
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export class Profile extends HeyApiClient {
|
|
177
|
+
public getProfileMe<ThrowOnError extends boolean = false>(
|
|
178
|
+
options?: Options<GetProfileMeData, ThrowOnError>,
|
|
179
|
+
) {
|
|
180
|
+
return (options?.client ?? this.client).get<
|
|
181
|
+
GetProfileMeResponses,
|
|
182
|
+
GetProfileMeErrors,
|
|
183
|
+
ThrowOnError
|
|
184
|
+
>({ url: '/profile/me', ...options });
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
public updateProfileMe<ThrowOnError extends boolean = false>(
|
|
188
|
+
options: Options<PutProfileMeData, ThrowOnError>,
|
|
189
|
+
) {
|
|
190
|
+
return (options.client ?? this.client).put<
|
|
191
|
+
PutProfileMeResponses,
|
|
192
|
+
PutProfileMeErrors,
|
|
193
|
+
ThrowOnError
|
|
194
|
+
>({
|
|
195
|
+
url: '/profile/me',
|
|
196
|
+
...options,
|
|
197
|
+
headers: {
|
|
198
|
+
'Content-Type': 'application/json',
|
|
199
|
+
...options.headers,
|
|
200
|
+
},
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export class Achievements extends HeyApiClient {
|
|
206
|
+
public getAchievementsCatalog<ThrowOnError extends boolean = false>(
|
|
207
|
+
options?: Options<GetAchievementsData, ThrowOnError>,
|
|
208
|
+
) {
|
|
209
|
+
return (options?.client ?? this.client).get<
|
|
210
|
+
GetAchievementsResponses,
|
|
211
|
+
unknown,
|
|
212
|
+
ThrowOnError
|
|
213
|
+
>({ url: '/achievements', ...options });
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
public getMyAchievements<ThrowOnError extends boolean = false>(
|
|
217
|
+
options?: Options<GetAchievementsMeData, ThrowOnError>,
|
|
218
|
+
) {
|
|
219
|
+
return (options?.client ?? this.client).get<
|
|
220
|
+
GetAchievementsMeResponses,
|
|
221
|
+
GetAchievementsMeErrors,
|
|
222
|
+
ThrowOnError
|
|
223
|
+
>({ url: '/achievements/me', ...options });
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export class Body extends HeyApiClient {
|
|
228
|
+
public getMyMeasurements<ThrowOnError extends boolean = false>(
|
|
229
|
+
options?: Options<GetBodyMeasurementsMeData, ThrowOnError>,
|
|
230
|
+
) {
|
|
231
|
+
return (options?.client ?? this.client).get<
|
|
232
|
+
GetBodyMeasurementsMeResponses,
|
|
233
|
+
GetBodyMeasurementsMeErrors,
|
|
234
|
+
ThrowOnError
|
|
235
|
+
>({ url: '/body/measurements/me', ...options });
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
public createMeasurement<ThrowOnError extends boolean = false>(
|
|
239
|
+
options: Options<PostBodyMeasurementsData, ThrowOnError>,
|
|
240
|
+
) {
|
|
241
|
+
return (options.client ?? this.client).post<
|
|
242
|
+
PostBodyMeasurementsResponses,
|
|
243
|
+
PostBodyMeasurementsErrors,
|
|
244
|
+
ThrowOnError
|
|
245
|
+
>({
|
|
246
|
+
url: '/body/measurements',
|
|
247
|
+
...options,
|
|
248
|
+
headers: {
|
|
249
|
+
'Content-Type': 'application/json',
|
|
250
|
+
...options.headers,
|
|
251
|
+
},
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
export class Documents extends HeyApiClient {
|
|
257
|
+
public getMyDocuments<ThrowOnError extends boolean = false>(
|
|
258
|
+
options?: Options<GetDocumentsMeData, ThrowOnError>,
|
|
259
|
+
) {
|
|
260
|
+
return (options?.client ?? this.client).get<
|
|
261
|
+
GetDocumentsMeResponses,
|
|
262
|
+
GetDocumentsMeErrors,
|
|
263
|
+
ThrowOnError
|
|
264
|
+
>({ url: '/documents/me', ...options });
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
public createDocument<ThrowOnError extends boolean = false>(
|
|
268
|
+
options: Options<PostDocumentsData, ThrowOnError>,
|
|
269
|
+
) {
|
|
270
|
+
return (options.client ?? this.client).post<
|
|
271
|
+
PostDocumentsResponses,
|
|
272
|
+
PostDocumentsErrors,
|
|
273
|
+
ThrowOnError
|
|
274
|
+
>({
|
|
275
|
+
url: '/documents',
|
|
276
|
+
...options,
|
|
277
|
+
headers: {
|
|
278
|
+
'Content-Type': 'application/json',
|
|
279
|
+
...options.headers,
|
|
280
|
+
},
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
export class Index extends HeyApiClient {
|
|
286
|
+
public getIndexItems<ThrowOnError extends boolean = false>(
|
|
287
|
+
options: Options<GetIndexByTableNameData, ThrowOnError>,
|
|
288
|
+
) {
|
|
289
|
+
return (options.client ?? this.client).get<
|
|
290
|
+
GetIndexByTableNameResponses,
|
|
291
|
+
GetIndexByTableNameErrors,
|
|
292
|
+
ThrowOnError
|
|
293
|
+
>({ url: '/index/{tableName}', ...options });
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
export class Organizations extends HeyApiClient {
|
|
298
|
+
public registerClub<ThrowOnError extends boolean = false>(
|
|
299
|
+
options: Options<PostOrganizationsRegisterClubData, ThrowOnError>,
|
|
300
|
+
) {
|
|
301
|
+
return (options.client ?? this.client).post<
|
|
302
|
+
PostOrganizationsRegisterClubResponses,
|
|
303
|
+
PostOrganizationsRegisterClubErrors,
|
|
304
|
+
ThrowOnError
|
|
305
|
+
>({
|
|
306
|
+
url: '/organizations/register-club',
|
|
307
|
+
...options,
|
|
308
|
+
headers: {
|
|
309
|
+
'Content-Type': 'application/json',
|
|
310
|
+
...options.headers,
|
|
311
|
+
},
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
public getMyOrganization<ThrowOnError extends boolean = false>(
|
|
316
|
+
options?: Options<GetOrganizationsMeData, ThrowOnError>,
|
|
317
|
+
) {
|
|
318
|
+
return (options?.client ?? this.client).get<
|
|
319
|
+
GetOrganizationsMeResponses,
|
|
320
|
+
GetOrganizationsMeErrors,
|
|
321
|
+
ThrowOnError
|
|
322
|
+
>({ url: '/organizations/me', ...options });
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
public updateMyOrganization<ThrowOnError extends boolean = false>(
|
|
326
|
+
options: Options<PutOrganizationsMeData, ThrowOnError>,
|
|
327
|
+
) {
|
|
328
|
+
return (options.client ?? this.client).put<
|
|
329
|
+
PutOrganizationsMeResponses,
|
|
330
|
+
PutOrganizationsMeErrors,
|
|
331
|
+
ThrowOnError
|
|
332
|
+
>({
|
|
333
|
+
url: '/organizations/me',
|
|
334
|
+
...options,
|
|
335
|
+
headers: {
|
|
336
|
+
'Content-Type': 'application/json',
|
|
337
|
+
...options.headers,
|
|
338
|
+
},
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
export class Videos extends HeyApiClient {
|
|
344
|
+
public getMyVideos<ThrowOnError extends boolean = false>(
|
|
345
|
+
options: Options<GetVideosMeData, ThrowOnError>,
|
|
346
|
+
) {
|
|
347
|
+
return (options.client ?? this.client).get<
|
|
348
|
+
GetVideosMeResponses,
|
|
349
|
+
GetVideosMeErrors,
|
|
350
|
+
ThrowOnError
|
|
351
|
+
>({ url: '/videos/me', ...options });
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
public createVideo<ThrowOnError extends boolean = false>(
|
|
355
|
+
options: Options<PostVideosData, ThrowOnError>,
|
|
356
|
+
) {
|
|
357
|
+
return (options.client ?? this.client).post<
|
|
358
|
+
PostVideosResponses,
|
|
359
|
+
PostVideosErrors,
|
|
360
|
+
ThrowOnError
|
|
361
|
+
>({
|
|
362
|
+
url: '/videos',
|
|
363
|
+
...options,
|
|
364
|
+
headers: {
|
|
365
|
+
'Content-Type': 'application/json',
|
|
366
|
+
...options.headers,
|
|
367
|
+
},
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
public deleteVideo<ThrowOnError extends boolean = false>(
|
|
372
|
+
options: Options<DeleteVideosByIdData, ThrowOnError>,
|
|
373
|
+
) {
|
|
374
|
+
return (options.client ?? this.client).delete<
|
|
375
|
+
DeleteVideosByIdResponses,
|
|
376
|
+
DeleteVideosByIdErrors,
|
|
377
|
+
ThrowOnError
|
|
378
|
+
>({ url: '/videos/{id}', ...options });
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
export class GlobalScoutMeClient extends HeyApiClient {
|
|
383
|
+
public static readonly __registry = new HeyApiRegistry<GlobalScoutMeClient>();
|
|
384
|
+
|
|
385
|
+
constructor(args?: { client?: Client; key?: string }) {
|
|
386
|
+
super(args);
|
|
387
|
+
GlobalScoutMeClient.__registry.set(this, args?.key);
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
private _auth?: Auth;
|
|
391
|
+
get auth(): Auth {
|
|
392
|
+
return (this._auth ??= new Auth({ client: this.client }));
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
private _players?: Players;
|
|
396
|
+
get players(): Players {
|
|
397
|
+
return (this._players ??= new Players({ client: this.client }));
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
private _profile?: Profile;
|
|
401
|
+
get profile(): Profile {
|
|
402
|
+
return (this._profile ??= new Profile({ client: this.client }));
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
private _achievements?: Achievements;
|
|
406
|
+
get achievements(): Achievements {
|
|
407
|
+
return (this._achievements ??= new Achievements({ client: this.client }));
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
private _body?: Body;
|
|
411
|
+
get body(): Body {
|
|
412
|
+
return (this._body ??= new Body({ client: this.client }));
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
private _documents?: Documents;
|
|
416
|
+
get documents(): Documents {
|
|
417
|
+
return (this._documents ??= new Documents({ client: this.client }));
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
private _index?: Index;
|
|
421
|
+
get index(): Index {
|
|
422
|
+
return (this._index ??= new Index({ client: this.client }));
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
private _organizations?: Organizations;
|
|
426
|
+
get organizations(): Organizations {
|
|
427
|
+
return (this._organizations ??= new Organizations({ client: this.client }));
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
private _videos?: Videos;
|
|
431
|
+
get videos(): Videos {
|
|
432
|
+
return (this._videos ??= new Videos({ client: this.client }));
|
|
433
|
+
}
|
|
434
|
+
}
|