@jugarhoy/api 1.0.2 → 1.0.4
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/apis/AdminClubsApi.ts +118 -0
- package/apis/AdminFeaturesApi.ts +264 -0
- package/apis/AdminPlaySpotsApi.ts +61 -0
- package/apis/AdminReservationsApi.ts +54 -0
- package/apis/AdminSubscriptionBillingApi.ts +331 -0
- package/apis/AdminSubscriptionsApi.ts +312 -5
- package/apis/AuthApi.ts +57 -0
- package/apis/UsersApi.ts +51 -0
- package/apis/index.ts +3 -0
- package/models/AddCoachToSubscriptionRequest.ts +66 -0
- package/models/AddPlayerToSubscriptionRequest.ts +66 -0
- package/models/BlockSpotItem.ts +75 -0
- package/models/BlockSpots200Response.ts +73 -0
- package/models/BlockSpotsCommand.ts +109 -0
- package/models/ChargeOn.ts +1 -1
- package/models/ClonePlaySpotRequest.ts +75 -0
- package/models/CreateClubForSuperadminParams.ts +227 -0
- package/models/CreateClubForSuperadminResponse.ts +83 -0
- package/models/CreateClubForSuperadminResponseResult.ts +111 -0
- package/models/CreateClubForSuperadminResponseResultAdminUser.ts +73 -0
- package/models/CreateFeatureRequest.ts +103 -0
- package/models/ExtendSubscriptions200Response.ts +89 -0
- package/models/ExtendSubscriptions200ResponseDetailsInner.ts +81 -0
- package/models/Feature.ts +18 -0
- package/models/GenerateSubscriptionBillsRequest.ts +65 -0
- package/models/GetAllShifts200ResponseInner.ts +8 -0
- package/models/LinkPaymentToBillRequest.ts +66 -0
- package/models/ListAllClubsResponse.ts +83 -0
- package/models/ListAllClubsResponseResult.ts +81 -0
- package/models/PlayPrice.ts +2 -2
- package/models/PlaySpotShift.ts +8 -0
- package/models/PlaySubscription.ts +41 -0
- package/models/PlaySubscriptionCreateDto.ts +37 -3
- package/models/PlaySubscriptionListDto.ts +240 -0
- package/models/RequestPasswordReset200Response.ts +65 -0
- package/models/RequestPasswordReset500Response.ts +65 -0
- package/models/RequestPasswordResetRequest.ts +66 -0
- package/models/Reserve.ts +15 -0
- package/models/ReserveType.ts +1 -0
- package/models/SavePushTokenRequest.ts +66 -0
- package/models/Sport.ts +15 -6
- package/models/SubscriptionBill.ts +198 -0
- package/models/UpdateBillRequest.ts +91 -0
- package/models/UpdateFeatureRequest.ts +91 -0
- package/models/UpdateReservationAdminRequest.ts +8 -0
- package/models/UserRole.ts +2 -1
- package/models/index.ts +25 -0
- package/package.json +1 -1
|
@@ -15,33 +15,55 @@
|
|
|
15
15
|
|
|
16
16
|
import * as runtime from '../runtime';
|
|
17
17
|
import type {
|
|
18
|
+
AddCoachToSubscriptionRequest,
|
|
18
19
|
AddMemberToSubscriptionRequest,
|
|
20
|
+
AddPlayerToSubscriptionRequest,
|
|
21
|
+
ExtendSubscriptions200Response,
|
|
19
22
|
FindOccurrences200Response,
|
|
20
23
|
PlaySubscription,
|
|
21
24
|
PlaySubscriptionCreateDto,
|
|
25
|
+
PlaySubscriptionListDto,
|
|
22
26
|
PlaySubscriptionType,
|
|
23
27
|
ReserveStatus,
|
|
24
28
|
} from '../models/index';
|
|
25
29
|
import {
|
|
30
|
+
AddCoachToSubscriptionRequestFromJSON,
|
|
31
|
+
AddCoachToSubscriptionRequestToJSON,
|
|
26
32
|
AddMemberToSubscriptionRequestFromJSON,
|
|
27
33
|
AddMemberToSubscriptionRequestToJSON,
|
|
34
|
+
AddPlayerToSubscriptionRequestFromJSON,
|
|
35
|
+
AddPlayerToSubscriptionRequestToJSON,
|
|
36
|
+
ExtendSubscriptions200ResponseFromJSON,
|
|
37
|
+
ExtendSubscriptions200ResponseToJSON,
|
|
28
38
|
FindOccurrences200ResponseFromJSON,
|
|
29
39
|
FindOccurrences200ResponseToJSON,
|
|
30
40
|
PlaySubscriptionFromJSON,
|
|
31
41
|
PlaySubscriptionToJSON,
|
|
32
42
|
PlaySubscriptionCreateDtoFromJSON,
|
|
33
43
|
PlaySubscriptionCreateDtoToJSON,
|
|
44
|
+
PlaySubscriptionListDtoFromJSON,
|
|
45
|
+
PlaySubscriptionListDtoToJSON,
|
|
34
46
|
PlaySubscriptionTypeFromJSON,
|
|
35
47
|
PlaySubscriptionTypeToJSON,
|
|
36
48
|
ReserveStatusFromJSON,
|
|
37
49
|
ReserveStatusToJSON,
|
|
38
50
|
} from '../models/index';
|
|
39
51
|
|
|
52
|
+
export interface AddCoachToSubscriptionOperationRequest {
|
|
53
|
+
subscriptionId: string;
|
|
54
|
+
addCoachToSubscriptionRequest: AddCoachToSubscriptionRequest;
|
|
55
|
+
}
|
|
56
|
+
|
|
40
57
|
export interface AddMemberToSubscriptionOperationRequest {
|
|
41
58
|
subscriptionId: string;
|
|
42
59
|
addMemberToSubscriptionRequest: AddMemberToSubscriptionRequest;
|
|
43
60
|
}
|
|
44
61
|
|
|
62
|
+
export interface AddPlayerToSubscriptionOperationRequest {
|
|
63
|
+
subscriptionId: string;
|
|
64
|
+
addPlayerToSubscriptionRequest: AddPlayerToSubscriptionRequest;
|
|
65
|
+
}
|
|
66
|
+
|
|
45
67
|
export interface CancelSubscriptionRequest {
|
|
46
68
|
subscriptionId: string;
|
|
47
69
|
}
|
|
@@ -54,6 +76,10 @@ export interface FindOccurrencesRequest {
|
|
|
54
76
|
playSubscriptionCreateDto: PlaySubscriptionCreateDto;
|
|
55
77
|
}
|
|
56
78
|
|
|
79
|
+
export interface GetSubscriptionRequest {
|
|
80
|
+
subscriptionId: string;
|
|
81
|
+
}
|
|
82
|
+
|
|
57
83
|
export interface ListSubscriptionsRequest {
|
|
58
84
|
status?: ReserveStatus;
|
|
59
85
|
type?: PlaySubscriptionType;
|
|
@@ -62,16 +88,76 @@ export interface ListSubscriptionsRequest {
|
|
|
62
88
|
coachId?: string;
|
|
63
89
|
}
|
|
64
90
|
|
|
91
|
+
export interface RemoveCoachFromSubscriptionRequest {
|
|
92
|
+
subscriptionId: string;
|
|
93
|
+
coachId: string;
|
|
94
|
+
}
|
|
95
|
+
|
|
65
96
|
export interface RemoveMemberFromSubscriptionRequest {
|
|
66
97
|
subscriptionId: string;
|
|
67
98
|
memberId: string;
|
|
68
99
|
}
|
|
69
100
|
|
|
101
|
+
export interface RemovePlayerFromSubscriptionRequest {
|
|
102
|
+
subscriptionId: string;
|
|
103
|
+
playerId: string;
|
|
104
|
+
}
|
|
105
|
+
|
|
70
106
|
/**
|
|
71
107
|
*
|
|
72
108
|
*/
|
|
73
109
|
export class AdminSubscriptionsApi extends runtime.BaseAPI {
|
|
74
110
|
|
|
111
|
+
/**
|
|
112
|
+
* Add a coach to an existing PlaySubscription
|
|
113
|
+
*/
|
|
114
|
+
async addCoachToSubscriptionRaw(requestParameters: AddCoachToSubscriptionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
115
|
+
if (requestParameters['subscriptionId'] == null) {
|
|
116
|
+
throw new runtime.RequiredError(
|
|
117
|
+
'subscriptionId',
|
|
118
|
+
'Required parameter "subscriptionId" was null or undefined when calling addCoachToSubscription().'
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (requestParameters['addCoachToSubscriptionRequest'] == null) {
|
|
123
|
+
throw new runtime.RequiredError(
|
|
124
|
+
'addCoachToSubscriptionRequest',
|
|
125
|
+
'Required parameter "addCoachToSubscriptionRequest" was null or undefined when calling addCoachToSubscription().'
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const queryParameters: any = {};
|
|
130
|
+
|
|
131
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
132
|
+
|
|
133
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
134
|
+
|
|
135
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
136
|
+
const token = this.configuration.accessToken;
|
|
137
|
+
const tokenString = await token("bearerAuth", []);
|
|
138
|
+
|
|
139
|
+
if (tokenString) {
|
|
140
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
const response = await this.request({
|
|
144
|
+
path: `/api/admin/subscriptions/{subscriptionId}/coaches`.replace(`{${"subscriptionId"}}`, encodeURIComponent(String(requestParameters['subscriptionId']))),
|
|
145
|
+
method: 'POST',
|
|
146
|
+
headers: headerParameters,
|
|
147
|
+
query: queryParameters,
|
|
148
|
+
body: AddCoachToSubscriptionRequestToJSON(requestParameters['addCoachToSubscriptionRequest']),
|
|
149
|
+
}, initOverrides);
|
|
150
|
+
|
|
151
|
+
return new runtime.VoidApiResponse(response);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Add a coach to an existing PlaySubscription
|
|
156
|
+
*/
|
|
157
|
+
async addCoachToSubscription(requestParameters: AddCoachToSubscriptionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
158
|
+
await this.addCoachToSubscriptionRaw(requestParameters, initOverrides);
|
|
159
|
+
}
|
|
160
|
+
|
|
75
161
|
/**
|
|
76
162
|
* Add a member to an existing PlaySubscription
|
|
77
163
|
*/
|
|
@@ -122,6 +208,56 @@ export class AdminSubscriptionsApi extends runtime.BaseAPI {
|
|
|
122
208
|
await this.addMemberToSubscriptionRaw(requestParameters, initOverrides);
|
|
123
209
|
}
|
|
124
210
|
|
|
211
|
+
/**
|
|
212
|
+
* Add a player to an existing PlaySubscription
|
|
213
|
+
*/
|
|
214
|
+
async addPlayerToSubscriptionRaw(requestParameters: AddPlayerToSubscriptionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
215
|
+
if (requestParameters['subscriptionId'] == null) {
|
|
216
|
+
throw new runtime.RequiredError(
|
|
217
|
+
'subscriptionId',
|
|
218
|
+
'Required parameter "subscriptionId" was null or undefined when calling addPlayerToSubscription().'
|
|
219
|
+
);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
if (requestParameters['addPlayerToSubscriptionRequest'] == null) {
|
|
223
|
+
throw new runtime.RequiredError(
|
|
224
|
+
'addPlayerToSubscriptionRequest',
|
|
225
|
+
'Required parameter "addPlayerToSubscriptionRequest" was null or undefined when calling addPlayerToSubscription().'
|
|
226
|
+
);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
const queryParameters: any = {};
|
|
230
|
+
|
|
231
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
232
|
+
|
|
233
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
234
|
+
|
|
235
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
236
|
+
const token = this.configuration.accessToken;
|
|
237
|
+
const tokenString = await token("bearerAuth", []);
|
|
238
|
+
|
|
239
|
+
if (tokenString) {
|
|
240
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
const response = await this.request({
|
|
244
|
+
path: `/api/admin/subscriptions/{subscriptionId}/players`.replace(`{${"subscriptionId"}}`, encodeURIComponent(String(requestParameters['subscriptionId']))),
|
|
245
|
+
method: 'POST',
|
|
246
|
+
headers: headerParameters,
|
|
247
|
+
query: queryParameters,
|
|
248
|
+
body: AddPlayerToSubscriptionRequestToJSON(requestParameters['addPlayerToSubscriptionRequest']),
|
|
249
|
+
}, initOverrides);
|
|
250
|
+
|
|
251
|
+
return new runtime.VoidApiResponse(response);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Add a player to an existing PlaySubscription
|
|
256
|
+
*/
|
|
257
|
+
async addPlayerToSubscription(requestParameters: AddPlayerToSubscriptionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
258
|
+
await this.addPlayerToSubscriptionRaw(requestParameters, initOverrides);
|
|
259
|
+
}
|
|
260
|
+
|
|
125
261
|
/**
|
|
126
262
|
* Cancel a PlaySubscription and all future reservations
|
|
127
263
|
*/
|
|
@@ -206,6 +342,42 @@ export class AdminSubscriptionsApi extends runtime.BaseAPI {
|
|
|
206
342
|
return await response.value();
|
|
207
343
|
}
|
|
208
344
|
|
|
345
|
+
/**
|
|
346
|
+
* Extends all active subscriptions without endDate that are within 60 days of expiration. This endpoint should be called periodically (e.g., monthly cron job) or manually. Only extends subscriptions that: - Have status CONFIRMED - Have no endDate (infinite subscriptions) - Have ocurrencesUntil within the next 60 days
|
|
347
|
+
* Extend active subscriptions by generating next 30 days of reservations
|
|
348
|
+
*/
|
|
349
|
+
async extendSubscriptionsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ExtendSubscriptions200Response>> {
|
|
350
|
+
const queryParameters: any = {};
|
|
351
|
+
|
|
352
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
353
|
+
|
|
354
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
355
|
+
const token = this.configuration.accessToken;
|
|
356
|
+
const tokenString = await token("bearerAuth", []);
|
|
357
|
+
|
|
358
|
+
if (tokenString) {
|
|
359
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
const response = await this.request({
|
|
363
|
+
path: `/api/admin/subscriptions/extend`,
|
|
364
|
+
method: 'POST',
|
|
365
|
+
headers: headerParameters,
|
|
366
|
+
query: queryParameters,
|
|
367
|
+
}, initOverrides);
|
|
368
|
+
|
|
369
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ExtendSubscriptions200ResponseFromJSON(jsonValue));
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* Extends all active subscriptions without endDate that are within 60 days of expiration. This endpoint should be called periodically (e.g., monthly cron job) or manually. Only extends subscriptions that: - Have status CONFIRMED - Have no endDate (infinite subscriptions) - Have ocurrencesUntil within the next 60 days
|
|
374
|
+
* Extend active subscriptions by generating next 30 days of reservations
|
|
375
|
+
*/
|
|
376
|
+
async extendSubscriptions(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ExtendSubscriptions200Response> {
|
|
377
|
+
const response = await this.extendSubscriptionsRaw(initOverrides);
|
|
378
|
+
return await response.value();
|
|
379
|
+
}
|
|
380
|
+
|
|
209
381
|
/**
|
|
210
382
|
* Find occurrences for a potential PlaySubscription without saving
|
|
211
383
|
*/
|
|
@@ -251,9 +423,50 @@ export class AdminSubscriptionsApi extends runtime.BaseAPI {
|
|
|
251
423
|
}
|
|
252
424
|
|
|
253
425
|
/**
|
|
254
|
-
*
|
|
426
|
+
* Get a single PlaySubscription by ID
|
|
255
427
|
*/
|
|
256
|
-
async
|
|
428
|
+
async getSubscriptionRaw(requestParameters: GetSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PlaySubscription>> {
|
|
429
|
+
if (requestParameters['subscriptionId'] == null) {
|
|
430
|
+
throw new runtime.RequiredError(
|
|
431
|
+
'subscriptionId',
|
|
432
|
+
'Required parameter "subscriptionId" was null or undefined when calling getSubscription().'
|
|
433
|
+
);
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
const queryParameters: any = {};
|
|
437
|
+
|
|
438
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
439
|
+
|
|
440
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
441
|
+
const token = this.configuration.accessToken;
|
|
442
|
+
const tokenString = await token("bearerAuth", []);
|
|
443
|
+
|
|
444
|
+
if (tokenString) {
|
|
445
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
const response = await this.request({
|
|
449
|
+
path: `/api/admin/subscriptions/{subscriptionId}`.replace(`{${"subscriptionId"}}`, encodeURIComponent(String(requestParameters['subscriptionId']))),
|
|
450
|
+
method: 'GET',
|
|
451
|
+
headers: headerParameters,
|
|
452
|
+
query: queryParameters,
|
|
453
|
+
}, initOverrides);
|
|
454
|
+
|
|
455
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => PlaySubscriptionFromJSON(jsonValue));
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
/**
|
|
459
|
+
* Get a single PlaySubscription by ID
|
|
460
|
+
*/
|
|
461
|
+
async getSubscription(requestParameters: GetSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PlaySubscription> {
|
|
462
|
+
const response = await this.getSubscriptionRaw(requestParameters, initOverrides);
|
|
463
|
+
return await response.value();
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
/**
|
|
467
|
+
* List PlaySubscriptions for the logged in customer with optional filtering (lightweight)
|
|
468
|
+
*/
|
|
469
|
+
async listSubscriptionsRaw(requestParameters: ListSubscriptionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<PlaySubscriptionListDto>>> {
|
|
257
470
|
const queryParameters: any = {};
|
|
258
471
|
|
|
259
472
|
if (requestParameters['status'] != null) {
|
|
@@ -293,17 +506,64 @@ export class AdminSubscriptionsApi extends runtime.BaseAPI {
|
|
|
293
506
|
query: queryParameters,
|
|
294
507
|
}, initOverrides);
|
|
295
508
|
|
|
296
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(
|
|
509
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(PlaySubscriptionListDtoFromJSON));
|
|
297
510
|
}
|
|
298
511
|
|
|
299
512
|
/**
|
|
300
|
-
* List PlaySubscriptions for the logged in customer with optional filtering
|
|
513
|
+
* List PlaySubscriptions for the logged in customer with optional filtering (lightweight)
|
|
301
514
|
*/
|
|
302
|
-
async listSubscriptions(requestParameters: ListSubscriptionsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<
|
|
515
|
+
async listSubscriptions(requestParameters: ListSubscriptionsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<PlaySubscriptionListDto>> {
|
|
303
516
|
const response = await this.listSubscriptionsRaw(requestParameters, initOverrides);
|
|
304
517
|
return await response.value();
|
|
305
518
|
}
|
|
306
519
|
|
|
520
|
+
/**
|
|
521
|
+
* Remove a coach from an existing PlaySubscription
|
|
522
|
+
*/
|
|
523
|
+
async removeCoachFromSubscriptionRaw(requestParameters: RemoveCoachFromSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
524
|
+
if (requestParameters['subscriptionId'] == null) {
|
|
525
|
+
throw new runtime.RequiredError(
|
|
526
|
+
'subscriptionId',
|
|
527
|
+
'Required parameter "subscriptionId" was null or undefined when calling removeCoachFromSubscription().'
|
|
528
|
+
);
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
if (requestParameters['coachId'] == null) {
|
|
532
|
+
throw new runtime.RequiredError(
|
|
533
|
+
'coachId',
|
|
534
|
+
'Required parameter "coachId" was null or undefined when calling removeCoachFromSubscription().'
|
|
535
|
+
);
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
const queryParameters: any = {};
|
|
539
|
+
|
|
540
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
541
|
+
|
|
542
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
543
|
+
const token = this.configuration.accessToken;
|
|
544
|
+
const tokenString = await token("bearerAuth", []);
|
|
545
|
+
|
|
546
|
+
if (tokenString) {
|
|
547
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
const response = await this.request({
|
|
551
|
+
path: `/api/admin/subscriptions/{subscriptionId}/coaches/{coachId}`.replace(`{${"subscriptionId"}}`, encodeURIComponent(String(requestParameters['subscriptionId']))).replace(`{${"coachId"}}`, encodeURIComponent(String(requestParameters['coachId']))),
|
|
552
|
+
method: 'DELETE',
|
|
553
|
+
headers: headerParameters,
|
|
554
|
+
query: queryParameters,
|
|
555
|
+
}, initOverrides);
|
|
556
|
+
|
|
557
|
+
return new runtime.VoidApiResponse(response);
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
/**
|
|
561
|
+
* Remove a coach from an existing PlaySubscription
|
|
562
|
+
*/
|
|
563
|
+
async removeCoachFromSubscription(requestParameters: RemoveCoachFromSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
564
|
+
await this.removeCoachFromSubscriptionRaw(requestParameters, initOverrides);
|
|
565
|
+
}
|
|
566
|
+
|
|
307
567
|
/**
|
|
308
568
|
* Remove a member from an existing PlaySubscription
|
|
309
569
|
*/
|
|
@@ -351,4 +611,51 @@ export class AdminSubscriptionsApi extends runtime.BaseAPI {
|
|
|
351
611
|
await this.removeMemberFromSubscriptionRaw(requestParameters, initOverrides);
|
|
352
612
|
}
|
|
353
613
|
|
|
614
|
+
/**
|
|
615
|
+
* Remove a player from an existing PlaySubscription
|
|
616
|
+
*/
|
|
617
|
+
async removePlayerFromSubscriptionRaw(requestParameters: RemovePlayerFromSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
618
|
+
if (requestParameters['subscriptionId'] == null) {
|
|
619
|
+
throw new runtime.RequiredError(
|
|
620
|
+
'subscriptionId',
|
|
621
|
+
'Required parameter "subscriptionId" was null or undefined when calling removePlayerFromSubscription().'
|
|
622
|
+
);
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
if (requestParameters['playerId'] == null) {
|
|
626
|
+
throw new runtime.RequiredError(
|
|
627
|
+
'playerId',
|
|
628
|
+
'Required parameter "playerId" was null or undefined when calling removePlayerFromSubscription().'
|
|
629
|
+
);
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
const queryParameters: any = {};
|
|
633
|
+
|
|
634
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
635
|
+
|
|
636
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
637
|
+
const token = this.configuration.accessToken;
|
|
638
|
+
const tokenString = await token("bearerAuth", []);
|
|
639
|
+
|
|
640
|
+
if (tokenString) {
|
|
641
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
const response = await this.request({
|
|
645
|
+
path: `/api/admin/subscriptions/{subscriptionId}/players/{playerId}`.replace(`{${"subscriptionId"}}`, encodeURIComponent(String(requestParameters['subscriptionId']))).replace(`{${"playerId"}}`, encodeURIComponent(String(requestParameters['playerId']))),
|
|
646
|
+
method: 'DELETE',
|
|
647
|
+
headers: headerParameters,
|
|
648
|
+
query: queryParameters,
|
|
649
|
+
}, initOverrides);
|
|
650
|
+
|
|
651
|
+
return new runtime.VoidApiResponse(response);
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
/**
|
|
655
|
+
* Remove a player from an existing PlaySubscription
|
|
656
|
+
*/
|
|
657
|
+
async removePlayerFromSubscription(requestParameters: RemovePlayerFromSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
658
|
+
await this.removePlayerFromSubscriptionRaw(requestParameters, initOverrides);
|
|
659
|
+
}
|
|
660
|
+
|
|
354
661
|
}
|
package/apis/AuthApi.ts
CHANGED
|
@@ -19,6 +19,9 @@ import type {
|
|
|
19
19
|
CreateFromInvite400Response,
|
|
20
20
|
GetSession401Response,
|
|
21
21
|
GetSession500Response,
|
|
22
|
+
RequestPasswordReset200Response,
|
|
23
|
+
RequestPasswordReset500Response,
|
|
24
|
+
RequestPasswordResetRequest,
|
|
22
25
|
UserAuth,
|
|
23
26
|
UserSession,
|
|
24
27
|
} from '../models/index';
|
|
@@ -31,6 +34,12 @@ import {
|
|
|
31
34
|
GetSession401ResponseToJSON,
|
|
32
35
|
GetSession500ResponseFromJSON,
|
|
33
36
|
GetSession500ResponseToJSON,
|
|
37
|
+
RequestPasswordReset200ResponseFromJSON,
|
|
38
|
+
RequestPasswordReset200ResponseToJSON,
|
|
39
|
+
RequestPasswordReset500ResponseFromJSON,
|
|
40
|
+
RequestPasswordReset500ResponseToJSON,
|
|
41
|
+
RequestPasswordResetRequestFromJSON,
|
|
42
|
+
RequestPasswordResetRequestToJSON,
|
|
34
43
|
UserAuthFromJSON,
|
|
35
44
|
UserAuthToJSON,
|
|
36
45
|
UserSessionFromJSON,
|
|
@@ -41,6 +50,10 @@ export interface CreateFromInviteRequest {
|
|
|
41
50
|
inviteCode: string;
|
|
42
51
|
}
|
|
43
52
|
|
|
53
|
+
export interface RequestPasswordResetOperationRequest {
|
|
54
|
+
requestPasswordResetRequest: RequestPasswordResetRequest;
|
|
55
|
+
}
|
|
56
|
+
|
|
44
57
|
/**
|
|
45
58
|
*
|
|
46
59
|
*/
|
|
@@ -193,4 +206,48 @@ export class AuthApi extends runtime.BaseAPI {
|
|
|
193
206
|
return await response.value();
|
|
194
207
|
}
|
|
195
208
|
|
|
209
|
+
/**
|
|
210
|
+
* Request a password reset email
|
|
211
|
+
*/
|
|
212
|
+
async requestPasswordResetRaw(requestParameters: RequestPasswordResetOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RequestPasswordReset200Response>> {
|
|
213
|
+
if (requestParameters['requestPasswordResetRequest'] == null) {
|
|
214
|
+
throw new runtime.RequiredError(
|
|
215
|
+
'requestPasswordResetRequest',
|
|
216
|
+
'Required parameter "requestPasswordResetRequest" was null or undefined when calling requestPasswordReset().'
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
const queryParameters: any = {};
|
|
221
|
+
|
|
222
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
223
|
+
|
|
224
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
225
|
+
|
|
226
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
227
|
+
const token = this.configuration.accessToken;
|
|
228
|
+
const tokenString = await token("bearerAuth", []);
|
|
229
|
+
|
|
230
|
+
if (tokenString) {
|
|
231
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
const response = await this.request({
|
|
235
|
+
path: `/api/auth/request-password-reset`,
|
|
236
|
+
method: 'POST',
|
|
237
|
+
headers: headerParameters,
|
|
238
|
+
query: queryParameters,
|
|
239
|
+
body: RequestPasswordResetRequestToJSON(requestParameters['requestPasswordResetRequest']),
|
|
240
|
+
}, initOverrides);
|
|
241
|
+
|
|
242
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RequestPasswordReset200ResponseFromJSON(jsonValue));
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* Request a password reset email
|
|
247
|
+
*/
|
|
248
|
+
async requestPasswordReset(requestParameters: RequestPasswordResetOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RequestPasswordReset200Response> {
|
|
249
|
+
const response = await this.requestPasswordResetRaw(requestParameters, initOverrides);
|
|
250
|
+
return await response.value();
|
|
251
|
+
}
|
|
252
|
+
|
|
196
253
|
}
|
package/apis/UsersApi.ts
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
import * as runtime from '../runtime';
|
|
17
17
|
import type {
|
|
18
18
|
CreateUserNotificationDto,
|
|
19
|
+
SavePushTokenRequest,
|
|
19
20
|
Sport,
|
|
20
21
|
UpdateUserNotificationDto,
|
|
21
22
|
User,
|
|
@@ -28,6 +29,8 @@ import type {
|
|
|
28
29
|
import {
|
|
29
30
|
CreateUserNotificationDtoFromJSON,
|
|
30
31
|
CreateUserNotificationDtoToJSON,
|
|
32
|
+
SavePushTokenRequestFromJSON,
|
|
33
|
+
SavePushTokenRequestToJSON,
|
|
31
34
|
SportFromJSON,
|
|
32
35
|
SportToJSON,
|
|
33
36
|
UpdateUserNotificationDtoFromJSON,
|
|
@@ -71,6 +74,10 @@ export interface RemoveUserSportProfileRequest {
|
|
|
71
74
|
sport: Sport;
|
|
72
75
|
}
|
|
73
76
|
|
|
77
|
+
export interface SavePushTokenOperationRequest {
|
|
78
|
+
savePushTokenRequest: SavePushTokenRequest;
|
|
79
|
+
}
|
|
80
|
+
|
|
74
81
|
export interface ToggleUserNotificationRequest {
|
|
75
82
|
notificationId: string;
|
|
76
83
|
}
|
|
@@ -393,6 +400,50 @@ export class UsersApi extends runtime.BaseAPI {
|
|
|
393
400
|
return await response.value();
|
|
394
401
|
}
|
|
395
402
|
|
|
403
|
+
/**
|
|
404
|
+
* Save or update push notification token for the current user
|
|
405
|
+
*/
|
|
406
|
+
async savePushTokenRaw(requestParameters: SavePushTokenOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UserNotificationDto>> {
|
|
407
|
+
if (requestParameters['savePushTokenRequest'] == null) {
|
|
408
|
+
throw new runtime.RequiredError(
|
|
409
|
+
'savePushTokenRequest',
|
|
410
|
+
'Required parameter "savePushTokenRequest" was null or undefined when calling savePushToken().'
|
|
411
|
+
);
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
const queryParameters: any = {};
|
|
415
|
+
|
|
416
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
417
|
+
|
|
418
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
419
|
+
|
|
420
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
421
|
+
const token = this.configuration.accessToken;
|
|
422
|
+
const tokenString = await token("bearerAuth", []);
|
|
423
|
+
|
|
424
|
+
if (tokenString) {
|
|
425
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
const response = await this.request({
|
|
429
|
+
path: `/api/users/push-token`,
|
|
430
|
+
method: 'POST',
|
|
431
|
+
headers: headerParameters,
|
|
432
|
+
query: queryParameters,
|
|
433
|
+
body: SavePushTokenRequestToJSON(requestParameters['savePushTokenRequest']),
|
|
434
|
+
}, initOverrides);
|
|
435
|
+
|
|
436
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => UserNotificationDtoFromJSON(jsonValue));
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* Save or update push notification token for the current user
|
|
441
|
+
*/
|
|
442
|
+
async savePushToken(requestParameters: SavePushTokenOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UserNotificationDto> {
|
|
443
|
+
const response = await this.savePushTokenRaw(requestParameters, initOverrides);
|
|
444
|
+
return await response.value();
|
|
445
|
+
}
|
|
446
|
+
|
|
396
447
|
/**
|
|
397
448
|
* Toggle the enabled state of a notification preference
|
|
398
449
|
*/
|
package/apis/index.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
+
export * from './AdminClubsApi';
|
|
3
4
|
export * from './AdminCoachesApi';
|
|
4
5
|
export * from './AdminCustomersApi';
|
|
5
6
|
export * from './AdminDevicesApi';
|
|
7
|
+
export * from './AdminFeaturesApi';
|
|
6
8
|
export * from './AdminInvitationsApi';
|
|
7
9
|
export * from './AdminLocationsApi';
|
|
8
10
|
export * from './AdminPaymentConfigsApi';
|
|
@@ -10,6 +12,7 @@ export * from './AdminPlayPricesApi';
|
|
|
10
12
|
export * from './AdminPlaySpotShiftsApi';
|
|
11
13
|
export * from './AdminPlaySpotsApi';
|
|
12
14
|
export * from './AdminReservationsApi';
|
|
15
|
+
export * from './AdminSubscriptionBillingApi';
|
|
13
16
|
export * from './AdminSubscriptionsApi';
|
|
14
17
|
export * from './AdminUsersApi';
|
|
15
18
|
export * from './AuthApi';
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Jugar Hoy - API
|
|
5
|
+
* API documentation for Jugar Hoy application
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.5.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @export
|
|
19
|
+
* @interface AddCoachToSubscriptionRequest
|
|
20
|
+
*/
|
|
21
|
+
export interface AddCoachToSubscriptionRequest {
|
|
22
|
+
/**
|
|
23
|
+
* ID of the coach to add
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof AddCoachToSubscriptionRequest
|
|
26
|
+
*/
|
|
27
|
+
coachId: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Check if a given object implements the AddCoachToSubscriptionRequest interface.
|
|
32
|
+
*/
|
|
33
|
+
export function instanceOfAddCoachToSubscriptionRequest(value: object): value is AddCoachToSubscriptionRequest {
|
|
34
|
+
if (!('coachId' in value) || value['coachId'] === undefined) return false;
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function AddCoachToSubscriptionRequestFromJSON(json: any): AddCoachToSubscriptionRequest {
|
|
39
|
+
return AddCoachToSubscriptionRequestFromJSONTyped(json, false);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function AddCoachToSubscriptionRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): AddCoachToSubscriptionRequest {
|
|
43
|
+
if (json == null) {
|
|
44
|
+
return json;
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
|
|
48
|
+
'coachId': json['coachId'],
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function AddCoachToSubscriptionRequestToJSON(json: any): AddCoachToSubscriptionRequest {
|
|
53
|
+
return AddCoachToSubscriptionRequestToJSONTyped(json, false);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function AddCoachToSubscriptionRequestToJSONTyped(value?: AddCoachToSubscriptionRequest | null, ignoreDiscriminator: boolean = false): any {
|
|
57
|
+
if (value == null) {
|
|
58
|
+
return value;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return {
|
|
62
|
+
|
|
63
|
+
'coachId': value['coachId'],
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|