@zyphr-dev/node-sdk 0.1.8 → 0.1.10

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.
@@ -15,18 +15,29 @@
15
15
 
16
16
  import * as runtime from '../runtime';
17
17
  import type {
18
+ ApiError,
19
+ GenerateSubscriberToken200Response,
20
+ GenerateSubscriberTokenRequest,
18
21
  InboxListResponse,
19
22
  InboxNotificationResponse,
20
23
  MarkAllInboxReadRequest,
21
24
  MarkAllReadResponse,
25
+ MarkAllSubscriberNotificationsReadRequest,
22
26
  MarkInboxReadRequest,
23
27
  SendBatchInAppRequest,
24
28
  SendBatchInAppResponse,
25
29
  SendInAppRequest,
26
30
  SendInAppResponse,
27
31
  UnreadCountResponse,
32
+ UpdateSubscriberPreferencesRequest,
28
33
  } from '../models/index';
29
34
  import {
35
+ ApiErrorFromJSON,
36
+ ApiErrorToJSON,
37
+ GenerateSubscriberToken200ResponseFromJSON,
38
+ GenerateSubscriberToken200ResponseToJSON,
39
+ GenerateSubscriberTokenRequestFromJSON,
40
+ GenerateSubscriberTokenRequestToJSON,
30
41
  InboxListResponseFromJSON,
31
42
  InboxListResponseToJSON,
32
43
  InboxNotificationResponseFromJSON,
@@ -35,6 +46,8 @@ import {
35
46
  MarkAllInboxReadRequestToJSON,
36
47
  MarkAllReadResponseFromJSON,
37
48
  MarkAllReadResponseToJSON,
49
+ MarkAllSubscriberNotificationsReadRequestFromJSON,
50
+ MarkAllSubscriberNotificationsReadRequestToJSON,
38
51
  MarkInboxReadRequestFromJSON,
39
52
  MarkInboxReadRequestToJSON,
40
53
  SendBatchInAppRequestFromJSON,
@@ -47,6 +60,8 @@ import {
47
60
  SendInAppResponseToJSON,
48
61
  UnreadCountResponseFromJSON,
49
62
  UnreadCountResponseToJSON,
63
+ UpdateSubscriberPreferencesRequestFromJSON,
64
+ UpdateSubscriberPreferencesRequestToJSON,
50
65
  } from '../models/index';
51
66
 
52
67
  export interface InboxApiArchiveInboxNotificationRequest {
@@ -54,18 +69,34 @@ export interface InboxApiArchiveInboxNotificationRequest {
54
69
  markInboxReadRequest?: MarkInboxReadRequest;
55
70
  }
56
71
 
72
+ export interface InboxApiArchiveSubscriberNotificationRequest {
73
+ id: string;
74
+ }
75
+
57
76
  export interface InboxApiDeleteInboxNotificationRequest {
58
77
  id: string;
59
78
  subscriberId?: string;
60
79
  externalId?: string;
61
80
  }
62
81
 
82
+ export interface InboxApiDeleteSubscriberNotificationRequest {
83
+ id: string;
84
+ }
85
+
86
+ export interface InboxApiGenerateSubscriberTokenOperationRequest {
87
+ generateSubscriberTokenRequest: GenerateSubscriberTokenRequest;
88
+ }
89
+
63
90
  export interface InboxApiGetInboxNotificationRequest {
64
91
  id: string;
65
92
  subscriberId?: string;
66
93
  externalId?: string;
67
94
  }
68
95
 
96
+ export interface InboxApiGetSubscriberNotificationRequest {
97
+ id: string;
98
+ }
99
+
69
100
  export interface InboxApiGetUnreadCountRequest {
70
101
  subscriberId?: string;
71
102
  externalId?: string;
@@ -82,15 +113,31 @@ export interface InboxApiListInboxRequest {
82
113
  cursor?: string;
83
114
  }
84
115
 
116
+ export interface InboxApiListSubscriberNotificationsRequest {
117
+ category?: string;
118
+ includeRead?: boolean;
119
+ includeArchived?: boolean;
120
+ limit?: number;
121
+ cursor?: string;
122
+ }
123
+
85
124
  export interface InboxApiMarkAllInboxReadOperationRequest {
86
125
  markAllInboxReadRequest: MarkAllInboxReadRequest;
87
126
  }
88
127
 
128
+ export interface InboxApiMarkAllSubscriberNotificationsReadOperationRequest {
129
+ markAllSubscriberNotificationsReadRequest?: MarkAllSubscriberNotificationsReadRequest;
130
+ }
131
+
89
132
  export interface InboxApiMarkInboxReadOperationRequest {
90
133
  id: string;
91
134
  markInboxReadRequest?: MarkInboxReadRequest;
92
135
  }
93
136
 
137
+ export interface InboxApiMarkSubscriberNotificationReadRequest {
138
+ id: string;
139
+ }
140
+
94
141
  export interface InboxApiSendBatchInAppOperationRequest {
95
142
  sendBatchInAppRequest: SendBatchInAppRequest;
96
143
  }
@@ -99,6 +146,10 @@ export interface InboxApiSendInAppOperationRequest {
99
146
  sendInAppRequest: SendInAppRequest;
100
147
  }
101
148
 
149
+ export interface InboxApiUpdateSubscriberPreferencesOperationRequest {
150
+ updateSubscriberPreferencesRequest: UpdateSubscriberPreferencesRequest;
151
+ }
152
+
102
153
  /**
103
154
  * InboxApi - interface
104
155
  *
@@ -123,6 +174,21 @@ export interface InboxApiInterface {
123
174
  */
124
175
  archiveInboxNotification(id: string, markInboxReadRequest?: MarkInboxReadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<InboxNotificationResponse>;
125
176
 
177
+ /**
178
+ *
179
+ * @summary Archive a notification
180
+ * @param {string} id
181
+ * @param {*} [options] Override http request option.
182
+ * @throws {RequiredError}
183
+ * @memberof InboxApiInterface
184
+ */
185
+ archiveSubscriberNotificationRaw(requestParameters: InboxApiArchiveSubscriberNotificationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
186
+
187
+ /**
188
+ * Archive a notification
189
+ */
190
+ archiveSubscriberNotification(id: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
191
+
126
192
  /**
127
193
  * Permanently delete an in-app notification.
128
194
  * @summary Delete a notification
@@ -141,6 +207,37 @@ export interface InboxApiInterface {
141
207
  */
142
208
  deleteInboxNotification(id: string, subscriberId?: string, externalId?: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
143
209
 
210
+ /**
211
+ *
212
+ * @summary Delete a notification
213
+ * @param {string} id
214
+ * @param {*} [options] Override http request option.
215
+ * @throws {RequiredError}
216
+ * @memberof InboxApiInterface
217
+ */
218
+ deleteSubscriberNotificationRaw(requestParameters: InboxApiDeleteSubscriberNotificationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
219
+
220
+ /**
221
+ * Delete a notification
222
+ */
223
+ deleteSubscriberNotification(id: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
224
+
225
+ /**
226
+ * Generate a JWT token for client-side inbox authentication. This is a server-side call that requires your API key. Pass the returned token to `@zyphr/inbox-react`\'s `<ZyphrProvider subscriberToken=\"...\">` or use it as `Authorization: Bearer <token>` for client-side inbox API calls and WebSocket connections. The token expires in 7 days.
227
+ * @summary Generate a subscriber token
228
+ * @param {GenerateSubscriberTokenRequest} generateSubscriberTokenRequest
229
+ * @param {*} [options] Override http request option.
230
+ * @throws {RequiredError}
231
+ * @memberof InboxApiInterface
232
+ */
233
+ generateSubscriberTokenRaw(requestParameters: InboxApiGenerateSubscriberTokenOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GenerateSubscriberToken200Response>>;
234
+
235
+ /**
236
+ * Generate a JWT token for client-side inbox authentication. This is a server-side call that requires your API key. Pass the returned token to `@zyphr/inbox-react`\'s `<ZyphrProvider subscriberToken=\"...\">` or use it as `Authorization: Bearer <token>` for client-side inbox API calls and WebSocket connections. The token expires in 7 days.
237
+ * Generate a subscriber token
238
+ */
239
+ generateSubscriberToken(generateSubscriberTokenRequest: GenerateSubscriberTokenRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GenerateSubscriberToken200Response>;
240
+
144
241
  /**
145
242
  * Get a specific in-app notification by ID.
146
243
  * @summary Get a notification
@@ -159,6 +256,52 @@ export interface InboxApiInterface {
159
256
  */
160
257
  getInboxNotification(id: string, subscriberId?: string, externalId?: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<InboxNotificationResponse>;
161
258
 
259
+ /**
260
+ * Get notification preferences grouped by category for the authenticated subscriber.
261
+ * @summary Get subscriber preferences
262
+ * @param {*} [options] Override http request option.
263
+ * @throws {RequiredError}
264
+ * @memberof InboxApiInterface
265
+ */
266
+ getSubscriberInboxPreferencesRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
267
+
268
+ /**
269
+ * Get notification preferences grouped by category for the authenticated subscriber.
270
+ * Get subscriber preferences
271
+ */
272
+ getSubscriberInboxPreferences(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
273
+
274
+ /**
275
+ * Get a specific notification by ID for the authenticated subscriber.
276
+ * @summary Get a notification
277
+ * @param {string} id
278
+ * @param {*} [options] Override http request option.
279
+ * @throws {RequiredError}
280
+ * @memberof InboxApiInterface
281
+ */
282
+ getSubscriberNotificationRaw(requestParameters: InboxApiGetSubscriberNotificationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
283
+
284
+ /**
285
+ * Get a specific notification by ID for the authenticated subscriber.
286
+ * Get a notification
287
+ */
288
+ getSubscriberNotification(id: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
289
+
290
+ /**
291
+ * Get the unread notification count for the authenticated subscriber.
292
+ * @summary Get unread count
293
+ * @param {*} [options] Override http request option.
294
+ * @throws {RequiredError}
295
+ * @memberof InboxApiInterface
296
+ */
297
+ getSubscriberUnreadCountRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
298
+
299
+ /**
300
+ * Get the unread notification count for the authenticated subscriber.
301
+ * Get unread count
302
+ */
303
+ getSubscriberUnreadCount(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
304
+
162
305
  /**
163
306
  * Get the count of unread in-app notifications for a subscriber.
164
307
  * @summary Get unread notification count
@@ -199,6 +342,26 @@ export interface InboxApiInterface {
199
342
  */
200
343
  listInbox(subscriberId?: string, externalId?: string, category?: string, includeRead?: boolean, includeArchived?: boolean, limit?: number, offset?: number, cursor?: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<InboxListResponse>;
201
344
 
345
+ /**
346
+ * List notifications for the authenticated subscriber. Supports cursor-based pagination.
347
+ * @summary List subscriber notifications
348
+ * @param {string} [category] Filter by notification category
349
+ * @param {boolean} [includeRead] Include read notifications
350
+ * @param {boolean} [includeArchived] Include archived notifications
351
+ * @param {number} [limit]
352
+ * @param {string} [cursor] Pagination cursor from previous response
353
+ * @param {*} [options] Override http request option.
354
+ * @throws {RequiredError}
355
+ * @memberof InboxApiInterface
356
+ */
357
+ listSubscriberNotificationsRaw(requestParameters: InboxApiListSubscriberNotificationsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
358
+
359
+ /**
360
+ * List notifications for the authenticated subscriber. Supports cursor-based pagination.
361
+ * List subscriber notifications
362
+ */
363
+ listSubscriberNotifications(category?: string, includeRead?: boolean, includeArchived?: boolean, limit?: number, cursor?: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
364
+
202
365
  /**
203
366
  * Mark all unread in-app notifications as read for a subscriber. Optionally filter by category.
204
367
  * @summary Mark all notifications as read
@@ -215,6 +378,21 @@ export interface InboxApiInterface {
215
378
  */
216
379
  markAllInboxRead(markAllInboxReadRequest: MarkAllInboxReadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MarkAllReadResponse>;
217
380
 
381
+ /**
382
+ *
383
+ * @summary Mark all notifications as read
384
+ * @param {MarkAllSubscriberNotificationsReadRequest} [markAllSubscriberNotificationsReadRequest]
385
+ * @param {*} [options] Override http request option.
386
+ * @throws {RequiredError}
387
+ * @memberof InboxApiInterface
388
+ */
389
+ markAllSubscriberNotificationsReadRaw(requestParameters: InboxApiMarkAllSubscriberNotificationsReadOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
390
+
391
+ /**
392
+ * Mark all notifications as read
393
+ */
394
+ markAllSubscriberNotificationsRead(markAllSubscriberNotificationsReadRequest?: MarkAllSubscriberNotificationsReadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
395
+
218
396
  /**
219
397
  * Mark a specific in-app notification as read.
220
398
  * @summary Mark notification as read
@@ -232,6 +410,21 @@ export interface InboxApiInterface {
232
410
  */
233
411
  markInboxRead(id: string, markInboxReadRequest?: MarkInboxReadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<InboxNotificationResponse>;
234
412
 
413
+ /**
414
+ *
415
+ * @summary Mark notification as read
416
+ * @param {string} id
417
+ * @param {*} [options] Override http request option.
418
+ * @throws {RequiredError}
419
+ * @memberof InboxApiInterface
420
+ */
421
+ markSubscriberNotificationReadRaw(requestParameters: InboxApiMarkSubscriberNotificationReadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
422
+
423
+ /**
424
+ * Mark notification as read
425
+ */
426
+ markSubscriberNotificationRead(id: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
427
+
235
428
  /**
236
429
  * Send in-app notifications to multiple subscribers in a single request (max 100).
237
430
  * @summary Send batch in-app notifications
@@ -264,6 +457,22 @@ export interface InboxApiInterface {
264
457
  */
265
458
  sendInApp(sendInAppRequest: SendInAppRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SendInAppResponse>;
266
459
 
460
+ /**
461
+ * Update notification channel preferences for specific categories or globally.
462
+ * @summary Update subscriber preferences
463
+ * @param {UpdateSubscriberPreferencesRequest} updateSubscriberPreferencesRequest
464
+ * @param {*} [options] Override http request option.
465
+ * @throws {RequiredError}
466
+ * @memberof InboxApiInterface
467
+ */
468
+ updateSubscriberPreferencesRaw(requestParameters: InboxApiUpdateSubscriberPreferencesOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
469
+
470
+ /**
471
+ * Update notification channel preferences for specific categories or globally.
472
+ * Update subscriber preferences
473
+ */
474
+ updateSubscriberPreferences(updateSubscriberPreferencesRequest: UpdateSubscriberPreferencesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
475
+
267
476
  }
268
477
 
269
478
  /**
@@ -313,6 +522,46 @@ export class InboxApi extends runtime.BaseAPI implements InboxApiInterface {
313
522
  return await response.value();
314
523
  }
315
524
 
525
+ /**
526
+ * Archive a notification
527
+ */
528
+ async archiveSubscriberNotificationRaw(requestParameters: InboxApiArchiveSubscriberNotificationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
529
+ if (requestParameters['id'] == null) {
530
+ throw new runtime.RequiredError(
531
+ 'id',
532
+ 'Required parameter "id" was null or undefined when calling archiveSubscriberNotification().'
533
+ );
534
+ }
535
+
536
+ const queryParameters: any = {};
537
+
538
+ const headerParameters: runtime.HTTPHeaders = {};
539
+
540
+ if (this.configuration && this.configuration.accessToken) {
541
+ const token = this.configuration.accessToken;
542
+ const tokenString = await token("EndUserToken", []);
543
+
544
+ if (tokenString) {
545
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
546
+ }
547
+ }
548
+ const response = await this.request({
549
+ path: `/subscriber-inbox/{id}/archive`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
550
+ method: 'POST',
551
+ headers: headerParameters,
552
+ query: queryParameters,
553
+ }, initOverrides);
554
+
555
+ return new runtime.VoidApiResponse(response);
556
+ }
557
+
558
+ /**
559
+ * Archive a notification
560
+ */
561
+ async archiveSubscriberNotification(id: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
562
+ await this.archiveSubscriberNotificationRaw({ id: id }, initOverrides);
563
+ }
564
+
316
565
  /**
317
566
  * Permanently delete an in-app notification.
318
567
  * Delete a notification
@@ -359,6 +608,88 @@ export class InboxApi extends runtime.BaseAPI implements InboxApiInterface {
359
608
  await this.deleteInboxNotificationRaw({ id: id, subscriberId: subscriberId, externalId: externalId }, initOverrides);
360
609
  }
361
610
 
611
+ /**
612
+ * Delete a notification
613
+ */
614
+ async deleteSubscriberNotificationRaw(requestParameters: InboxApiDeleteSubscriberNotificationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
615
+ if (requestParameters['id'] == null) {
616
+ throw new runtime.RequiredError(
617
+ 'id',
618
+ 'Required parameter "id" was null or undefined when calling deleteSubscriberNotification().'
619
+ );
620
+ }
621
+
622
+ const queryParameters: any = {};
623
+
624
+ const headerParameters: runtime.HTTPHeaders = {};
625
+
626
+ if (this.configuration && this.configuration.accessToken) {
627
+ const token = this.configuration.accessToken;
628
+ const tokenString = await token("EndUserToken", []);
629
+
630
+ if (tokenString) {
631
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
632
+ }
633
+ }
634
+ const response = await this.request({
635
+ path: `/subscriber-inbox/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
636
+ method: 'DELETE',
637
+ headers: headerParameters,
638
+ query: queryParameters,
639
+ }, initOverrides);
640
+
641
+ return new runtime.VoidApiResponse(response);
642
+ }
643
+
644
+ /**
645
+ * Delete a notification
646
+ */
647
+ async deleteSubscriberNotification(id: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
648
+ await this.deleteSubscriberNotificationRaw({ id: id }, initOverrides);
649
+ }
650
+
651
+ /**
652
+ * Generate a JWT token for client-side inbox authentication. This is a server-side call that requires your API key. Pass the returned token to `@zyphr/inbox-react`\'s `<ZyphrProvider subscriberToken=\"...\">` or use it as `Authorization: Bearer <token>` for client-side inbox API calls and WebSocket connections. The token expires in 7 days.
653
+ * Generate a subscriber token
654
+ */
655
+ async generateSubscriberTokenRaw(requestParameters: InboxApiGenerateSubscriberTokenOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GenerateSubscriberToken200Response>> {
656
+ if (requestParameters['generateSubscriberTokenRequest'] == null) {
657
+ throw new runtime.RequiredError(
658
+ 'generateSubscriberTokenRequest',
659
+ 'Required parameter "generateSubscriberTokenRequest" was null or undefined when calling generateSubscriberToken().'
660
+ );
661
+ }
662
+
663
+ const queryParameters: any = {};
664
+
665
+ const headerParameters: runtime.HTTPHeaders = {};
666
+
667
+ headerParameters['Content-Type'] = 'application/json';
668
+
669
+ if (this.configuration && this.configuration.apiKey) {
670
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
671
+ }
672
+
673
+ const response = await this.request({
674
+ path: `/subscriber-inbox/token`,
675
+ method: 'POST',
676
+ headers: headerParameters,
677
+ query: queryParameters,
678
+ body: GenerateSubscriberTokenRequestToJSON(requestParameters['generateSubscriberTokenRequest']),
679
+ }, initOverrides);
680
+
681
+ return new runtime.JSONApiResponse(response, (jsonValue) => GenerateSubscriberToken200ResponseFromJSON(jsonValue));
682
+ }
683
+
684
+ /**
685
+ * Generate a JWT token for client-side inbox authentication. This is a server-side call that requires your API key. Pass the returned token to `@zyphr/inbox-react`\'s `<ZyphrProvider subscriberToken=\"...\">` or use it as `Authorization: Bearer <token>` for client-side inbox API calls and WebSocket connections. The token expires in 7 days.
686
+ * Generate a subscriber token
687
+ */
688
+ async generateSubscriberToken(generateSubscriberTokenRequest: GenerateSubscriberTokenRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GenerateSubscriberToken200Response> {
689
+ const response = await this.generateSubscriberTokenRaw({ generateSubscriberTokenRequest: generateSubscriberTokenRequest }, initOverrides);
690
+ return await response.value();
691
+ }
692
+
362
693
  /**
363
694
  * Get a specific in-app notification by ID.
364
695
  * Get a notification
@@ -406,6 +737,118 @@ export class InboxApi extends runtime.BaseAPI implements InboxApiInterface {
406
737
  return await response.value();
407
738
  }
408
739
 
740
+ /**
741
+ * Get notification preferences grouped by category for the authenticated subscriber.
742
+ * Get subscriber preferences
743
+ */
744
+ async getSubscriberInboxPreferencesRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
745
+ const queryParameters: any = {};
746
+
747
+ const headerParameters: runtime.HTTPHeaders = {};
748
+
749
+ if (this.configuration && this.configuration.accessToken) {
750
+ const token = this.configuration.accessToken;
751
+ const tokenString = await token("EndUserToken", []);
752
+
753
+ if (tokenString) {
754
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
755
+ }
756
+ }
757
+ const response = await this.request({
758
+ path: `/subscriber-inbox/preferences`,
759
+ method: 'GET',
760
+ headers: headerParameters,
761
+ query: queryParameters,
762
+ }, initOverrides);
763
+
764
+ return new runtime.VoidApiResponse(response);
765
+ }
766
+
767
+ /**
768
+ * Get notification preferences grouped by category for the authenticated subscriber.
769
+ * Get subscriber preferences
770
+ */
771
+ async getSubscriberInboxPreferences(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
772
+ await this.getSubscriberInboxPreferencesRaw(initOverrides);
773
+ }
774
+
775
+ /**
776
+ * Get a specific notification by ID for the authenticated subscriber.
777
+ * Get a notification
778
+ */
779
+ async getSubscriberNotificationRaw(requestParameters: InboxApiGetSubscriberNotificationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
780
+ if (requestParameters['id'] == null) {
781
+ throw new runtime.RequiredError(
782
+ 'id',
783
+ 'Required parameter "id" was null or undefined when calling getSubscriberNotification().'
784
+ );
785
+ }
786
+
787
+ const queryParameters: any = {};
788
+
789
+ const headerParameters: runtime.HTTPHeaders = {};
790
+
791
+ if (this.configuration && this.configuration.accessToken) {
792
+ const token = this.configuration.accessToken;
793
+ const tokenString = await token("EndUserToken", []);
794
+
795
+ if (tokenString) {
796
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
797
+ }
798
+ }
799
+ const response = await this.request({
800
+ path: `/subscriber-inbox/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
801
+ method: 'GET',
802
+ headers: headerParameters,
803
+ query: queryParameters,
804
+ }, initOverrides);
805
+
806
+ return new runtime.VoidApiResponse(response);
807
+ }
808
+
809
+ /**
810
+ * Get a specific notification by ID for the authenticated subscriber.
811
+ * Get a notification
812
+ */
813
+ async getSubscriberNotification(id: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
814
+ await this.getSubscriberNotificationRaw({ id: id }, initOverrides);
815
+ }
816
+
817
+ /**
818
+ * Get the unread notification count for the authenticated subscriber.
819
+ * Get unread count
820
+ */
821
+ async getSubscriberUnreadCountRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
822
+ const queryParameters: any = {};
823
+
824
+ const headerParameters: runtime.HTTPHeaders = {};
825
+
826
+ if (this.configuration && this.configuration.accessToken) {
827
+ const token = this.configuration.accessToken;
828
+ const tokenString = await token("EndUserToken", []);
829
+
830
+ if (tokenString) {
831
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
832
+ }
833
+ }
834
+ const response = await this.request({
835
+ path: `/subscriber-inbox/unread-count`,
836
+ method: 'GET',
837
+ headers: headerParameters,
838
+ query: queryParameters,
839
+ }, initOverrides);
840
+
841
+ return new runtime.VoidApiResponse(response);
842
+ }
843
+
844
+ /**
845
+ * Get the unread notification count for the authenticated subscriber.
846
+ * Get unread count
847
+ */
848
+ async getSubscriberUnreadCount(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
849
+ await this.getSubscriberUnreadCountRaw(initOverrides);
850
+ }
851
+
409
852
  /**
410
853
  * Get the count of unread in-app notifications for a subscriber.
411
854
  * Get unread notification count
@@ -510,6 +953,61 @@ export class InboxApi extends runtime.BaseAPI implements InboxApiInterface {
510
953
  return await response.value();
511
954
  }
512
955
 
956
+ /**
957
+ * List notifications for the authenticated subscriber. Supports cursor-based pagination.
958
+ * List subscriber notifications
959
+ */
960
+ async listSubscriberNotificationsRaw(requestParameters: InboxApiListSubscriberNotificationsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
961
+ const queryParameters: any = {};
962
+
963
+ if (requestParameters['category'] != null) {
964
+ queryParameters['category'] = requestParameters['category'];
965
+ }
966
+
967
+ if (requestParameters['includeRead'] != null) {
968
+ queryParameters['include_read'] = requestParameters['includeRead'];
969
+ }
970
+
971
+ if (requestParameters['includeArchived'] != null) {
972
+ queryParameters['include_archived'] = requestParameters['includeArchived'];
973
+ }
974
+
975
+ if (requestParameters['limit'] != null) {
976
+ queryParameters['limit'] = requestParameters['limit'];
977
+ }
978
+
979
+ if (requestParameters['cursor'] != null) {
980
+ queryParameters['cursor'] = requestParameters['cursor'];
981
+ }
982
+
983
+ const headerParameters: runtime.HTTPHeaders = {};
984
+
985
+ if (this.configuration && this.configuration.accessToken) {
986
+ const token = this.configuration.accessToken;
987
+ const tokenString = await token("EndUserToken", []);
988
+
989
+ if (tokenString) {
990
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
991
+ }
992
+ }
993
+ const response = await this.request({
994
+ path: `/subscriber-inbox`,
995
+ method: 'GET',
996
+ headers: headerParameters,
997
+ query: queryParameters,
998
+ }, initOverrides);
999
+
1000
+ return new runtime.VoidApiResponse(response);
1001
+ }
1002
+
1003
+ /**
1004
+ * List notifications for the authenticated subscriber. Supports cursor-based pagination.
1005
+ * List subscriber notifications
1006
+ */
1007
+ async listSubscriberNotifications(category?: string, includeRead?: boolean, includeArchived?: boolean, limit?: number, cursor?: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
1008
+ await this.listSubscriberNotificationsRaw({ category: category, includeRead: includeRead, includeArchived: includeArchived, limit: limit, cursor: cursor }, initOverrides);
1009
+ }
1010
+
513
1011
  /**
514
1012
  * Mark all unread in-app notifications as read for a subscriber. Optionally filter by category.
515
1013
  * Mark all notifications as read
@@ -552,6 +1050,42 @@ export class InboxApi extends runtime.BaseAPI implements InboxApiInterface {
552
1050
  return await response.value();
553
1051
  }
554
1052
 
1053
+ /**
1054
+ * Mark all notifications as read
1055
+ */
1056
+ async markAllSubscriberNotificationsReadRaw(requestParameters: InboxApiMarkAllSubscriberNotificationsReadOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
1057
+ const queryParameters: any = {};
1058
+
1059
+ const headerParameters: runtime.HTTPHeaders = {};
1060
+
1061
+ headerParameters['Content-Type'] = 'application/json';
1062
+
1063
+ if (this.configuration && this.configuration.accessToken) {
1064
+ const token = this.configuration.accessToken;
1065
+ const tokenString = await token("EndUserToken", []);
1066
+
1067
+ if (tokenString) {
1068
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
1069
+ }
1070
+ }
1071
+ const response = await this.request({
1072
+ path: `/subscriber-inbox/read-all`,
1073
+ method: 'POST',
1074
+ headers: headerParameters,
1075
+ query: queryParameters,
1076
+ body: MarkAllSubscriberNotificationsReadRequestToJSON(requestParameters['markAllSubscriberNotificationsReadRequest']),
1077
+ }, initOverrides);
1078
+
1079
+ return new runtime.VoidApiResponse(response);
1080
+ }
1081
+
1082
+ /**
1083
+ * Mark all notifications as read
1084
+ */
1085
+ async markAllSubscriberNotificationsRead(markAllSubscriberNotificationsReadRequest?: MarkAllSubscriberNotificationsReadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
1086
+ await this.markAllSubscriberNotificationsReadRaw({ markAllSubscriberNotificationsReadRequest: markAllSubscriberNotificationsReadRequest }, initOverrides);
1087
+ }
1088
+
555
1089
  /**
556
1090
  * Mark a specific in-app notification as read.
557
1091
  * Mark notification as read
@@ -594,6 +1128,46 @@ export class InboxApi extends runtime.BaseAPI implements InboxApiInterface {
594
1128
  return await response.value();
595
1129
  }
596
1130
 
1131
+ /**
1132
+ * Mark notification as read
1133
+ */
1134
+ async markSubscriberNotificationReadRaw(requestParameters: InboxApiMarkSubscriberNotificationReadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
1135
+ if (requestParameters['id'] == null) {
1136
+ throw new runtime.RequiredError(
1137
+ 'id',
1138
+ 'Required parameter "id" was null or undefined when calling markSubscriberNotificationRead().'
1139
+ );
1140
+ }
1141
+
1142
+ const queryParameters: any = {};
1143
+
1144
+ const headerParameters: runtime.HTTPHeaders = {};
1145
+
1146
+ if (this.configuration && this.configuration.accessToken) {
1147
+ const token = this.configuration.accessToken;
1148
+ const tokenString = await token("EndUserToken", []);
1149
+
1150
+ if (tokenString) {
1151
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
1152
+ }
1153
+ }
1154
+ const response = await this.request({
1155
+ path: `/subscriber-inbox/{id}/read`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
1156
+ method: 'POST',
1157
+ headers: headerParameters,
1158
+ query: queryParameters,
1159
+ }, initOverrides);
1160
+
1161
+ return new runtime.VoidApiResponse(response);
1162
+ }
1163
+
1164
+ /**
1165
+ * Mark notification as read
1166
+ */
1167
+ async markSubscriberNotificationRead(id: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
1168
+ await this.markSubscriberNotificationReadRaw({ id: id }, initOverrides);
1169
+ }
1170
+
597
1171
  /**
598
1172
  * Send in-app notifications to multiple subscribers in a single request (max 100).
599
1173
  * Send batch in-app notifications
@@ -678,4 +1252,49 @@ export class InboxApi extends runtime.BaseAPI implements InboxApiInterface {
678
1252
  return await response.value();
679
1253
  }
680
1254
 
1255
+ /**
1256
+ * Update notification channel preferences for specific categories or globally.
1257
+ * Update subscriber preferences
1258
+ */
1259
+ async updateSubscriberPreferencesRaw(requestParameters: InboxApiUpdateSubscriberPreferencesOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
1260
+ if (requestParameters['updateSubscriberPreferencesRequest'] == null) {
1261
+ throw new runtime.RequiredError(
1262
+ 'updateSubscriberPreferencesRequest',
1263
+ 'Required parameter "updateSubscriberPreferencesRequest" was null or undefined when calling updateSubscriberPreferences().'
1264
+ );
1265
+ }
1266
+
1267
+ const queryParameters: any = {};
1268
+
1269
+ const headerParameters: runtime.HTTPHeaders = {};
1270
+
1271
+ headerParameters['Content-Type'] = 'application/json';
1272
+
1273
+ if (this.configuration && this.configuration.accessToken) {
1274
+ const token = this.configuration.accessToken;
1275
+ const tokenString = await token("EndUserToken", []);
1276
+
1277
+ if (tokenString) {
1278
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
1279
+ }
1280
+ }
1281
+ const response = await this.request({
1282
+ path: `/subscriber-inbox/preferences`,
1283
+ method: 'PUT',
1284
+ headers: headerParameters,
1285
+ query: queryParameters,
1286
+ body: UpdateSubscriberPreferencesRequestToJSON(requestParameters['updateSubscriberPreferencesRequest']),
1287
+ }, initOverrides);
1288
+
1289
+ return new runtime.VoidApiResponse(response);
1290
+ }
1291
+
1292
+ /**
1293
+ * Update notification channel preferences for specific categories or globally.
1294
+ * Update subscriber preferences
1295
+ */
1296
+ async updateSubscriberPreferences(updateSubscriberPreferencesRequest: UpdateSubscriberPreferencesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
1297
+ await this.updateSubscriberPreferencesRaw({ updateSubscriberPreferencesRequest: updateSubscriberPreferencesRequest }, initOverrides);
1298
+ }
1299
+
681
1300
  }