@jugarhoy/api 1.0.10 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/apis/UsersApi.ts CHANGED
@@ -16,8 +16,11 @@
16
16
  import * as runtime from '../runtime';
17
17
  import type {
18
18
  CreateUserNotificationDto,
19
+ GetNotificationByType200Response,
20
+ NotificationChannelType,
19
21
  SavePushTokenRequest,
20
22
  Sport,
23
+ ToggleNotificationByType200Response,
21
24
  UpdateUserNotificationDto,
22
25
  User,
23
26
  UserDto,
@@ -29,10 +32,16 @@ import type {
29
32
  import {
30
33
  CreateUserNotificationDtoFromJSON,
31
34
  CreateUserNotificationDtoToJSON,
35
+ GetNotificationByType200ResponseFromJSON,
36
+ GetNotificationByType200ResponseToJSON,
37
+ NotificationChannelTypeFromJSON,
38
+ NotificationChannelTypeToJSON,
32
39
  SavePushTokenRequestFromJSON,
33
40
  SavePushTokenRequestToJSON,
34
41
  SportFromJSON,
35
42
  SportToJSON,
43
+ ToggleNotificationByType200ResponseFromJSON,
44
+ ToggleNotificationByType200ResponseToJSON,
36
45
  UpdateUserNotificationDtoFromJSON,
37
46
  UpdateUserNotificationDtoToJSON,
38
47
  UserFromJSON,
@@ -61,6 +70,10 @@ export interface DeleteUserNotificationRequest {
61
70
  notificationId: string;
62
71
  }
63
72
 
73
+ export interface GetNotificationByTypeRequest {
74
+ type: NotificationChannelType;
75
+ }
76
+
64
77
  export interface GetUserByEmailRequest {
65
78
  email: string;
66
79
  }
@@ -78,6 +91,10 @@ export interface SavePushTokenOperationRequest {
78
91
  savePushTokenRequest: SavePushTokenRequest;
79
92
  }
80
93
 
94
+ export interface ToggleNotificationByTypeRequest {
95
+ type: NotificationChannelType;
96
+ }
97
+
81
98
  export interface ToggleUserNotificationRequest {
82
99
  notificationId: string;
83
100
  }
@@ -236,6 +253,47 @@ export class UsersApi extends runtime.BaseAPI {
236
253
  await this.deleteUserNotificationRaw(requestParameters, initOverrides);
237
254
  }
238
255
 
256
+ /**
257
+ * Get notification status for a specific type
258
+ */
259
+ async getNotificationByTypeRaw(requestParameters: GetNotificationByTypeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetNotificationByType200Response>> {
260
+ if (requestParameters['type'] == null) {
261
+ throw new runtime.RequiredError(
262
+ 'type',
263
+ 'Required parameter "type" was null or undefined when calling getNotificationByType().'
264
+ );
265
+ }
266
+
267
+ const queryParameters: any = {};
268
+
269
+ const headerParameters: runtime.HTTPHeaders = {};
270
+
271
+ if (this.configuration && this.configuration.accessToken) {
272
+ const token = this.configuration.accessToken;
273
+ const tokenString = await token("bearerAuth", []);
274
+
275
+ if (tokenString) {
276
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
277
+ }
278
+ }
279
+ const response = await this.request({
280
+ path: `/api/users/notifications/type/{type}`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters['type']))),
281
+ method: 'GET',
282
+ headers: headerParameters,
283
+ query: queryParameters,
284
+ }, initOverrides);
285
+
286
+ return new runtime.JSONApiResponse(response, (jsonValue) => GetNotificationByType200ResponseFromJSON(jsonValue));
287
+ }
288
+
289
+ /**
290
+ * Get notification status for a specific type
291
+ */
292
+ async getNotificationByType(requestParameters: GetNotificationByTypeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetNotificationByType200Response> {
293
+ const response = await this.getNotificationByTypeRaw(requestParameters, initOverrides);
294
+ return await response.value();
295
+ }
296
+
239
297
  /**
240
298
  * Retrieve a user by email
241
299
  */
@@ -444,6 +502,47 @@ export class UsersApi extends runtime.BaseAPI {
444
502
  return await response.value();
445
503
  }
446
504
 
505
+ /**
506
+ * Toggle a notification type (creates if doesn\'t exist, toggles if exists)
507
+ */
508
+ async toggleNotificationByTypeRaw(requestParameters: ToggleNotificationByTypeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ToggleNotificationByType200Response>> {
509
+ if (requestParameters['type'] == null) {
510
+ throw new runtime.RequiredError(
511
+ 'type',
512
+ 'Required parameter "type" was null or undefined when calling toggleNotificationByType().'
513
+ );
514
+ }
515
+
516
+ const queryParameters: any = {};
517
+
518
+ const headerParameters: runtime.HTTPHeaders = {};
519
+
520
+ if (this.configuration && this.configuration.accessToken) {
521
+ const token = this.configuration.accessToken;
522
+ const tokenString = await token("bearerAuth", []);
523
+
524
+ if (tokenString) {
525
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
526
+ }
527
+ }
528
+ const response = await this.request({
529
+ path: `/api/users/notifications/type/{type}/toggle`.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters['type']))),
530
+ method: 'PUT',
531
+ headers: headerParameters,
532
+ query: queryParameters,
533
+ }, initOverrides);
534
+
535
+ return new runtime.JSONApiResponse(response, (jsonValue) => ToggleNotificationByType200ResponseFromJSON(jsonValue));
536
+ }
537
+
538
+ /**
539
+ * Toggle a notification type (creates if doesn\'t exist, toggles if exists)
540
+ */
541
+ async toggleNotificationByType(requestParameters: ToggleNotificationByTypeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ToggleNotificationByType200Response> {
542
+ const response = await this.toggleNotificationByTypeRaw(requestParameters, initOverrides);
543
+ return await response.value();
544
+ }
545
+
447
546
  /**
448
547
  * Toggle the enabled state of a notification preference
449
548
  */
@@ -0,0 +1,73 @@
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 GetNotificationByType200Response
20
+ */
21
+ export interface GetNotificationByType200Response {
22
+ /**
23
+ * Whether this notification type is enabled
24
+ * @type {boolean}
25
+ * @memberof GetNotificationByType200Response
26
+ */
27
+ enabled?: boolean;
28
+ /**
29
+ * Optional subscription information
30
+ * @type {{ [key: string]: any; }}
31
+ * @memberof GetNotificationByType200Response
32
+ */
33
+ subscriptionId?: { [key: string]: any; };
34
+ }
35
+
36
+ /**
37
+ * Check if a given object implements the GetNotificationByType200Response interface.
38
+ */
39
+ export function instanceOfGetNotificationByType200Response(value: object): value is GetNotificationByType200Response {
40
+ return true;
41
+ }
42
+
43
+ export function GetNotificationByType200ResponseFromJSON(json: any): GetNotificationByType200Response {
44
+ return GetNotificationByType200ResponseFromJSONTyped(json, false);
45
+ }
46
+
47
+ export function GetNotificationByType200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetNotificationByType200Response {
48
+ if (json == null) {
49
+ return json;
50
+ }
51
+ return {
52
+
53
+ 'enabled': json['enabled'] == null ? undefined : json['enabled'],
54
+ 'subscriptionId': json['subscriptionId'] == null ? undefined : json['subscriptionId'],
55
+ };
56
+ }
57
+
58
+ export function GetNotificationByType200ResponseToJSON(json: any): GetNotificationByType200Response {
59
+ return GetNotificationByType200ResponseToJSONTyped(json, false);
60
+ }
61
+
62
+ export function GetNotificationByType200ResponseToJSONTyped(value?: GetNotificationByType200Response | null, ignoreDiscriminator: boolean = false): any {
63
+ if (value == null) {
64
+ return value;
65
+ }
66
+
67
+ return {
68
+
69
+ 'enabled': value['enabled'],
70
+ 'subscriptionId': value['subscriptionId'],
71
+ };
72
+ }
73
+
@@ -21,7 +21,8 @@ export const NotificationChannelType = {
21
21
  Whatsapp: 'WHATSAPP',
22
22
  PushWeb: 'PUSH_WEB',
23
23
  PushNative: 'PUSH_NATIVE',
24
- Email: 'EMAIL'
24
+ Email: 'EMAIL',
25
+ Falta1: 'FALTA1'
25
26
  } as const;
26
27
  export type NotificationChannelType = typeof NotificationChannelType[keyof typeof NotificationChannelType];
27
28
 
@@ -43,6 +43,18 @@ export interface PlaySearchDetailDTOAllOfUser {
43
43
  * @memberof PlaySearchDetailDTOAllOfUser
44
44
  */
45
45
  avatarUrl?: string | null;
46
+ /**
47
+ * Only included for search owners
48
+ * @type {string}
49
+ * @memberof PlaySearchDetailDTOAllOfUser
50
+ */
51
+ email?: string;
52
+ /**
53
+ * Only included for search owners
54
+ * @type {string}
55
+ * @memberof PlaySearchDetailDTOAllOfUser
56
+ */
57
+ phone?: string | null;
46
58
  }
47
59
 
48
60
  /**
@@ -66,6 +78,8 @@ export function PlaySearchDetailDTOAllOfUserFromJSONTyped(json: any, ignoreDiscr
66
78
  'firstName': json['firstName'] == null ? undefined : json['firstName'],
67
79
  'lastName': json['lastName'] == null ? undefined : json['lastName'],
68
80
  'avatarUrl': json['avatarUrl'] == null ? undefined : json['avatarUrl'],
81
+ 'email': json['email'] == null ? undefined : json['email'],
82
+ 'phone': json['phone'] == null ? undefined : json['phone'],
69
83
  };
70
84
  }
71
85
 
@@ -84,6 +98,8 @@ export function PlaySearchDetailDTOAllOfUserToJSONTyped(value?: PlaySearchDetail
84
98
  'firstName': value['firstName'],
85
99
  'lastName': value['lastName'],
86
100
  'avatarUrl': value['avatarUrl'],
101
+ 'email': value['email'],
102
+ 'phone': value['phone'],
87
103
  };
88
104
  }
89
105
 
@@ -0,0 +1,65 @@
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 ToggleNotificationByType200Response
20
+ */
21
+ export interface ToggleNotificationByType200Response {
22
+ /**
23
+ * The new enabled state
24
+ * @type {boolean}
25
+ * @memberof ToggleNotificationByType200Response
26
+ */
27
+ enabled?: boolean;
28
+ }
29
+
30
+ /**
31
+ * Check if a given object implements the ToggleNotificationByType200Response interface.
32
+ */
33
+ export function instanceOfToggleNotificationByType200Response(value: object): value is ToggleNotificationByType200Response {
34
+ return true;
35
+ }
36
+
37
+ export function ToggleNotificationByType200ResponseFromJSON(json: any): ToggleNotificationByType200Response {
38
+ return ToggleNotificationByType200ResponseFromJSONTyped(json, false);
39
+ }
40
+
41
+ export function ToggleNotificationByType200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ToggleNotificationByType200Response {
42
+ if (json == null) {
43
+ return json;
44
+ }
45
+ return {
46
+
47
+ 'enabled': json['enabled'] == null ? undefined : json['enabled'],
48
+ };
49
+ }
50
+
51
+ export function ToggleNotificationByType200ResponseToJSON(json: any): ToggleNotificationByType200Response {
52
+ return ToggleNotificationByType200ResponseToJSONTyped(json, false);
53
+ }
54
+
55
+ export function ToggleNotificationByType200ResponseToJSONTyped(value?: ToggleNotificationByType200Response | null, ignoreDiscriminator: boolean = false): any {
56
+ if (value == null) {
57
+ return value;
58
+ }
59
+
60
+ return {
61
+
62
+ 'enabled': value['enabled'],
63
+ };
64
+ }
65
+
package/models/index.ts CHANGED
@@ -91,6 +91,7 @@ export * from './GetAllShifts200ResponseInner';
91
91
  export * from './GetHourlyReservationStatus200Response';
92
92
  export * from './GetHourlyReservationStatus200ResponseHourlyStatusInner';
93
93
  export * from './GetMercadoPagoAuthUrl200Response';
94
+ export * from './GetNotificationByType200Response';
94
95
  export * from './GetSession401Response';
95
96
  export * from './GetSession500Response';
96
97
  export * from './HasDoorlock200Response';
@@ -201,6 +202,7 @@ export * from './SuccessResponse';
201
202
  export * from './TestNotificationTemplate200Response';
202
203
  export * from './TestNotificationTemplateRequest';
203
204
  export * from './TimeOfDay';
205
+ export * from './ToggleNotificationByType200Response';
204
206
  export * from './ToggleServiceConfigRequest';
205
207
  export * from './TriggerDeviceAction200Response';
206
208
  export * from './TriggerDeviceActionRequest';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jugarhoy/api",
3
- "version": "1.0.10",
3
+ "version": "1.1.1",
4
4
  "description": "TypeScript SDK for Jugar Hoy API",
5
5
  "main": "index.ts",
6
6
  "types": "index.ts",
@@ -32,4 +32,4 @@
32
32
  "url": "https://github.com/jugarhoy/jugarhoy.git",
33
33
  "directory": "sdk/ts"
34
34
  }
35
- }
35
+ }