@jugarhoy/api 1.0.6 → 1.0.8

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 (34) hide show
  1. package/apis/AdminClubConfigApi.ts +294 -0
  2. package/apis/AdminClubsApi.ts +48 -0
  3. package/apis/AdminPlaySpotShiftsApi.ts +11 -3
  4. package/apis/AdminPlaySpotsApi.ts +11 -3
  5. package/apis/AdminReservationsApi.ts +5 -0
  6. package/apis/AdminWhatsAppTemplatesApi.ts +330 -0
  7. package/apis/DevicesApi.ts +52 -0
  8. package/apis/ReservesApi.ts +2 -10
  9. package/apis/index.ts +2 -0
  10. package/models/ApiAdminPlayPricesIdPutRequest.ts +6 -22
  11. package/models/ApiAdminPlayPricesPostRequest.ts +7 -23
  12. package/models/ApproveClubResponse.ts +83 -0
  13. package/models/ApproveClubResponseResult.ts +81 -0
  14. package/models/ComputedValueType.ts +59 -0
  15. package/models/CreateServiceConfigRequest.ts +152 -0
  16. package/models/CustomerServiceConfig.ts +168 -0
  17. package/models/CustomerServiceConfigDto.ts +180 -0
  18. package/models/HasDoorlock200Response.ts +65 -0
  19. package/models/NotificationTemplate.ts +146 -0
  20. package/models/NotificationTemplateDto.ts +155 -0
  21. package/models/ParameterMapping.ts +161 -0
  22. package/models/ParameterValueType.ts +55 -0
  23. package/models/PlayPrice.ts +8 -25
  24. package/models/ProcessEmailMessageRequest.ts +41 -5
  25. package/models/ServiceType.ts +53 -0
  26. package/models/TestNotificationTemplate200Response.ts +73 -0
  27. package/models/TestNotificationTemplateRequest.ts +66 -0
  28. package/models/ToggleServiceConfigRequest.ts +66 -0
  29. package/models/UpdateServiceConfigRequest.ts +125 -0
  30. package/models/UpsertNotificationTemplateRequest.ts +123 -0
  31. package/models/UserSession.ts +8 -0
  32. package/models/WhatsAppProvider.ts +54 -0
  33. package/models/index.ts +18 -0
  34. package/package.json +1 -1
@@ -0,0 +1,294 @@
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
+
16
+ import * as runtime from '../runtime';
17
+ import type {
18
+ CreateServiceConfigRequest,
19
+ CustomerServiceConfigDto,
20
+ ToggleServiceConfigRequest,
21
+ UpdateServiceConfigRequest,
22
+ } from '../models/index';
23
+ import {
24
+ CreateServiceConfigRequestFromJSON,
25
+ CreateServiceConfigRequestToJSON,
26
+ CustomerServiceConfigDtoFromJSON,
27
+ CustomerServiceConfigDtoToJSON,
28
+ ToggleServiceConfigRequestFromJSON,
29
+ ToggleServiceConfigRequestToJSON,
30
+ UpdateServiceConfigRequestFromJSON,
31
+ UpdateServiceConfigRequestToJSON,
32
+ } from '../models/index';
33
+
34
+ export interface CreateServiceConfigOperationRequest {
35
+ createServiceConfigRequest: CreateServiceConfigRequest;
36
+ }
37
+
38
+ export interface DeleteServiceConfigRequest {
39
+ id: string;
40
+ }
41
+
42
+ export interface ListAllServiceConfigsRequest {
43
+ type?: ListAllServiceConfigsTypeEnum;
44
+ }
45
+
46
+ export interface ToggleServiceConfigOperationRequest {
47
+ id: string;
48
+ toggleServiceConfigRequest: ToggleServiceConfigRequest;
49
+ }
50
+
51
+ export interface UpdateServiceConfigOperationRequest {
52
+ id: string;
53
+ updateServiceConfigRequest: UpdateServiceConfigRequest;
54
+ }
55
+
56
+ /**
57
+ *
58
+ */
59
+ export class AdminClubConfigApi extends runtime.BaseAPI {
60
+
61
+ /**
62
+ * Create a new service configuration
63
+ */
64
+ async createServiceConfigRaw(requestParameters: CreateServiceConfigOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CustomerServiceConfigDto>> {
65
+ if (requestParameters['createServiceConfigRequest'] == null) {
66
+ throw new runtime.RequiredError(
67
+ 'createServiceConfigRequest',
68
+ 'Required parameter "createServiceConfigRequest" was null or undefined when calling createServiceConfig().'
69
+ );
70
+ }
71
+
72
+ const queryParameters: any = {};
73
+
74
+ const headerParameters: runtime.HTTPHeaders = {};
75
+
76
+ headerParameters['Content-Type'] = 'application/json';
77
+
78
+ if (this.configuration && this.configuration.accessToken) {
79
+ const token = this.configuration.accessToken;
80
+ const tokenString = await token("bearerAuth", []);
81
+
82
+ if (tokenString) {
83
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
84
+ }
85
+ }
86
+ const response = await this.request({
87
+ path: `/api/admin/club-config/config`,
88
+ method: 'POST',
89
+ headers: headerParameters,
90
+ query: queryParameters,
91
+ body: CreateServiceConfigRequestToJSON(requestParameters['createServiceConfigRequest']),
92
+ }, initOverrides);
93
+
94
+ return new runtime.JSONApiResponse(response, (jsonValue) => CustomerServiceConfigDtoFromJSON(jsonValue));
95
+ }
96
+
97
+ /**
98
+ * Create a new service configuration
99
+ */
100
+ async createServiceConfig(requestParameters: CreateServiceConfigOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CustomerServiceConfigDto> {
101
+ const response = await this.createServiceConfigRaw(requestParameters, initOverrides);
102
+ return await response.value();
103
+ }
104
+
105
+ /**
106
+ * Delete a service configuration by ID
107
+ */
108
+ async deleteServiceConfigRaw(requestParameters: DeleteServiceConfigRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
109
+ if (requestParameters['id'] == null) {
110
+ throw new runtime.RequiredError(
111
+ 'id',
112
+ 'Required parameter "id" was null or undefined when calling deleteServiceConfig().'
113
+ );
114
+ }
115
+
116
+ const queryParameters: any = {};
117
+
118
+ const headerParameters: runtime.HTTPHeaders = {};
119
+
120
+ if (this.configuration && this.configuration.accessToken) {
121
+ const token = this.configuration.accessToken;
122
+ const tokenString = await token("bearerAuth", []);
123
+
124
+ if (tokenString) {
125
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
126
+ }
127
+ }
128
+ const response = await this.request({
129
+ path: `/api/admin/club-config/config/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
130
+ method: 'DELETE',
131
+ headers: headerParameters,
132
+ query: queryParameters,
133
+ }, initOverrides);
134
+
135
+ return new runtime.VoidApiResponse(response);
136
+ }
137
+
138
+ /**
139
+ * Delete a service configuration by ID
140
+ */
141
+ async deleteServiceConfig(requestParameters: DeleteServiceConfigRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
142
+ await this.deleteServiceConfigRaw(requestParameters, initOverrides);
143
+ }
144
+
145
+ /**
146
+ * List all service configurations
147
+ */
148
+ async listAllServiceConfigsRaw(requestParameters: ListAllServiceConfigsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<CustomerServiceConfigDto>>> {
149
+ const queryParameters: any = {};
150
+
151
+ if (requestParameters['type'] != null) {
152
+ queryParameters['type'] = requestParameters['type'];
153
+ }
154
+
155
+ const headerParameters: runtime.HTTPHeaders = {};
156
+
157
+ if (this.configuration && this.configuration.accessToken) {
158
+ const token = this.configuration.accessToken;
159
+ const tokenString = await token("bearerAuth", []);
160
+
161
+ if (tokenString) {
162
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
163
+ }
164
+ }
165
+ const response = await this.request({
166
+ path: `/api/admin/club-config/configs`,
167
+ method: 'GET',
168
+ headers: headerParameters,
169
+ query: queryParameters,
170
+ }, initOverrides);
171
+
172
+ return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(CustomerServiceConfigDtoFromJSON));
173
+ }
174
+
175
+ /**
176
+ * List all service configurations
177
+ */
178
+ async listAllServiceConfigs(requestParameters: ListAllServiceConfigsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<CustomerServiceConfigDto>> {
179
+ const response = await this.listAllServiceConfigsRaw(requestParameters, initOverrides);
180
+ return await response.value();
181
+ }
182
+
183
+ /**
184
+ * Toggle service configuration enabled status
185
+ */
186
+ async toggleServiceConfigRaw(requestParameters: ToggleServiceConfigOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CustomerServiceConfigDto>> {
187
+ if (requestParameters['id'] == null) {
188
+ throw new runtime.RequiredError(
189
+ 'id',
190
+ 'Required parameter "id" was null or undefined when calling toggleServiceConfig().'
191
+ );
192
+ }
193
+
194
+ if (requestParameters['toggleServiceConfigRequest'] == null) {
195
+ throw new runtime.RequiredError(
196
+ 'toggleServiceConfigRequest',
197
+ 'Required parameter "toggleServiceConfigRequest" was null or undefined when calling toggleServiceConfig().'
198
+ );
199
+ }
200
+
201
+ const queryParameters: any = {};
202
+
203
+ const headerParameters: runtime.HTTPHeaders = {};
204
+
205
+ headerParameters['Content-Type'] = 'application/json';
206
+
207
+ if (this.configuration && this.configuration.accessToken) {
208
+ const token = this.configuration.accessToken;
209
+ const tokenString = await token("bearerAuth", []);
210
+
211
+ if (tokenString) {
212
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
213
+ }
214
+ }
215
+ const response = await this.request({
216
+ path: `/api/admin/club-config/config/{id}/enabled`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
217
+ method: 'PATCH',
218
+ headers: headerParameters,
219
+ query: queryParameters,
220
+ body: ToggleServiceConfigRequestToJSON(requestParameters['toggleServiceConfigRequest']),
221
+ }, initOverrides);
222
+
223
+ return new runtime.JSONApiResponse(response, (jsonValue) => CustomerServiceConfigDtoFromJSON(jsonValue));
224
+ }
225
+
226
+ /**
227
+ * Toggle service configuration enabled status
228
+ */
229
+ async toggleServiceConfig(requestParameters: ToggleServiceConfigOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CustomerServiceConfigDto> {
230
+ const response = await this.toggleServiceConfigRaw(requestParameters, initOverrides);
231
+ return await response.value();
232
+ }
233
+
234
+ /**
235
+ * Update a service configuration by ID
236
+ */
237
+ async updateServiceConfigRaw(requestParameters: UpdateServiceConfigOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CustomerServiceConfigDto>> {
238
+ if (requestParameters['id'] == null) {
239
+ throw new runtime.RequiredError(
240
+ 'id',
241
+ 'Required parameter "id" was null or undefined when calling updateServiceConfig().'
242
+ );
243
+ }
244
+
245
+ if (requestParameters['updateServiceConfigRequest'] == null) {
246
+ throw new runtime.RequiredError(
247
+ 'updateServiceConfigRequest',
248
+ 'Required parameter "updateServiceConfigRequest" was null or undefined when calling updateServiceConfig().'
249
+ );
250
+ }
251
+
252
+ const queryParameters: any = {};
253
+
254
+ const headerParameters: runtime.HTTPHeaders = {};
255
+
256
+ headerParameters['Content-Type'] = 'application/json';
257
+
258
+ if (this.configuration && this.configuration.accessToken) {
259
+ const token = this.configuration.accessToken;
260
+ const tokenString = await token("bearerAuth", []);
261
+
262
+ if (tokenString) {
263
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
264
+ }
265
+ }
266
+ const response = await this.request({
267
+ path: `/api/admin/club-config/config/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
268
+ method: 'PUT',
269
+ headers: headerParameters,
270
+ query: queryParameters,
271
+ body: UpdateServiceConfigRequestToJSON(requestParameters['updateServiceConfigRequest']),
272
+ }, initOverrides);
273
+
274
+ return new runtime.JSONApiResponse(response, (jsonValue) => CustomerServiceConfigDtoFromJSON(jsonValue));
275
+ }
276
+
277
+ /**
278
+ * Update a service configuration by ID
279
+ */
280
+ async updateServiceConfig(requestParameters: UpdateServiceConfigOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CustomerServiceConfigDto> {
281
+ const response = await this.updateServiceConfigRaw(requestParameters, initOverrides);
282
+ return await response.value();
283
+ }
284
+
285
+ }
286
+
287
+ /**
288
+ * @export
289
+ */
290
+ export const ListAllServiceConfigsTypeEnum = {
291
+ Whatsapp: 'whatsapp',
292
+ Tuya: 'tuya'
293
+ } as const;
294
+ export type ListAllServiceConfigsTypeEnum = typeof ListAllServiceConfigsTypeEnum[keyof typeof ListAllServiceConfigsTypeEnum];
@@ -15,11 +15,14 @@
15
15
 
16
16
  import * as runtime from '../runtime';
17
17
  import type {
18
+ ApproveClubResponse,
18
19
  CreateClubForSuperadminParams,
19
20
  CreateClubForSuperadminResponse,
20
21
  ListAllClubsResponse,
21
22
  } from '../models/index';
22
23
  import {
24
+ ApproveClubResponseFromJSON,
25
+ ApproveClubResponseToJSON,
23
26
  CreateClubForSuperadminParamsFromJSON,
24
27
  CreateClubForSuperadminParamsToJSON,
25
28
  CreateClubForSuperadminResponseFromJSON,
@@ -28,6 +31,10 @@ import {
28
31
  ListAllClubsResponseToJSON,
29
32
  } from '../models/index';
30
33
 
34
+ export interface ApiAdminClubsCustomerIdApprovePutRequest {
35
+ customerId: string;
36
+ }
37
+
31
38
  export interface ApiAdminClubsPostRequest {
32
39
  createClubForSuperadminParams: CreateClubForSuperadminParams;
33
40
  }
@@ -37,6 +44,47 @@ export interface ApiAdminClubsPostRequest {
37
44
  */
38
45
  export class AdminClubsApi extends runtime.BaseAPI {
39
46
 
47
+ /**
48
+ * Approve a club (change status from NEW to APPROVED)
49
+ */
50
+ async apiAdminClubsCustomerIdApprovePutRaw(requestParameters: ApiAdminClubsCustomerIdApprovePutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ApproveClubResponse>> {
51
+ if (requestParameters['customerId'] == null) {
52
+ throw new runtime.RequiredError(
53
+ 'customerId',
54
+ 'Required parameter "customerId" was null or undefined when calling apiAdminClubsCustomerIdApprovePut().'
55
+ );
56
+ }
57
+
58
+ const queryParameters: any = {};
59
+
60
+ const headerParameters: runtime.HTTPHeaders = {};
61
+
62
+ if (this.configuration && this.configuration.accessToken) {
63
+ const token = this.configuration.accessToken;
64
+ const tokenString = await token("bearerAuth", []);
65
+
66
+ if (tokenString) {
67
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
68
+ }
69
+ }
70
+ const response = await this.request({
71
+ path: `/api/admin/clubs/{customerId}/approve`.replace(`{${"customerId"}}`, encodeURIComponent(String(requestParameters['customerId']))),
72
+ method: 'PUT',
73
+ headers: headerParameters,
74
+ query: queryParameters,
75
+ }, initOverrides);
76
+
77
+ return new runtime.JSONApiResponse(response, (jsonValue) => ApproveClubResponseFromJSON(jsonValue));
78
+ }
79
+
80
+ /**
81
+ * Approve a club (change status from NEW to APPROVED)
82
+ */
83
+ async apiAdminClubsCustomerIdApprovePut(requestParameters: ApiAdminClubsCustomerIdApprovePutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ApproveClubResponse> {
84
+ const response = await this.apiAdminClubsCustomerIdApprovePutRaw(requestParameters, initOverrides);
85
+ return await response.value();
86
+ }
87
+
40
88
  /**
41
89
  * List all clubs in the system (SUPERADMIN only)
42
90
  */
@@ -39,6 +39,10 @@ export interface DeleteShiftRequest {
39
39
  id: string;
40
40
  }
41
41
 
42
+ export interface GetAllShiftsRequest {
43
+ locationId?: string;
44
+ }
45
+
42
46
  export interface GetShiftByIdRequest {
43
47
  id: string;
44
48
  }
@@ -141,9 +145,13 @@ export class AdminPlaySpotShiftsApi extends runtime.BaseAPI {
141
145
  /**
142
146
  * Get all play spot shifts with their play spots
143
147
  */
144
- async getAllShiftsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<GetAllShifts200ResponseInner>>> {
148
+ async getAllShiftsRaw(requestParameters: GetAllShiftsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<GetAllShifts200ResponseInner>>> {
145
149
  const queryParameters: any = {};
146
150
 
151
+ if (requestParameters['locationId'] != null) {
152
+ queryParameters['locationId'] = requestParameters['locationId'];
153
+ }
154
+
147
155
  const headerParameters: runtime.HTTPHeaders = {};
148
156
 
149
157
  if (this.configuration && this.configuration.accessToken) {
@@ -167,8 +175,8 @@ export class AdminPlaySpotShiftsApi extends runtime.BaseAPI {
167
175
  /**
168
176
  * Get all play spot shifts with their play spots
169
177
  */
170
- async getAllShifts(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<GetAllShifts200ResponseInner>> {
171
- const response = await this.getAllShiftsRaw(initOverrides);
178
+ async getAllShifts(requestParameters: GetAllShiftsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<GetAllShifts200ResponseInner>> {
179
+ const response = await this.getAllShiftsRaw(requestParameters, initOverrides);
172
180
  return await response.value();
173
181
  }
174
182
 
@@ -44,6 +44,10 @@ export interface DeletePlaySpotRequest {
44
44
  id: string;
45
45
  }
46
46
 
47
+ export interface GetAllPlaySpotsRequest {
48
+ locationId?: string;
49
+ }
50
+
47
51
  export interface GetPlaySpotRequest {
48
52
  id: string;
49
53
  }
@@ -202,9 +206,13 @@ export class AdminPlaySpotsApi extends runtime.BaseAPI {
202
206
  /**
203
207
  * Get all play spots with their locations
204
208
  */
205
- async getAllPlaySpotsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<GetAllPlaySpots200ResponseInner>>> {
209
+ async getAllPlaySpotsRaw(requestParameters: GetAllPlaySpotsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<GetAllPlaySpots200ResponseInner>>> {
206
210
  const queryParameters: any = {};
207
211
 
212
+ if (requestParameters['locationId'] != null) {
213
+ queryParameters['locationId'] = requestParameters['locationId'];
214
+ }
215
+
208
216
  const headerParameters: runtime.HTTPHeaders = {};
209
217
 
210
218
  if (this.configuration && this.configuration.accessToken) {
@@ -228,8 +236,8 @@ export class AdminPlaySpotsApi extends runtime.BaseAPI {
228
236
  /**
229
237
  * Get all play spots with their locations
230
238
  */
231
- async getAllPlaySpots(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<GetAllPlaySpots200ResponseInner>> {
232
- const response = await this.getAllPlaySpotsRaw(initOverrides);
239
+ async getAllPlaySpots(requestParameters: GetAllPlaySpotsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<GetAllPlaySpots200ResponseInner>> {
240
+ const response = await this.getAllPlaySpotsRaw(requestParameters, initOverrides);
233
241
  return await response.value();
234
242
  }
235
243
 
@@ -49,6 +49,7 @@ export interface CancelReservationOperationRequest {
49
49
  }
50
50
 
51
51
  export interface GetAllReservationsRequest {
52
+ locationId?: string;
52
53
  activeOnly?: boolean;
53
54
  startDate?: Date;
54
55
  endDate?: Date;
@@ -168,6 +169,10 @@ export class AdminReservationsApi extends runtime.BaseAPI {
168
169
  async getAllReservationsRaw(requestParameters: GetAllReservationsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<Reserve>>> {
169
170
  const queryParameters: any = {};
170
171
 
172
+ if (requestParameters['locationId'] != null) {
173
+ queryParameters['locationId'] = requestParameters['locationId'];
174
+ }
175
+
171
176
  if (requestParameters['activeOnly'] != null) {
172
177
  queryParameters['activeOnly'] = requestParameters['activeOnly'];
173
178
  }