@jugarhoy/api 1.0.7 → 1.0.9
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/AdminClubConfigApi.ts +294 -0
- package/apis/AdminClubsApi.ts +48 -0
- package/apis/AdminPlaySpotShiftsApi.ts +11 -3
- package/apis/AdminPlaySpotsApi.ts +11 -3
- package/apis/AdminReservationsApi.ts +5 -0
- package/apis/AdminWhatsAppTemplatesApi.ts +330 -0
- package/apis/AuthApi.ts +12 -12
- package/apis/DevicesApi.ts +52 -0
- package/apis/NotificationsApi.ts +167 -0
- package/apis/ReservesApi.ts +2 -10
- package/apis/index.ts +3 -0
- package/models/ApiAdminPlayPricesIdPutRequest.ts +6 -22
- package/models/ApiAdminPlayPricesPostRequest.ts +7 -23
- package/models/ApproveClubResponse.ts +83 -0
- package/models/ApproveClubResponseResult.ts +81 -0
- package/models/ComputedValueType.ts +59 -0
- package/models/CreateServiceConfigRequest.ts +152 -0
- package/models/CustomerServiceConfig.ts +168 -0
- package/models/CustomerServiceConfigDto.ts +180 -0
- package/models/HasDoorlock200Response.ts +65 -0
- package/models/MarkNotificationAsRead200Response.ts +65 -0
- package/models/Notification.ts +147 -0
- package/models/NotificationCategory.ts +58 -0
- package/models/NotificationChannelType.ts +55 -0
- package/models/NotificationDto.ts +139 -0
- package/models/NotificationListResponseDto.ts +89 -0
- package/models/NotificationTemplate.ts +146 -0
- package/models/NotificationTemplateDto.ts +155 -0
- package/models/NotificationType.ts +5 -5
- package/models/ParameterMapping.ts +161 -0
- package/models/ParameterValueType.ts +55 -0
- package/models/PlayPrice.ts +8 -25
- package/models/ProcessEmailMessageRequest.ts +41 -5
- package/models/ServiceType.ts +53 -0
- package/models/TestNotificationTemplate200Response.ts +73 -0
- package/models/TestNotificationTemplateRequest.ts +66 -0
- package/models/ToggleServiceConfigRequest.ts +66 -0
- package/models/UnreadCountResponseDto.ts +65 -0
- package/models/UpdateServiceConfigRequest.ts +125 -0
- package/models/UpsertNotificationTemplateRequest.ts +123 -0
- package/models/{UserNotification.ts → UserNotificationConfig.ts} +27 -27
- package/models/UserSession.ts +8 -0
- package/models/WhatsAppProvider.ts +54 -0
- package/models/index.ts +26 -2
- package/package.json +1 -1
- package/models/RequestPasswordReset200Response.ts +0 -65
|
@@ -0,0 +1,330 @@
|
|
|
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
|
+
NotificationTemplateDto,
|
|
19
|
+
TestNotificationTemplate200Response,
|
|
20
|
+
TestNotificationTemplateRequest,
|
|
21
|
+
UpsertNotificationTemplateRequest,
|
|
22
|
+
} from '../models/index';
|
|
23
|
+
import {
|
|
24
|
+
NotificationTemplateDtoFromJSON,
|
|
25
|
+
NotificationTemplateDtoToJSON,
|
|
26
|
+
TestNotificationTemplate200ResponseFromJSON,
|
|
27
|
+
TestNotificationTemplate200ResponseToJSON,
|
|
28
|
+
TestNotificationTemplateRequestFromJSON,
|
|
29
|
+
TestNotificationTemplateRequestToJSON,
|
|
30
|
+
UpsertNotificationTemplateRequestFromJSON,
|
|
31
|
+
UpsertNotificationTemplateRequestToJSON,
|
|
32
|
+
} from '../models/index';
|
|
33
|
+
|
|
34
|
+
export interface DeleteNotificationTemplateRequest {
|
|
35
|
+
templateId: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface GetNotificationTemplateRequest {
|
|
39
|
+
customerId: string;
|
|
40
|
+
type: GetNotificationTemplateTypeEnum;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface ListCustomerNotificationTemplatesRequest {
|
|
44
|
+
customerId: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface TestNotificationTemplateOperationRequest {
|
|
48
|
+
templateId: string;
|
|
49
|
+
testNotificationTemplateRequest: TestNotificationTemplateRequest;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface UpsertNotificationTemplateOperationRequest {
|
|
53
|
+
upsertNotificationTemplateRequest: UpsertNotificationTemplateRequest;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
*
|
|
58
|
+
*/
|
|
59
|
+
export class AdminWhatsAppTemplatesApi extends runtime.BaseAPI {
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Delete a notification template (superadmin only)
|
|
63
|
+
*/
|
|
64
|
+
async deleteNotificationTemplateRaw(requestParameters: DeleteNotificationTemplateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
65
|
+
if (requestParameters['templateId'] == null) {
|
|
66
|
+
throw new runtime.RequiredError(
|
|
67
|
+
'templateId',
|
|
68
|
+
'Required parameter "templateId" was null or undefined when calling deleteNotificationTemplate().'
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const queryParameters: any = {};
|
|
73
|
+
|
|
74
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
75
|
+
|
|
76
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
77
|
+
const token = this.configuration.accessToken;
|
|
78
|
+
const tokenString = await token("bearerAuth", []);
|
|
79
|
+
|
|
80
|
+
if (tokenString) {
|
|
81
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
const response = await this.request({
|
|
85
|
+
path: `/api/admin/whatsapp/templates/{templateId}`.replace(`{${"templateId"}}`, encodeURIComponent(String(requestParameters['templateId']))),
|
|
86
|
+
method: 'DELETE',
|
|
87
|
+
headers: headerParameters,
|
|
88
|
+
query: queryParameters,
|
|
89
|
+
}, initOverrides);
|
|
90
|
+
|
|
91
|
+
return new runtime.VoidApiResponse(response);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Delete a notification template (superadmin only)
|
|
96
|
+
*/
|
|
97
|
+
async deleteNotificationTemplate(requestParameters: DeleteNotificationTemplateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
98
|
+
await this.deleteNotificationTemplateRaw(requestParameters, initOverrides);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Get a specific notification template
|
|
103
|
+
*/
|
|
104
|
+
async getNotificationTemplateRaw(requestParameters: GetNotificationTemplateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<NotificationTemplateDto>> {
|
|
105
|
+
if (requestParameters['customerId'] == null) {
|
|
106
|
+
throw new runtime.RequiredError(
|
|
107
|
+
'customerId',
|
|
108
|
+
'Required parameter "customerId" was null or undefined when calling getNotificationTemplate().'
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (requestParameters['type'] == null) {
|
|
113
|
+
throw new runtime.RequiredError(
|
|
114
|
+
'type',
|
|
115
|
+
'Required parameter "type" was null or undefined when calling getNotificationTemplate().'
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const queryParameters: any = {};
|
|
120
|
+
|
|
121
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
122
|
+
|
|
123
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
124
|
+
const token = this.configuration.accessToken;
|
|
125
|
+
const tokenString = await token("bearerAuth", []);
|
|
126
|
+
|
|
127
|
+
if (tokenString) {
|
|
128
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
const response = await this.request({
|
|
132
|
+
path: `/api/admin/whatsapp/templates/{customerId}/{type}`.replace(`{${"customerId"}}`, encodeURIComponent(String(requestParameters['customerId']))).replace(`{${"type"}}`, encodeURIComponent(String(requestParameters['type']))),
|
|
133
|
+
method: 'GET',
|
|
134
|
+
headers: headerParameters,
|
|
135
|
+
query: queryParameters,
|
|
136
|
+
}, initOverrides);
|
|
137
|
+
|
|
138
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => NotificationTemplateDtoFromJSON(jsonValue));
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Get a specific notification template
|
|
143
|
+
*/
|
|
144
|
+
async getNotificationTemplate(requestParameters: GetNotificationTemplateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<NotificationTemplateDto> {
|
|
145
|
+
const response = await this.getNotificationTemplateRaw(requestParameters, initOverrides);
|
|
146
|
+
return await response.value();
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* List all notification templates (superadmin only)
|
|
151
|
+
*/
|
|
152
|
+
async listAllNotificationTemplatesRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<NotificationTemplateDto>>> {
|
|
153
|
+
const queryParameters: any = {};
|
|
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/whatsapp/templates`,
|
|
167
|
+
method: 'GET',
|
|
168
|
+
headers: headerParameters,
|
|
169
|
+
query: queryParameters,
|
|
170
|
+
}, initOverrides);
|
|
171
|
+
|
|
172
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(NotificationTemplateDtoFromJSON));
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* List all notification templates (superadmin only)
|
|
177
|
+
*/
|
|
178
|
+
async listAllNotificationTemplates(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<NotificationTemplateDto>> {
|
|
179
|
+
const response = await this.listAllNotificationTemplatesRaw(initOverrides);
|
|
180
|
+
return await response.value();
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* List notification templates for a specific customer
|
|
185
|
+
*/
|
|
186
|
+
async listCustomerNotificationTemplatesRaw(requestParameters: ListCustomerNotificationTemplatesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<NotificationTemplateDto>>> {
|
|
187
|
+
if (requestParameters['customerId'] == null) {
|
|
188
|
+
throw new runtime.RequiredError(
|
|
189
|
+
'customerId',
|
|
190
|
+
'Required parameter "customerId" was null or undefined when calling listCustomerNotificationTemplates().'
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
const queryParameters: any = {};
|
|
195
|
+
|
|
196
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
197
|
+
|
|
198
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
199
|
+
const token = this.configuration.accessToken;
|
|
200
|
+
const tokenString = await token("bearerAuth", []);
|
|
201
|
+
|
|
202
|
+
if (tokenString) {
|
|
203
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
const response = await this.request({
|
|
207
|
+
path: `/api/admin/whatsapp/templates/{customerId}`.replace(`{${"customerId"}}`, encodeURIComponent(String(requestParameters['customerId']))),
|
|
208
|
+
method: 'GET',
|
|
209
|
+
headers: headerParameters,
|
|
210
|
+
query: queryParameters,
|
|
211
|
+
}, initOverrides);
|
|
212
|
+
|
|
213
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(NotificationTemplateDtoFromJSON));
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* List notification templates for a specific customer
|
|
218
|
+
*/
|
|
219
|
+
async listCustomerNotificationTemplates(requestParameters: ListCustomerNotificationTemplatesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<NotificationTemplateDto>> {
|
|
220
|
+
const response = await this.listCustomerNotificationTemplatesRaw(requestParameters, initOverrides);
|
|
221
|
+
return await response.value();
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Send a test WhatsApp message using a notification template (superadmin only)
|
|
226
|
+
*/
|
|
227
|
+
async testNotificationTemplateRaw(requestParameters: TestNotificationTemplateOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TestNotificationTemplate200Response>> {
|
|
228
|
+
if (requestParameters['templateId'] == null) {
|
|
229
|
+
throw new runtime.RequiredError(
|
|
230
|
+
'templateId',
|
|
231
|
+
'Required parameter "templateId" was null or undefined when calling testNotificationTemplate().'
|
|
232
|
+
);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
if (requestParameters['testNotificationTemplateRequest'] == null) {
|
|
236
|
+
throw new runtime.RequiredError(
|
|
237
|
+
'testNotificationTemplateRequest',
|
|
238
|
+
'Required parameter "testNotificationTemplateRequest" was null or undefined when calling testNotificationTemplate().'
|
|
239
|
+
);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
const queryParameters: any = {};
|
|
243
|
+
|
|
244
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
245
|
+
|
|
246
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
247
|
+
|
|
248
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
249
|
+
const token = this.configuration.accessToken;
|
|
250
|
+
const tokenString = await token("bearerAuth", []);
|
|
251
|
+
|
|
252
|
+
if (tokenString) {
|
|
253
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
const response = await this.request({
|
|
257
|
+
path: `/api/admin/whatsapp/templates/{templateId}/test`.replace(`{${"templateId"}}`, encodeURIComponent(String(requestParameters['templateId']))),
|
|
258
|
+
method: 'POST',
|
|
259
|
+
headers: headerParameters,
|
|
260
|
+
query: queryParameters,
|
|
261
|
+
body: TestNotificationTemplateRequestToJSON(requestParameters['testNotificationTemplateRequest']),
|
|
262
|
+
}, initOverrides);
|
|
263
|
+
|
|
264
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => TestNotificationTemplate200ResponseFromJSON(jsonValue));
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Send a test WhatsApp message using a notification template (superadmin only)
|
|
269
|
+
*/
|
|
270
|
+
async testNotificationTemplate(requestParameters: TestNotificationTemplateOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TestNotificationTemplate200Response> {
|
|
271
|
+
const response = await this.testNotificationTemplateRaw(requestParameters, initOverrides);
|
|
272
|
+
return await response.value();
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Create or update a notification template (superadmin only)
|
|
277
|
+
*/
|
|
278
|
+
async upsertNotificationTemplateRaw(requestParameters: UpsertNotificationTemplateOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<NotificationTemplateDto>> {
|
|
279
|
+
if (requestParameters['upsertNotificationTemplateRequest'] == null) {
|
|
280
|
+
throw new runtime.RequiredError(
|
|
281
|
+
'upsertNotificationTemplateRequest',
|
|
282
|
+
'Required parameter "upsertNotificationTemplateRequest" was null or undefined when calling upsertNotificationTemplate().'
|
|
283
|
+
);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
const queryParameters: any = {};
|
|
287
|
+
|
|
288
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
289
|
+
|
|
290
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
291
|
+
|
|
292
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
293
|
+
const token = this.configuration.accessToken;
|
|
294
|
+
const tokenString = await token("bearerAuth", []);
|
|
295
|
+
|
|
296
|
+
if (tokenString) {
|
|
297
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
const response = await this.request({
|
|
301
|
+
path: `/api/admin/whatsapp/templates`,
|
|
302
|
+
method: 'POST',
|
|
303
|
+
headers: headerParameters,
|
|
304
|
+
query: queryParameters,
|
|
305
|
+
body: UpsertNotificationTemplateRequestToJSON(requestParameters['upsertNotificationTemplateRequest']),
|
|
306
|
+
}, initOverrides);
|
|
307
|
+
|
|
308
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => NotificationTemplateDtoFromJSON(jsonValue));
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Create or update a notification template (superadmin only)
|
|
313
|
+
*/
|
|
314
|
+
async upsertNotificationTemplate(requestParameters: UpsertNotificationTemplateOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<NotificationTemplateDto> {
|
|
315
|
+
const response = await this.upsertNotificationTemplateRaw(requestParameters, initOverrides);
|
|
316
|
+
return await response.value();
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* @export
|
|
323
|
+
*/
|
|
324
|
+
export const GetNotificationTemplateTypeEnum = {
|
|
325
|
+
Reserve: 'RESERVE',
|
|
326
|
+
Cancellation: 'CANCELLATION',
|
|
327
|
+
Reminder: 'REMINDER',
|
|
328
|
+
PaymentConfirmation: 'PAYMENT_CONFIRMATION'
|
|
329
|
+
} as const;
|
|
330
|
+
export type GetNotificationTemplateTypeEnum = typeof GetNotificationTemplateTypeEnum[keyof typeof GetNotificationTemplateTypeEnum];
|
package/apis/AuthApi.ts
CHANGED
|
@@ -19,7 +19,7 @@ import type {
|
|
|
19
19
|
CreateFromInvite400Response,
|
|
20
20
|
GetSession401Response,
|
|
21
21
|
GetSession500Response,
|
|
22
|
-
|
|
22
|
+
MarkNotificationAsRead200Response,
|
|
23
23
|
RequestPasswordReset500Response,
|
|
24
24
|
RequestPasswordResetRequest,
|
|
25
25
|
ResendEmailVerification500Response,
|
|
@@ -43,8 +43,8 @@ import {
|
|
|
43
43
|
GetSession401ResponseToJSON,
|
|
44
44
|
GetSession500ResponseFromJSON,
|
|
45
45
|
GetSession500ResponseToJSON,
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
MarkNotificationAsRead200ResponseFromJSON,
|
|
47
|
+
MarkNotificationAsRead200ResponseToJSON,
|
|
48
48
|
RequestPasswordReset500ResponseFromJSON,
|
|
49
49
|
RequestPasswordReset500ResponseToJSON,
|
|
50
50
|
RequestPasswordResetRequestFromJSON,
|
|
@@ -252,7 +252,7 @@ export class AuthApi extends runtime.BaseAPI {
|
|
|
252
252
|
/**
|
|
253
253
|
* Request a password reset email
|
|
254
254
|
*/
|
|
255
|
-
async requestPasswordResetRaw(requestParameters: RequestPasswordResetOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<
|
|
255
|
+
async requestPasswordResetRaw(requestParameters: RequestPasswordResetOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MarkNotificationAsRead200Response>> {
|
|
256
256
|
if (requestParameters['requestPasswordResetRequest'] == null) {
|
|
257
257
|
throw new runtime.RequiredError(
|
|
258
258
|
'requestPasswordResetRequest',
|
|
@@ -282,13 +282,13 @@ export class AuthApi extends runtime.BaseAPI {
|
|
|
282
282
|
body: RequestPasswordResetRequestToJSON(requestParameters['requestPasswordResetRequest']),
|
|
283
283
|
}, initOverrides);
|
|
284
284
|
|
|
285
|
-
return new runtime.JSONApiResponse(response, (jsonValue) =>
|
|
285
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => MarkNotificationAsRead200ResponseFromJSON(jsonValue));
|
|
286
286
|
}
|
|
287
287
|
|
|
288
288
|
/**
|
|
289
289
|
* Request a password reset email
|
|
290
290
|
*/
|
|
291
|
-
async requestPasswordReset(requestParameters: RequestPasswordResetOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<
|
|
291
|
+
async requestPasswordReset(requestParameters: RequestPasswordResetOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MarkNotificationAsRead200Response> {
|
|
292
292
|
const response = await this.requestPasswordResetRaw(requestParameters, initOverrides);
|
|
293
293
|
return await response.value();
|
|
294
294
|
}
|
|
@@ -296,7 +296,7 @@ export class AuthApi extends runtime.BaseAPI {
|
|
|
296
296
|
/**
|
|
297
297
|
* Resend email verification link
|
|
298
298
|
*/
|
|
299
|
-
async resendEmailVerificationRaw(requestParameters: ResendEmailVerificationOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<
|
|
299
|
+
async resendEmailVerificationRaw(requestParameters: ResendEmailVerificationOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MarkNotificationAsRead200Response>> {
|
|
300
300
|
if (requestParameters['resendEmailVerificationRequest'] == null) {
|
|
301
301
|
throw new runtime.RequiredError(
|
|
302
302
|
'resendEmailVerificationRequest',
|
|
@@ -326,13 +326,13 @@ export class AuthApi extends runtime.BaseAPI {
|
|
|
326
326
|
body: ResendEmailVerificationRequestToJSON(requestParameters['resendEmailVerificationRequest']),
|
|
327
327
|
}, initOverrides);
|
|
328
328
|
|
|
329
|
-
return new runtime.JSONApiResponse(response, (jsonValue) =>
|
|
329
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => MarkNotificationAsRead200ResponseFromJSON(jsonValue));
|
|
330
330
|
}
|
|
331
331
|
|
|
332
332
|
/**
|
|
333
333
|
* Resend email verification link
|
|
334
334
|
*/
|
|
335
|
-
async resendEmailVerification(requestParameters: ResendEmailVerificationOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<
|
|
335
|
+
async resendEmailVerification(requestParameters: ResendEmailVerificationOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MarkNotificationAsRead200Response> {
|
|
336
336
|
const response = await this.resendEmailVerificationRaw(requestParameters, initOverrides);
|
|
337
337
|
return await response.value();
|
|
338
338
|
}
|
|
@@ -384,7 +384,7 @@ export class AuthApi extends runtime.BaseAPI {
|
|
|
384
384
|
/**
|
|
385
385
|
* Send an email verification link
|
|
386
386
|
*/
|
|
387
|
-
async sendEmailVerificationRaw(requestParameters: SendEmailVerificationOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<
|
|
387
|
+
async sendEmailVerificationRaw(requestParameters: SendEmailVerificationOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MarkNotificationAsRead200Response>> {
|
|
388
388
|
if (requestParameters['sendEmailVerificationRequest'] == null) {
|
|
389
389
|
throw new runtime.RequiredError(
|
|
390
390
|
'sendEmailVerificationRequest',
|
|
@@ -414,13 +414,13 @@ export class AuthApi extends runtime.BaseAPI {
|
|
|
414
414
|
body: SendEmailVerificationRequestToJSON(requestParameters['sendEmailVerificationRequest']),
|
|
415
415
|
}, initOverrides);
|
|
416
416
|
|
|
417
|
-
return new runtime.JSONApiResponse(response, (jsonValue) =>
|
|
417
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => MarkNotificationAsRead200ResponseFromJSON(jsonValue));
|
|
418
418
|
}
|
|
419
419
|
|
|
420
420
|
/**
|
|
421
421
|
* Send an email verification link
|
|
422
422
|
*/
|
|
423
|
-
async sendEmailVerification(requestParameters: SendEmailVerificationOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<
|
|
423
|
+
async sendEmailVerification(requestParameters: SendEmailVerificationOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MarkNotificationAsRead200Response> {
|
|
424
424
|
const response = await this.sendEmailVerificationRaw(requestParameters, initOverrides);
|
|
425
425
|
return await response.value();
|
|
426
426
|
}
|
package/apis/DevicesApi.ts
CHANGED
|
@@ -16,11 +16,14 @@
|
|
|
16
16
|
import * as runtime from '../runtime';
|
|
17
17
|
import type {
|
|
18
18
|
GenerateCode500Response,
|
|
19
|
+
HasDoorlock200Response,
|
|
19
20
|
ReservationAccessCodeResponse,
|
|
20
21
|
} from '../models/index';
|
|
21
22
|
import {
|
|
22
23
|
GenerateCode500ResponseFromJSON,
|
|
23
24
|
GenerateCode500ResponseToJSON,
|
|
25
|
+
HasDoorlock200ResponseFromJSON,
|
|
26
|
+
HasDoorlock200ResponseToJSON,
|
|
24
27
|
ReservationAccessCodeResponseFromJSON,
|
|
25
28
|
ReservationAccessCodeResponseToJSON,
|
|
26
29
|
} from '../models/index';
|
|
@@ -34,6 +37,10 @@ export interface GetCodeRequest {
|
|
|
34
37
|
t: string;
|
|
35
38
|
}
|
|
36
39
|
|
|
40
|
+
export interface HasDoorlockRequest {
|
|
41
|
+
locationId: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
37
44
|
/**
|
|
38
45
|
*
|
|
39
46
|
*/
|
|
@@ -133,4 +140,49 @@ export class DevicesApi extends runtime.BaseAPI {
|
|
|
133
140
|
return await response.value();
|
|
134
141
|
}
|
|
135
142
|
|
|
143
|
+
/**
|
|
144
|
+
* Check if a location has a doorlock device
|
|
145
|
+
*/
|
|
146
|
+
async hasDoorlockRaw(requestParameters: HasDoorlockRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<HasDoorlock200Response>> {
|
|
147
|
+
if (requestParameters['locationId'] == null) {
|
|
148
|
+
throw new runtime.RequiredError(
|
|
149
|
+
'locationId',
|
|
150
|
+
'Required parameter "locationId" was null or undefined when calling hasDoorlock().'
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
const queryParameters: any = {};
|
|
155
|
+
|
|
156
|
+
if (requestParameters['locationId'] != null) {
|
|
157
|
+
queryParameters['locationId'] = requestParameters['locationId'];
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
161
|
+
|
|
162
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
163
|
+
const token = this.configuration.accessToken;
|
|
164
|
+
const tokenString = await token("bearerAuth", []);
|
|
165
|
+
|
|
166
|
+
if (tokenString) {
|
|
167
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
const response = await this.request({
|
|
171
|
+
path: `/api/devices/has-doorlock`,
|
|
172
|
+
method: 'GET',
|
|
173
|
+
headers: headerParameters,
|
|
174
|
+
query: queryParameters,
|
|
175
|
+
}, initOverrides);
|
|
176
|
+
|
|
177
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => HasDoorlock200ResponseFromJSON(jsonValue));
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Check if a location has a doorlock device
|
|
182
|
+
*/
|
|
183
|
+
async hasDoorlock(requestParameters: HasDoorlockRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<HasDoorlock200Response> {
|
|
184
|
+
const response = await this.hasDoorlockRaw(requestParameters, initOverrides);
|
|
185
|
+
return await response.value();
|
|
186
|
+
}
|
|
187
|
+
|
|
136
188
|
}
|
|
@@ -0,0 +1,167 @@
|
|
|
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
|
+
MarkNotificationAsRead200Response,
|
|
19
|
+
NotificationListResponseDto,
|
|
20
|
+
UnreadCountResponseDto,
|
|
21
|
+
} from '../models/index';
|
|
22
|
+
import {
|
|
23
|
+
MarkNotificationAsRead200ResponseFromJSON,
|
|
24
|
+
MarkNotificationAsRead200ResponseToJSON,
|
|
25
|
+
NotificationListResponseDtoFromJSON,
|
|
26
|
+
NotificationListResponseDtoToJSON,
|
|
27
|
+
UnreadCountResponseDtoFromJSON,
|
|
28
|
+
UnreadCountResponseDtoToJSON,
|
|
29
|
+
} from '../models/index';
|
|
30
|
+
|
|
31
|
+
export interface ListNotificationsRequest {
|
|
32
|
+
limit?: number;
|
|
33
|
+
offset?: number;
|
|
34
|
+
unreadOnly?: boolean;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface MarkNotificationAsReadRequest {
|
|
38
|
+
id: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
*
|
|
43
|
+
*/
|
|
44
|
+
export class NotificationsApi extends runtime.BaseAPI {
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Get count of unread notifications for the current user
|
|
48
|
+
*/
|
|
49
|
+
async getUnreadNotificationsCountRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UnreadCountResponseDto>> {
|
|
50
|
+
const queryParameters: any = {};
|
|
51
|
+
|
|
52
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
53
|
+
|
|
54
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
55
|
+
const token = this.configuration.accessToken;
|
|
56
|
+
const tokenString = await token("bearerAuth", []);
|
|
57
|
+
|
|
58
|
+
if (tokenString) {
|
|
59
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
const response = await this.request({
|
|
63
|
+
path: `/api/notifications/unread-count`,
|
|
64
|
+
method: 'GET',
|
|
65
|
+
headers: headerParameters,
|
|
66
|
+
query: queryParameters,
|
|
67
|
+
}, initOverrides);
|
|
68
|
+
|
|
69
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => UnreadCountResponseDtoFromJSON(jsonValue));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Get count of unread notifications for the current user
|
|
74
|
+
*/
|
|
75
|
+
async getUnreadNotificationsCount(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UnreadCountResponseDto> {
|
|
76
|
+
const response = await this.getUnreadNotificationsCountRaw(initOverrides);
|
|
77
|
+
return await response.value();
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* List notifications for the current user
|
|
82
|
+
*/
|
|
83
|
+
async listNotificationsRaw(requestParameters: ListNotificationsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<NotificationListResponseDto>> {
|
|
84
|
+
const queryParameters: any = {};
|
|
85
|
+
|
|
86
|
+
if (requestParameters['limit'] != null) {
|
|
87
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (requestParameters['offset'] != null) {
|
|
91
|
+
queryParameters['offset'] = requestParameters['offset'];
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (requestParameters['unreadOnly'] != null) {
|
|
95
|
+
queryParameters['unreadOnly'] = requestParameters['unreadOnly'];
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
99
|
+
|
|
100
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
101
|
+
const token = this.configuration.accessToken;
|
|
102
|
+
const tokenString = await token("bearerAuth", []);
|
|
103
|
+
|
|
104
|
+
if (tokenString) {
|
|
105
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
const response = await this.request({
|
|
109
|
+
path: `/api/notifications`,
|
|
110
|
+
method: 'GET',
|
|
111
|
+
headers: headerParameters,
|
|
112
|
+
query: queryParameters,
|
|
113
|
+
}, initOverrides);
|
|
114
|
+
|
|
115
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => NotificationListResponseDtoFromJSON(jsonValue));
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* List notifications for the current user
|
|
120
|
+
*/
|
|
121
|
+
async listNotifications(requestParameters: ListNotificationsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<NotificationListResponseDto> {
|
|
122
|
+
const response = await this.listNotificationsRaw(requestParameters, initOverrides);
|
|
123
|
+
return await response.value();
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Mark a notification as read
|
|
128
|
+
*/
|
|
129
|
+
async markNotificationAsReadRaw(requestParameters: MarkNotificationAsReadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MarkNotificationAsRead200Response>> {
|
|
130
|
+
if (requestParameters['id'] == null) {
|
|
131
|
+
throw new runtime.RequiredError(
|
|
132
|
+
'id',
|
|
133
|
+
'Required parameter "id" was null or undefined when calling markNotificationAsRead().'
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
const queryParameters: any = {};
|
|
138
|
+
|
|
139
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
140
|
+
|
|
141
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
142
|
+
const token = this.configuration.accessToken;
|
|
143
|
+
const tokenString = await token("bearerAuth", []);
|
|
144
|
+
|
|
145
|
+
if (tokenString) {
|
|
146
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
const response = await this.request({
|
|
150
|
+
path: `/api/notifications/{id}/read`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
|
151
|
+
method: 'PUT',
|
|
152
|
+
headers: headerParameters,
|
|
153
|
+
query: queryParameters,
|
|
154
|
+
}, initOverrides);
|
|
155
|
+
|
|
156
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => MarkNotificationAsRead200ResponseFromJSON(jsonValue));
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Mark a notification as read
|
|
161
|
+
*/
|
|
162
|
+
async markNotificationAsRead(requestParameters: MarkNotificationAsReadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MarkNotificationAsRead200Response> {
|
|
163
|
+
const response = await this.markNotificationAsReadRaw(requestParameters, initOverrides);
|
|
164
|
+
return await response.value();
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
}
|