@globalscoutme/api-client 1.0.2 → 1.0.5

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.
@@ -0,0 +1,184 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+ import { client } from './client.gen.js';
3
+ class HeyApiClient {
4
+ constructor(args) {
5
+ this.client = args?.client ?? client;
6
+ }
7
+ }
8
+ class HeyApiRegistry {
9
+ constructor() {
10
+ this.defaultKey = 'default';
11
+ this.instances = new Map();
12
+ }
13
+ get(key) {
14
+ const instance = this.instances.get(key ?? this.defaultKey);
15
+ if (!instance) {
16
+ throw new Error(`No SDK client found. Create one with "new GlobalScoutMeClient()" to fix this error.`);
17
+ }
18
+ return instance;
19
+ }
20
+ set(value, key) {
21
+ this.instances.set(key ?? this.defaultKey, value);
22
+ }
23
+ }
24
+ export class Auth extends HeyApiClient {
25
+ authControllerMe(options) {
26
+ return (options?.client ?? this.client).get({ url: '/auth/me', ...options });
27
+ }
28
+ }
29
+ export class Players extends HeyApiClient {
30
+ deleteMe(options) {
31
+ return (options?.client ?? this.client).delete({ url: '/players/me', ...options });
32
+ }
33
+ getMe(options) {
34
+ return (options?.client ?? this.client).get({ url: '/players/me', ...options });
35
+ }
36
+ patchMe(options) {
37
+ return (options.client ?? this.client).patch({
38
+ url: '/players/me',
39
+ ...options,
40
+ headers: {
41
+ 'Content-Type': 'application/json',
42
+ ...options.headers,
43
+ },
44
+ });
45
+ }
46
+ getMyDashboard(options) {
47
+ return (options?.client ?? this.client).get({ url: '/players/me/dashboard', ...options });
48
+ }
49
+ }
50
+ export class Profile extends HeyApiClient {
51
+ getProfileMe(options) {
52
+ return (options?.client ?? this.client).get({ url: '/profile/me', ...options });
53
+ }
54
+ updateProfileMe(options) {
55
+ return (options.client ?? this.client).put({
56
+ url: '/profile/me',
57
+ ...options,
58
+ headers: {
59
+ 'Content-Type': 'application/json',
60
+ ...options.headers,
61
+ },
62
+ });
63
+ }
64
+ }
65
+ export class Achievements extends HeyApiClient {
66
+ getAchievementsCatalog(options) {
67
+ return (options?.client ?? this.client).get({ url: '/achievements', ...options });
68
+ }
69
+ getMyAchievements(options) {
70
+ return (options?.client ?? this.client).get({ url: '/achievements/me', ...options });
71
+ }
72
+ }
73
+ export class Body extends HeyApiClient {
74
+ getMyMeasurements(options) {
75
+ return (options?.client ?? this.client).get({ url: '/body/measurements/me', ...options });
76
+ }
77
+ createMeasurement(options) {
78
+ return (options.client ?? this.client).post({
79
+ url: '/body/measurements',
80
+ ...options,
81
+ headers: {
82
+ 'Content-Type': 'application/json',
83
+ ...options.headers,
84
+ },
85
+ });
86
+ }
87
+ }
88
+ export class Documents extends HeyApiClient {
89
+ getMyDocuments(options) {
90
+ return (options?.client ?? this.client).get({ url: '/documents/me', ...options });
91
+ }
92
+ createDocument(options) {
93
+ return (options.client ?? this.client).post({
94
+ url: '/documents',
95
+ ...options,
96
+ headers: {
97
+ 'Content-Type': 'application/json',
98
+ ...options.headers,
99
+ },
100
+ });
101
+ }
102
+ }
103
+ export class Index extends HeyApiClient {
104
+ getIndexItems(options) {
105
+ return (options.client ?? this.client).get({ url: '/index/{tableName}', ...options });
106
+ }
107
+ }
108
+ export class Organizations extends HeyApiClient {
109
+ registerClub(options) {
110
+ return (options.client ?? this.client).post({
111
+ url: '/organizations/register-club',
112
+ ...options,
113
+ headers: {
114
+ 'Content-Type': 'application/json',
115
+ ...options.headers,
116
+ },
117
+ });
118
+ }
119
+ getMyOrganization(options) {
120
+ return (options?.client ?? this.client).get({ url: '/organizations/me', ...options });
121
+ }
122
+ updateMyOrganization(options) {
123
+ return (options.client ?? this.client).put({
124
+ url: '/organizations/me',
125
+ ...options,
126
+ headers: {
127
+ 'Content-Type': 'application/json',
128
+ ...options.headers,
129
+ },
130
+ });
131
+ }
132
+ }
133
+ export class Videos extends HeyApiClient {
134
+ getMyVideos(options) {
135
+ return (options.client ?? this.client).get({ url: '/videos/me', ...options });
136
+ }
137
+ createVideo(options) {
138
+ return (options.client ?? this.client).post({
139
+ url: '/videos',
140
+ ...options,
141
+ headers: {
142
+ 'Content-Type': 'application/json',
143
+ ...options.headers,
144
+ },
145
+ });
146
+ }
147
+ deleteVideo(options) {
148
+ return (options.client ?? this.client).delete({ url: '/videos/{id}', ...options });
149
+ }
150
+ }
151
+ export class GlobalScoutMeClient extends HeyApiClient {
152
+ constructor(args) {
153
+ super(args);
154
+ GlobalScoutMeClient.__registry.set(this, args?.key);
155
+ }
156
+ get auth() {
157
+ return (this._auth ?? (this._auth = new Auth({ client: this.client })));
158
+ }
159
+ get players() {
160
+ return (this._players ?? (this._players = new Players({ client: this.client })));
161
+ }
162
+ get profile() {
163
+ return (this._profile ?? (this._profile = new Profile({ client: this.client })));
164
+ }
165
+ get achievements() {
166
+ return (this._achievements ?? (this._achievements = new Achievements({ client: this.client })));
167
+ }
168
+ get body() {
169
+ return (this._body ?? (this._body = new Body({ client: this.client })));
170
+ }
171
+ get documents() {
172
+ return (this._documents ?? (this._documents = new Documents({ client: this.client })));
173
+ }
174
+ get index() {
175
+ return (this._index ?? (this._index = new Index({ client: this.client })));
176
+ }
177
+ get organizations() {
178
+ return (this._organizations ?? (this._organizations = new Organizations({ client: this.client })));
179
+ }
180
+ get videos() {
181
+ return (this._videos ?? (this._videos = new Videos({ client: this.client })));
182
+ }
183
+ }
184
+ GlobalScoutMeClient.__registry = new HeyApiRegistry();