hey-pharmacist-ecommerce 1.1.30 → 1.1.31

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 (76) hide show
  1. package/dist/index.d.mts +1451 -1303
  2. package/dist/index.d.ts +1451 -1303
  3. package/dist/index.js +10502 -5728
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +7817 -3059
  6. package/dist/index.mjs.map +1 -1
  7. package/package.json +4 -3
  8. package/src/components/AccountReviewsTab.tsx +97 -0
  9. package/src/components/CouponCodeInput.tsx +190 -0
  10. package/src/components/Header.tsx +5 -1
  11. package/src/components/Notification.tsx +1 -1
  12. package/src/components/NotificationBell.tsx +33 -0
  13. package/src/components/NotificationCard.tsx +211 -0
  14. package/src/components/NotificationDrawer.tsx +195 -0
  15. package/src/components/OrderCard.tsx +164 -99
  16. package/src/components/ProductReviewsSection.tsx +30 -0
  17. package/src/components/RatingDistribution.tsx +86 -0
  18. package/src/components/ReviewCard.tsx +59 -0
  19. package/src/components/ReviewForm.tsx +207 -0
  20. package/src/components/ReviewPromptBanner.tsx +98 -0
  21. package/src/components/ReviewsList.tsx +151 -0
  22. package/src/components/StarRating.tsx +98 -0
  23. package/src/hooks/useDiscounts.ts +7 -0
  24. package/src/hooks/useOrders.ts +15 -0
  25. package/src/hooks/useReviews.ts +230 -0
  26. package/src/index.ts +25 -0
  27. package/src/lib/Apis/apis/discounts-api.ts +23 -72
  28. package/src/lib/Apis/apis/notifications-api.ts +196 -231
  29. package/src/lib/Apis/apis/products-api.ts +84 -0
  30. package/src/lib/Apis/apis/review-api.ts +283 -4
  31. package/src/lib/Apis/apis/stores-api.ts +180 -0
  32. package/src/lib/Apis/models/bulk-channel-toggle-dto.ts +52 -0
  33. package/src/lib/Apis/models/cart-body-populated.ts +3 -3
  34. package/src/lib/Apis/models/channel-settings-dto.ts +39 -0
  35. package/src/lib/Apis/models/{discount-paginated-response.ts → completed-order-dto.ts} +21 -16
  36. package/src/lib/Apis/models/create-discount-dto.ts +31 -92
  37. package/src/lib/Apis/models/create-review-dto.ts +4 -4
  38. package/src/lib/Apis/models/create-shippo-account-dto.ts +45 -0
  39. package/src/lib/Apis/models/create-store-dto.ts +6 -0
  40. package/src/lib/Apis/models/discount.ts +37 -98
  41. package/src/lib/Apis/models/discounts-insights-dto.ts +12 -0
  42. package/src/lib/Apis/models/index.ts +13 -7
  43. package/src/lib/Apis/models/{manual-discount.ts → manual-discount-dto.ts} +10 -10
  44. package/src/lib/Apis/models/manual-order-dto.ts +3 -3
  45. package/src/lib/Apis/models/populated-discount.ts +41 -101
  46. package/src/lib/Apis/models/preference-update-item.ts +59 -0
  47. package/src/lib/Apis/models/product-light-dto.ts +40 -0
  48. package/src/lib/Apis/models/{check-notifications-response-dto.ts → review-status-dto.ts} +8 -7
  49. package/src/lib/Apis/models/review.ts +9 -3
  50. package/src/lib/Apis/models/reviewable-order-dto.ts +58 -0
  51. package/src/lib/Apis/models/reviewable-product-dto.ts +81 -0
  52. package/src/lib/Apis/models/shippo-account-response-dto.ts +51 -0
  53. package/src/lib/Apis/models/store-entity.ts +6 -0
  54. package/src/lib/Apis/models/store.ts +6 -0
  55. package/src/lib/Apis/models/update-discount-dto.ts +31 -92
  56. package/src/lib/Apis/models/update-notification-settings-dto.ts +28 -0
  57. package/src/lib/Apis/models/update-review-dto.ts +4 -4
  58. package/src/lib/Apis/models/update-store-dto.ts +6 -0
  59. package/src/lib/Apis/models/{pick-type-class.ts → variant-light-dto.ts} +20 -14
  60. package/src/lib/utils/discount.ts +155 -0
  61. package/src/lib/validations/discount.ts +11 -0
  62. package/src/providers/CartProvider.tsx +2 -2
  63. package/src/providers/DiscountProvider.tsx +97 -0
  64. package/src/providers/EcommerceProvider.tsx +13 -5
  65. package/src/providers/NotificationCenterProvider.tsx +436 -0
  66. package/src/screens/CartScreen.tsx +1 -1
  67. package/src/screens/CheckoutScreen.tsx +39 -12
  68. package/src/screens/NotificationSettingsScreen.tsx +413 -0
  69. package/src/screens/OrderDetailScreen.tsx +283 -0
  70. package/src/screens/OrderReviewsScreen.tsx +308 -0
  71. package/src/screens/OrdersScreen.tsx +31 -7
  72. package/src/screens/ProductDetailScreen.tsx +24 -11
  73. package/src/screens/ProfileScreen.tsx +5 -0
  74. package/src/lib/Apis/models/create-notification-dto.ts +0 -75
  75. package/src/lib/Apis/models/notification.ts +0 -93
  76. package/src/lib/Apis/models/single-notification-dto.ts +0 -99
@@ -16,10 +16,8 @@ import { Configuration } from '../configuration';
16
16
  // Some imports not used depending on template conditions
17
17
  // @ts-ignore
18
18
  import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
19
- import { CheckNotificationsResponseDto } from '../models';
20
- import { CreateNotificationDto } from '../models';
21
- import { Notification } from '../models';
22
- import { SingleNotificationDto } from '../models';
19
+ import { BulkChannelToggleDto } from '../models';
20
+ import { UpdateNotificationSettingsDto } from '../models';
23
21
  /**
24
22
  * NotificationsApi - axios parameter creator
25
23
  * @export
@@ -27,20 +25,25 @@ import { SingleNotificationDto } from '../models';
27
25
  export const NotificationsApiAxiosParamCreator = function (configuration?: Configuration) {
28
26
  return {
29
27
  /**
30
- *
31
- * @summary Check notifications to see if the user has new unread notifications or not .. and how many
28
+ * Enable or disable a channel (email, push, inApp) for all or a category of notifications
29
+ * @summary Bulk toggle a notification channel
30
+ * @param {BulkChannelToggleDto} body
32
31
  * @param {*} [options] Override http request option.
33
32
  * @throws {RequiredError}
34
33
  */
35
- checkNotificaions: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
36
- const localVarPath = `/notifications/check`;
34
+ bulkToggleChannel: async (body: BulkChannelToggleDto, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
35
+ // verify required parameter 'body' is not null or undefined
36
+ if (body === null || body === undefined) {
37
+ throw new RequiredError('body','Required parameter body was null or undefined when calling bulkToggleChannel.');
38
+ }
39
+ const localVarPath = `/notifications/settings/bulk-toggle`;
37
40
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
38
41
  const localVarUrlObj = new URL(localVarPath, 'https://example.com');
39
42
  let baseOptions;
40
43
  if (configuration) {
41
44
  baseOptions = configuration.baseOptions;
42
45
  }
43
- const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
46
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'PUT', ...baseOptions, ...options};
44
47
  const localVarHeaderParameter = {} as any;
45
48
  const localVarQueryParameter = {} as any;
46
49
 
@@ -53,13 +56,7 @@ export const NotificationsApiAxiosParamCreator = function (configuration?: Confi
53
56
  localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
54
57
  }
55
58
 
56
- // authentication x-store-key required
57
- if (configuration && configuration.apiKey) {
58
- const localVarApiKeyValue = typeof configuration.apiKey === 'function'
59
- ? await configuration.apiKey("x-store-key")
60
- : await configuration.apiKey;
61
- localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
62
- }
59
+ localVarHeaderParameter['Content-Type'] = 'application/json';
63
60
 
64
61
  const query = new URLSearchParams(localVarUrlObj.search);
65
62
  for (const key in localVarQueryParameter) {
@@ -71,6 +68,8 @@ export const NotificationsApiAxiosParamCreator = function (configuration?: Confi
71
68
  localVarUrlObj.search = (new URLSearchParams(query)).toString();
72
69
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
73
70
  localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
71
+ const needsSerialization = (typeof body !== "string") || (localVarRequestOptions.headers ||= {})['Content-Type'] === 'application/json';
72
+ localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
74
73
 
75
74
  return {
76
75
  url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
@@ -79,19 +78,25 @@ export const NotificationsApiAxiosParamCreator = function (configuration?: Confi
79
78
  },
80
79
  /**
81
80
  *
82
- * @summary Clear all notifications
81
+ * @summary Delete a notification
82
+ * @param {string} id Notification ID
83
83
  * @param {*} [options] Override http request option.
84
84
  * @throws {RequiredError}
85
85
  */
86
- clearAllNotifications: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
87
- const localVarPath = `/notifications/clear-all`;
86
+ deleteNotification: async (id: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
87
+ // verify required parameter 'id' is not null or undefined
88
+ if (id === null || id === undefined) {
89
+ throw new RequiredError('id','Required parameter id was null or undefined when calling deleteNotification.');
90
+ }
91
+ const localVarPath = `/notifications/{id}`
92
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
88
93
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
89
94
  const localVarUrlObj = new URL(localVarPath, 'https://example.com');
90
95
  let baseOptions;
91
96
  if (configuration) {
92
97
  baseOptions = configuration.baseOptions;
93
98
  }
94
- const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
99
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'DELETE', ...baseOptions, ...options};
95
100
  const localVarHeaderParameter = {} as any;
96
101
  const localVarQueryParameter = {} as any;
97
102
 
@@ -104,14 +109,6 @@ export const NotificationsApiAxiosParamCreator = function (configuration?: Confi
104
109
  localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
105
110
  }
106
111
 
107
- // authentication x-store-key required
108
- if (configuration && configuration.apiKey) {
109
- const localVarApiKeyValue = typeof configuration.apiKey === 'function'
110
- ? await configuration.apiKey("x-store-key")
111
- : await configuration.apiKey;
112
- localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
113
- }
114
-
115
112
  const query = new URLSearchParams(localVarUrlObj.search);
116
113
  for (const key in localVarQueryParameter) {
117
114
  query.set(key, localVarQueryParameter[key]);
@@ -130,25 +127,22 @@ export const NotificationsApiAxiosParamCreator = function (configuration?: Confi
130
127
  },
131
128
  /**
132
129
  *
133
- * @summary Clear a notification
134
- * @param {string} notificationId
130
+ * @summary Get notification history
131
+ * @param {number} [page] Page number (default: 1)
132
+ * @param {number} [limit] Items per page (default: 20)
133
+ * @param {boolean} [unreadOnly] Only return unread notifications
135
134
  * @param {*} [options] Override http request option.
136
135
  * @throws {RequiredError}
137
136
  */
138
- clearNotification: async (notificationId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
139
- // verify required parameter 'notificationId' is not null or undefined
140
- if (notificationId === null || notificationId === undefined) {
141
- throw new RequiredError('notificationId','Required parameter notificationId was null or undefined when calling clearNotification.');
142
- }
143
- const localVarPath = `/notifications/clear/{notificationId}`
144
- .replace(`{${"notificationId"}}`, encodeURIComponent(String(notificationId)));
137
+ getNotifications: async (page?: number, limit?: number, unreadOnly?: boolean, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
138
+ const localVarPath = `/notifications`;
145
139
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
146
140
  const localVarUrlObj = new URL(localVarPath, 'https://example.com');
147
141
  let baseOptions;
148
142
  if (configuration) {
149
143
  baseOptions = configuration.baseOptions;
150
144
  }
151
- const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
145
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
152
146
  const localVarHeaderParameter = {} as any;
153
147
  const localVarQueryParameter = {} as any;
154
148
 
@@ -161,12 +155,16 @@ export const NotificationsApiAxiosParamCreator = function (configuration?: Confi
161
155
  localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
162
156
  }
163
157
 
164
- // authentication x-store-key required
165
- if (configuration && configuration.apiKey) {
166
- const localVarApiKeyValue = typeof configuration.apiKey === 'function'
167
- ? await configuration.apiKey("x-store-key")
168
- : await configuration.apiKey;
169
- localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
158
+ if (page !== undefined) {
159
+ localVarQueryParameter['page'] = page;
160
+ }
161
+
162
+ if (limit !== undefined) {
163
+ localVarQueryParameter['limit'] = limit;
164
+ }
165
+
166
+ if (unreadOnly !== undefined) {
167
+ localVarQueryParameter['unreadOnly'] = unreadOnly;
170
168
  }
171
169
 
172
170
  const query = new URLSearchParams(localVarUrlObj.search);
@@ -187,24 +185,19 @@ export const NotificationsApiAxiosParamCreator = function (configuration?: Confi
187
185
  },
188
186
  /**
189
187
  *
190
- * @summary Create a new notification
191
- * @param {CreateNotificationDto} body
188
+ * @summary Get user notification settings
192
189
  * @param {*} [options] Override http request option.
193
190
  * @throws {RequiredError}
194
191
  */
195
- createNotification: async (body: CreateNotificationDto, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
196
- // verify required parameter 'body' is not null or undefined
197
- if (body === null || body === undefined) {
198
- throw new RequiredError('body','Required parameter body was null or undefined when calling createNotification.');
199
- }
200
- const localVarPath = `/notifications`;
192
+ getSettings: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
193
+ const localVarPath = `/notifications/settings`;
201
194
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
202
195
  const localVarUrlObj = new URL(localVarPath, 'https://example.com');
203
196
  let baseOptions;
204
197
  if (configuration) {
205
198
  baseOptions = configuration.baseOptions;
206
199
  }
207
- const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
200
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
208
201
  const localVarHeaderParameter = {} as any;
209
202
  const localVarQueryParameter = {} as any;
210
203
 
@@ -217,16 +210,6 @@ export const NotificationsApiAxiosParamCreator = function (configuration?: Confi
217
210
  localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
218
211
  }
219
212
 
220
- // authentication x-store-key required
221
- if (configuration && configuration.apiKey) {
222
- const localVarApiKeyValue = typeof configuration.apiKey === 'function'
223
- ? await configuration.apiKey("x-store-key")
224
- : await configuration.apiKey;
225
- localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
226
- }
227
-
228
- localVarHeaderParameter['Content-Type'] = 'application/json';
229
-
230
213
  const query = new URLSearchParams(localVarUrlObj.search);
231
214
  for (const key in localVarQueryParameter) {
232
215
  query.set(key, localVarQueryParameter[key]);
@@ -237,8 +220,6 @@ export const NotificationsApiAxiosParamCreator = function (configuration?: Confi
237
220
  localVarUrlObj.search = (new URLSearchParams(query)).toString();
238
221
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
239
222
  localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
240
- const needsSerialization = (typeof body !== "string") || (localVarRequestOptions.headers ||= {})['Content-Type'] === 'application/json';
241
- localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
242
223
 
243
224
  return {
244
225
  url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
@@ -247,12 +228,12 @@ export const NotificationsApiAxiosParamCreator = function (configuration?: Confi
247
228
  },
248
229
  /**
249
230
  *
250
- * @summary Get all admin notifications
231
+ * @summary Get unread notification count
251
232
  * @param {*} [options] Override http request option.
252
233
  * @throws {RequiredError}
253
234
  */
254
- getAllAdminNotifications: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
255
- const localVarPath = `/notifications/admin`;
235
+ getUnreadCount: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
236
+ const localVarPath = `/notifications/unread-count`;
256
237
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
257
238
  const localVarUrlObj = new URL(localVarPath, 'https://example.com');
258
239
  let baseOptions;
@@ -272,14 +253,6 @@ export const NotificationsApiAxiosParamCreator = function (configuration?: Confi
272
253
  localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
273
254
  }
274
255
 
275
- // authentication x-store-key required
276
- if (configuration && configuration.apiKey) {
277
- const localVarApiKeyValue = typeof configuration.apiKey === 'function'
278
- ? await configuration.apiKey("x-store-key")
279
- : await configuration.apiKey;
280
- localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
281
- }
282
-
283
256
  const query = new URLSearchParams(localVarUrlObj.search);
284
257
  for (const key in localVarQueryParameter) {
285
258
  query.set(key, localVarQueryParameter[key]);
@@ -298,19 +271,19 @@ export const NotificationsApiAxiosParamCreator = function (configuration?: Confi
298
271
  },
299
272
  /**
300
273
  *
301
- * @summary Get all notifications for the user
274
+ * @summary Mark all notifications as read
302
275
  * @param {*} [options] Override http request option.
303
276
  * @throws {RequiredError}
304
277
  */
305
- getAllNotificationsForUser: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
306
- const localVarPath = `/notifications/mine`;
278
+ markAllAsRead: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
279
+ const localVarPath = `/notifications/read-all`;
307
280
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
308
281
  const localVarUrlObj = new URL(localVarPath, 'https://example.com');
309
282
  let baseOptions;
310
283
  if (configuration) {
311
284
  baseOptions = configuration.baseOptions;
312
285
  }
313
- const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
286
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'PATCH', ...baseOptions, ...options};
314
287
  const localVarHeaderParameter = {} as any;
315
288
  const localVarQueryParameter = {} as any;
316
289
 
@@ -323,14 +296,6 @@ export const NotificationsApiAxiosParamCreator = function (configuration?: Confi
323
296
  localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
324
297
  }
325
298
 
326
- // authentication x-store-key required
327
- if (configuration && configuration.apiKey) {
328
- const localVarApiKeyValue = typeof configuration.apiKey === 'function'
329
- ? await configuration.apiKey("x-store-key")
330
- : await configuration.apiKey;
331
- localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
332
- }
333
-
334
299
  const query = new URLSearchParams(localVarUrlObj.search);
335
300
  for (const key in localVarQueryParameter) {
336
301
  query.set(key, localVarQueryParameter[key]);
@@ -349,19 +314,25 @@ export const NotificationsApiAxiosParamCreator = function (configuration?: Confi
349
314
  },
350
315
  /**
351
316
  *
352
- * @summary Mark all notifications as read
317
+ * @summary Mark notification as read
318
+ * @param {string} id Notification ID
353
319
  * @param {*} [options] Override http request option.
354
320
  * @throws {RequiredError}
355
321
  */
356
- markAllNotificationsAsRead: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
357
- const localVarPath = `/notifications/mark-all-read`;
322
+ markAsRead: async (id: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
323
+ // verify required parameter 'id' is not null or undefined
324
+ if (id === null || id === undefined) {
325
+ throw new RequiredError('id','Required parameter id was null or undefined when calling markAsRead.');
326
+ }
327
+ const localVarPath = `/notifications/{id}/read`
328
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
358
329
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
359
330
  const localVarUrlObj = new URL(localVarPath, 'https://example.com');
360
331
  let baseOptions;
361
332
  if (configuration) {
362
333
  baseOptions = configuration.baseOptions;
363
334
  }
364
- const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
335
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'PATCH', ...baseOptions, ...options};
365
336
  const localVarHeaderParameter = {} as any;
366
337
  const localVarQueryParameter = {} as any;
367
338
 
@@ -374,14 +345,6 @@ export const NotificationsApiAxiosParamCreator = function (configuration?: Confi
374
345
  localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
375
346
  }
376
347
 
377
- // authentication x-store-key required
378
- if (configuration && configuration.apiKey) {
379
- const localVarApiKeyValue = typeof configuration.apiKey === 'function'
380
- ? await configuration.apiKey("x-store-key")
381
- : await configuration.apiKey;
382
- localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
383
- }
384
-
385
348
  const query = new URLSearchParams(localVarUrlObj.search);
386
349
  for (const key in localVarQueryParameter) {
387
350
  query.set(key, localVarQueryParameter[key]);
@@ -399,26 +362,25 @@ export const NotificationsApiAxiosParamCreator = function (configuration?: Confi
399
362
  };
400
363
  },
401
364
  /**
402
- *
403
- * @summary Mark a notification as read
404
- * @param {string} notificationId
365
+ * Connect with ?token=JWT to receive real-time updates. EventSource cannot send headers.
366
+ * @summary SSE stream for real-time notifications
367
+ * @param {string} token JWT auth token
405
368
  * @param {*} [options] Override http request option.
406
369
  * @throws {RequiredError}
407
370
  */
408
- markNotificationAsRead: async (notificationId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
409
- // verify required parameter 'notificationId' is not null or undefined
410
- if (notificationId === null || notificationId === undefined) {
411
- throw new RequiredError('notificationId','Required parameter notificationId was null or undefined when calling markNotificationAsRead.');
371
+ stream: async (token: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
372
+ // verify required parameter 'token' is not null or undefined
373
+ if (token === null || token === undefined) {
374
+ throw new RequiredError('token','Required parameter token was null or undefined when calling stream.');
412
375
  }
413
- const localVarPath = `/notifications/mark-read/{notificationId}`
414
- .replace(`{${"notificationId"}}`, encodeURIComponent(String(notificationId)));
376
+ const localVarPath = `/notifications/stream`;
415
377
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
416
378
  const localVarUrlObj = new URL(localVarPath, 'https://example.com');
417
379
  let baseOptions;
418
380
  if (configuration) {
419
381
  baseOptions = configuration.baseOptions;
420
382
  }
421
- const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
383
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
422
384
  const localVarHeaderParameter = {} as any;
423
385
  const localVarQueryParameter = {} as any;
424
386
 
@@ -431,12 +393,8 @@ export const NotificationsApiAxiosParamCreator = function (configuration?: Confi
431
393
  localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
432
394
  }
433
395
 
434
- // authentication x-store-key required
435
- if (configuration && configuration.apiKey) {
436
- const localVarApiKeyValue = typeof configuration.apiKey === 'function'
437
- ? await configuration.apiKey("x-store-key")
438
- : await configuration.apiKey;
439
- localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
396
+ if (token !== undefined) {
397
+ localVarQueryParameter['token'] = token;
440
398
  }
441
399
 
442
400
  const query = new URLSearchParams(localVarUrlObj.search);
@@ -457,25 +415,24 @@ export const NotificationsApiAxiosParamCreator = function (configuration?: Confi
457
415
  },
458
416
  /**
459
417
  *
460
- * @summary Mark a notification as unread
461
- * @param {string} notificationId
418
+ * @summary Update notification settings
419
+ * @param {UpdateNotificationSettingsDto} body
462
420
  * @param {*} [options] Override http request option.
463
421
  * @throws {RequiredError}
464
422
  */
465
- markNotificationAsUnread: async (notificationId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
466
- // verify required parameter 'notificationId' is not null or undefined
467
- if (notificationId === null || notificationId === undefined) {
468
- throw new RequiredError('notificationId','Required parameter notificationId was null or undefined when calling markNotificationAsUnread.');
423
+ updateSettings: async (body: UpdateNotificationSettingsDto, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
424
+ // verify required parameter 'body' is not null or undefined
425
+ if (body === null || body === undefined) {
426
+ throw new RequiredError('body','Required parameter body was null or undefined when calling updateSettings.');
469
427
  }
470
- const localVarPath = `/notifications/mark-unread/{notificationId}`
471
- .replace(`{${"notificationId"}}`, encodeURIComponent(String(notificationId)));
428
+ const localVarPath = `/notifications/settings`;
472
429
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
473
430
  const localVarUrlObj = new URL(localVarPath, 'https://example.com');
474
431
  let baseOptions;
475
432
  if (configuration) {
476
433
  baseOptions = configuration.baseOptions;
477
434
  }
478
- const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
435
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'PUT', ...baseOptions, ...options};
479
436
  const localVarHeaderParameter = {} as any;
480
437
  const localVarQueryParameter = {} as any;
481
438
 
@@ -488,13 +445,7 @@ export const NotificationsApiAxiosParamCreator = function (configuration?: Confi
488
445
  localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
489
446
  }
490
447
 
491
- // authentication x-store-key required
492
- if (configuration && configuration.apiKey) {
493
- const localVarApiKeyValue = typeof configuration.apiKey === 'function'
494
- ? await configuration.apiKey("x-store-key")
495
- : await configuration.apiKey;
496
- localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
497
- }
448
+ localVarHeaderParameter['Content-Type'] = 'application/json';
498
449
 
499
450
  const query = new URLSearchParams(localVarUrlObj.search);
500
451
  for (const key in localVarQueryParameter) {
@@ -506,6 +457,8 @@ export const NotificationsApiAxiosParamCreator = function (configuration?: Confi
506
457
  localVarUrlObj.search = (new URLSearchParams(query)).toString();
507
458
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
508
459
  localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
460
+ const needsSerialization = (typeof body !== "string") || (localVarRequestOptions.headers ||= {})['Content-Type'] === 'application/json';
461
+ localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
509
462
 
510
463
  return {
511
464
  url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
@@ -522,13 +475,14 @@ export const NotificationsApiAxiosParamCreator = function (configuration?: Confi
522
475
  export const NotificationsApiFp = function(configuration?: Configuration) {
523
476
  return {
524
477
  /**
525
- *
526
- * @summary Check notifications to see if the user has new unread notifications or not .. and how many
478
+ * Enable or disable a channel (email, push, inApp) for all or a category of notifications
479
+ * @summary Bulk toggle a notification channel
480
+ * @param {BulkChannelToggleDto} body
527
481
  * @param {*} [options] Override http request option.
528
482
  * @throws {RequiredError}
529
483
  */
530
- async checkNotificaions(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<CheckNotificationsResponseDto>>> {
531
- const localVarAxiosArgs = await NotificationsApiAxiosParamCreator(configuration).checkNotificaions(options);
484
+ async bulkToggleChannel(body: BulkChannelToggleDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
485
+ const localVarAxiosArgs = await NotificationsApiAxiosParamCreator(configuration).bulkToggleChannel(body, options);
532
486
  return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
533
487
  const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
534
488
  return axios.request(axiosRequestArgs);
@@ -536,12 +490,13 @@ export const NotificationsApiFp = function(configuration?: Configuration) {
536
490
  },
537
491
  /**
538
492
  *
539
- * @summary Clear all notifications
493
+ * @summary Delete a notification
494
+ * @param {string} id Notification ID
540
495
  * @param {*} [options] Override http request option.
541
496
  * @throws {RequiredError}
542
497
  */
543
- async clearAllNotifications(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Array<SingleNotificationDto>>>> {
544
- const localVarAxiosArgs = await NotificationsApiAxiosParamCreator(configuration).clearAllNotifications(options);
498
+ async deleteNotification(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
499
+ const localVarAxiosArgs = await NotificationsApiAxiosParamCreator(configuration).deleteNotification(id, options);
545
500
  return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
546
501
  const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
547
502
  return axios.request(axiosRequestArgs);
@@ -549,13 +504,15 @@ export const NotificationsApiFp = function(configuration?: Configuration) {
549
504
  },
550
505
  /**
551
506
  *
552
- * @summary Clear a notification
553
- * @param {string} notificationId
507
+ * @summary Get notification history
508
+ * @param {number} [page] Page number (default: 1)
509
+ * @param {number} [limit] Items per page (default: 20)
510
+ * @param {boolean} [unreadOnly] Only return unread notifications
554
511
  * @param {*} [options] Override http request option.
555
512
  * @throws {RequiredError}
556
513
  */
557
- async clearNotification(notificationId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<SingleNotificationDto>>> {
558
- const localVarAxiosArgs = await NotificationsApiAxiosParamCreator(configuration).clearNotification(notificationId, options);
514
+ async getNotifications(page?: number, limit?: number, unreadOnly?: boolean, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
515
+ const localVarAxiosArgs = await NotificationsApiAxiosParamCreator(configuration).getNotifications(page, limit, unreadOnly, options);
559
516
  return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
560
517
  const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
561
518
  return axios.request(axiosRequestArgs);
@@ -563,13 +520,12 @@ export const NotificationsApiFp = function(configuration?: Configuration) {
563
520
  },
564
521
  /**
565
522
  *
566
- * @summary Create a new notification
567
- * @param {CreateNotificationDto} body
523
+ * @summary Get user notification settings
568
524
  * @param {*} [options] Override http request option.
569
525
  * @throws {RequiredError}
570
526
  */
571
- async createNotification(body: CreateNotificationDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Notification>>> {
572
- const localVarAxiosArgs = await NotificationsApiAxiosParamCreator(configuration).createNotification(body, options);
527
+ async getSettings(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
528
+ const localVarAxiosArgs = await NotificationsApiAxiosParamCreator(configuration).getSettings(options);
573
529
  return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
574
530
  const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
575
531
  return axios.request(axiosRequestArgs);
@@ -577,12 +533,12 @@ export const NotificationsApiFp = function(configuration?: Configuration) {
577
533
  },
578
534
  /**
579
535
  *
580
- * @summary Get all admin notifications
536
+ * @summary Get unread notification count
581
537
  * @param {*} [options] Override http request option.
582
538
  * @throws {RequiredError}
583
539
  */
584
- async getAllAdminNotifications(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Array<SingleNotificationDto>>>> {
585
- const localVarAxiosArgs = await NotificationsApiAxiosParamCreator(configuration).getAllAdminNotifications(options);
540
+ async getUnreadCount(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
541
+ const localVarAxiosArgs = await NotificationsApiAxiosParamCreator(configuration).getUnreadCount(options);
586
542
  return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
587
543
  const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
588
544
  return axios.request(axiosRequestArgs);
@@ -590,12 +546,12 @@ export const NotificationsApiFp = function(configuration?: Configuration) {
590
546
  },
591
547
  /**
592
548
  *
593
- * @summary Get all notifications for the user
549
+ * @summary Mark all notifications as read
594
550
  * @param {*} [options] Override http request option.
595
551
  * @throws {RequiredError}
596
552
  */
597
- async getAllNotificationsForUser(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Array<SingleNotificationDto>>>> {
598
- const localVarAxiosArgs = await NotificationsApiAxiosParamCreator(configuration).getAllNotificationsForUser(options);
553
+ async markAllAsRead(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
554
+ const localVarAxiosArgs = await NotificationsApiAxiosParamCreator(configuration).markAllAsRead(options);
599
555
  return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
600
556
  const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
601
557
  return axios.request(axiosRequestArgs);
@@ -603,26 +559,27 @@ export const NotificationsApiFp = function(configuration?: Configuration) {
603
559
  },
604
560
  /**
605
561
  *
606
- * @summary Mark all notifications as read
562
+ * @summary Mark notification as read
563
+ * @param {string} id Notification ID
607
564
  * @param {*} [options] Override http request option.
608
565
  * @throws {RequiredError}
609
566
  */
610
- async markAllNotificationsAsRead(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Array<SingleNotificationDto>>>> {
611
- const localVarAxiosArgs = await NotificationsApiAxiosParamCreator(configuration).markAllNotificationsAsRead(options);
567
+ async markAsRead(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
568
+ const localVarAxiosArgs = await NotificationsApiAxiosParamCreator(configuration).markAsRead(id, options);
612
569
  return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
613
570
  const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
614
571
  return axios.request(axiosRequestArgs);
615
572
  };
616
573
  },
617
574
  /**
618
- *
619
- * @summary Mark a notification as read
620
- * @param {string} notificationId
575
+ * Connect with ?token=JWT to receive real-time updates. EventSource cannot send headers.
576
+ * @summary SSE stream for real-time notifications
577
+ * @param {string} token JWT auth token
621
578
  * @param {*} [options] Override http request option.
622
579
  * @throws {RequiredError}
623
580
  */
624
- async markNotificationAsRead(notificationId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<SingleNotificationDto>>> {
625
- const localVarAxiosArgs = await NotificationsApiAxiosParamCreator(configuration).markNotificationAsRead(notificationId, options);
581
+ async stream(token: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
582
+ const localVarAxiosArgs = await NotificationsApiAxiosParamCreator(configuration).stream(token, options);
626
583
  return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
627
584
  const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
628
585
  return axios.request(axiosRequestArgs);
@@ -630,13 +587,13 @@ export const NotificationsApiFp = function(configuration?: Configuration) {
630
587
  },
631
588
  /**
632
589
  *
633
- * @summary Mark a notification as unread
634
- * @param {string} notificationId
590
+ * @summary Update notification settings
591
+ * @param {UpdateNotificationSettingsDto} body
635
592
  * @param {*} [options] Override http request option.
636
593
  * @throws {RequiredError}
637
594
  */
638
- async markNotificationAsUnread(notificationId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<SingleNotificationDto>>> {
639
- const localVarAxiosArgs = await NotificationsApiAxiosParamCreator(configuration).markNotificationAsUnread(notificationId, options);
595
+ async updateSettings(body: UpdateNotificationSettingsDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
596
+ const localVarAxiosArgs = await NotificationsApiAxiosParamCreator(configuration).updateSettings(body, options);
640
597
  return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
641
598
  const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
642
599
  return axios.request(axiosRequestArgs);
@@ -652,89 +609,93 @@ export const NotificationsApiFp = function(configuration?: Configuration) {
652
609
  export const NotificationsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
653
610
  return {
654
611
  /**
655
- *
656
- * @summary Check notifications to see if the user has new unread notifications or not .. and how many
612
+ * Enable or disable a channel (email, push, inApp) for all or a category of notifications
613
+ * @summary Bulk toggle a notification channel
614
+ * @param {BulkChannelToggleDto} body
657
615
  * @param {*} [options] Override http request option.
658
616
  * @throws {RequiredError}
659
617
  */
660
- async checkNotificaions(options?: AxiosRequestConfig): Promise<AxiosResponse<CheckNotificationsResponseDto>> {
661
- return NotificationsApiFp(configuration).checkNotificaions(options).then((request) => request(axios, basePath));
618
+ async bulkToggleChannel(body: BulkChannelToggleDto, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
619
+ return NotificationsApiFp(configuration).bulkToggleChannel(body, options).then((request) => request(axios, basePath));
662
620
  },
663
621
  /**
664
622
  *
665
- * @summary Clear all notifications
623
+ * @summary Delete a notification
624
+ * @param {string} id Notification ID
666
625
  * @param {*} [options] Override http request option.
667
626
  * @throws {RequiredError}
668
627
  */
669
- async clearAllNotifications(options?: AxiosRequestConfig): Promise<AxiosResponse<Array<SingleNotificationDto>>> {
670
- return NotificationsApiFp(configuration).clearAllNotifications(options).then((request) => request(axios, basePath));
628
+ async deleteNotification(id: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
629
+ return NotificationsApiFp(configuration).deleteNotification(id, options).then((request) => request(axios, basePath));
671
630
  },
672
631
  /**
673
632
  *
674
- * @summary Clear a notification
675
- * @param {string} notificationId
633
+ * @summary Get notification history
634
+ * @param {number} [page] Page number (default: 1)
635
+ * @param {number} [limit] Items per page (default: 20)
636
+ * @param {boolean} [unreadOnly] Only return unread notifications
676
637
  * @param {*} [options] Override http request option.
677
638
  * @throws {RequiredError}
678
639
  */
679
- async clearNotification(notificationId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<SingleNotificationDto>> {
680
- return NotificationsApiFp(configuration).clearNotification(notificationId, options).then((request) => request(axios, basePath));
640
+ async getNotifications(page?: number, limit?: number, unreadOnly?: boolean, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
641
+ return NotificationsApiFp(configuration).getNotifications(page, limit, unreadOnly, options).then((request) => request(axios, basePath));
681
642
  },
682
643
  /**
683
644
  *
684
- * @summary Create a new notification
685
- * @param {CreateNotificationDto} body
645
+ * @summary Get user notification settings
686
646
  * @param {*} [options] Override http request option.
687
647
  * @throws {RequiredError}
688
648
  */
689
- async createNotification(body: CreateNotificationDto, options?: AxiosRequestConfig): Promise<AxiosResponse<Notification>> {
690
- return NotificationsApiFp(configuration).createNotification(body, options).then((request) => request(axios, basePath));
649
+ async getSettings(options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
650
+ return NotificationsApiFp(configuration).getSettings(options).then((request) => request(axios, basePath));
691
651
  },
692
652
  /**
693
653
  *
694
- * @summary Get all admin notifications
654
+ * @summary Get unread notification count
695
655
  * @param {*} [options] Override http request option.
696
656
  * @throws {RequiredError}
697
657
  */
698
- async getAllAdminNotifications(options?: AxiosRequestConfig): Promise<AxiosResponse<Array<SingleNotificationDto>>> {
699
- return NotificationsApiFp(configuration).getAllAdminNotifications(options).then((request) => request(axios, basePath));
658
+ async getUnreadCount(options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
659
+ return NotificationsApiFp(configuration).getUnreadCount(options).then((request) => request(axios, basePath));
700
660
  },
701
661
  /**
702
662
  *
703
- * @summary Get all notifications for the user
663
+ * @summary Mark all notifications as read
704
664
  * @param {*} [options] Override http request option.
705
665
  * @throws {RequiredError}
706
666
  */
707
- async getAllNotificationsForUser(options?: AxiosRequestConfig): Promise<AxiosResponse<Array<SingleNotificationDto>>> {
708
- return NotificationsApiFp(configuration).getAllNotificationsForUser(options).then((request) => request(axios, basePath));
667
+ async markAllAsRead(options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
668
+ return NotificationsApiFp(configuration).markAllAsRead(options).then((request) => request(axios, basePath));
709
669
  },
710
670
  /**
711
671
  *
712
- * @summary Mark all notifications as read
672
+ * @summary Mark notification as read
673
+ * @param {string} id Notification ID
713
674
  * @param {*} [options] Override http request option.
714
675
  * @throws {RequiredError}
715
676
  */
716
- async markAllNotificationsAsRead(options?: AxiosRequestConfig): Promise<AxiosResponse<Array<SingleNotificationDto>>> {
717
- return NotificationsApiFp(configuration).markAllNotificationsAsRead(options).then((request) => request(axios, basePath));
677
+ async markAsRead(id: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
678
+ return NotificationsApiFp(configuration).markAsRead(id, options).then((request) => request(axios, basePath));
718
679
  },
719
680
  /**
720
- *
721
- * @summary Mark a notification as read
722
- * @param {string} notificationId
681
+ * Connect with ?token=JWT to receive real-time updates. EventSource cannot send headers.
682
+ * @summary SSE stream for real-time notifications
683
+ * @param {string} token JWT auth token
723
684
  * @param {*} [options] Override http request option.
724
685
  * @throws {RequiredError}
725
686
  */
726
- async markNotificationAsRead(notificationId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<SingleNotificationDto>> {
727
- return NotificationsApiFp(configuration).markNotificationAsRead(notificationId, options).then((request) => request(axios, basePath));
687
+ async stream(token: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
688
+ return NotificationsApiFp(configuration).stream(token, options).then((request) => request(axios, basePath));
728
689
  },
729
690
  /**
730
691
  *
731
- * @summary Mark a notification as unread
732
- * @param {string} notificationId
692
+ * @summary Update notification settings
693
+ * @param {UpdateNotificationSettingsDto} body
733
694
  * @param {*} [options] Override http request option.
734
695
  * @throws {RequiredError}
735
696
  */
736
- async markNotificationAsUnread(notificationId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<SingleNotificationDto>> {
737
- return NotificationsApiFp(configuration).markNotificationAsUnread(notificationId, options).then((request) => request(axios, basePath));
697
+ async updateSettings(body: UpdateNotificationSettingsDto, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
698
+ return NotificationsApiFp(configuration).updateSettings(body, options).then((request) => request(axios, basePath));
738
699
  },
739
700
  };
740
701
  };
@@ -747,97 +708,101 @@ export const NotificationsApiFactory = function (configuration?: Configuration,
747
708
  */
748
709
  export class NotificationsApi extends BaseAPI {
749
710
  /**
750
- *
751
- * @summary Check notifications to see if the user has new unread notifications or not .. and how many
711
+ * Enable or disable a channel (email, push, inApp) for all or a category of notifications
712
+ * @summary Bulk toggle a notification channel
713
+ * @param {BulkChannelToggleDto} body
752
714
  * @param {*} [options] Override http request option.
753
715
  * @throws {RequiredError}
754
716
  * @memberof NotificationsApi
755
717
  */
756
- public async checkNotificaions(options?: AxiosRequestConfig) : Promise<AxiosResponse<CheckNotificationsResponseDto>> {
757
- return NotificationsApiFp(this.configuration).checkNotificaions(options).then((request) => request(this.axios, this.basePath));
718
+ public async bulkToggleChannel(body: BulkChannelToggleDto, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
719
+ return NotificationsApiFp(this.configuration).bulkToggleChannel(body, options).then((request) => request(this.axios, this.basePath));
758
720
  }
759
721
  /**
760
722
  *
761
- * @summary Clear all notifications
723
+ * @summary Delete a notification
724
+ * @param {string} id Notification ID
762
725
  * @param {*} [options] Override http request option.
763
726
  * @throws {RequiredError}
764
727
  * @memberof NotificationsApi
765
728
  */
766
- public async clearAllNotifications(options?: AxiosRequestConfig) : Promise<AxiosResponse<Array<SingleNotificationDto>>> {
767
- return NotificationsApiFp(this.configuration).clearAllNotifications(options).then((request) => request(this.axios, this.basePath));
729
+ public async deleteNotification(id: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
730
+ return NotificationsApiFp(this.configuration).deleteNotification(id, options).then((request) => request(this.axios, this.basePath));
768
731
  }
769
732
  /**
770
733
  *
771
- * @summary Clear a notification
772
- * @param {string} notificationId
734
+ * @summary Get notification history
735
+ * @param {number} [page] Page number (default: 1)
736
+ * @param {number} [limit] Items per page (default: 20)
737
+ * @param {boolean} [unreadOnly] Only return unread notifications
773
738
  * @param {*} [options] Override http request option.
774
739
  * @throws {RequiredError}
775
740
  * @memberof NotificationsApi
776
741
  */
777
- public async clearNotification(notificationId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<SingleNotificationDto>> {
778
- return NotificationsApiFp(this.configuration).clearNotification(notificationId, options).then((request) => request(this.axios, this.basePath));
742
+ public async getNotifications(page?: number, limit?: number, unreadOnly?: boolean, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
743
+ return NotificationsApiFp(this.configuration).getNotifications(page, limit, unreadOnly, options).then((request) => request(this.axios, this.basePath));
779
744
  }
780
745
  /**
781
746
  *
782
- * @summary Create a new notification
783
- * @param {CreateNotificationDto} body
747
+ * @summary Get user notification settings
784
748
  * @param {*} [options] Override http request option.
785
749
  * @throws {RequiredError}
786
750
  * @memberof NotificationsApi
787
751
  */
788
- public async createNotification(body: CreateNotificationDto, options?: AxiosRequestConfig) : Promise<AxiosResponse<Notification>> {
789
- return NotificationsApiFp(this.configuration).createNotification(body, options).then((request) => request(this.axios, this.basePath));
752
+ public async getSettings(options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
753
+ return NotificationsApiFp(this.configuration).getSettings(options).then((request) => request(this.axios, this.basePath));
790
754
  }
791
755
  /**
792
756
  *
793
- * @summary Get all admin notifications
757
+ * @summary Get unread notification count
794
758
  * @param {*} [options] Override http request option.
795
759
  * @throws {RequiredError}
796
760
  * @memberof NotificationsApi
797
761
  */
798
- public async getAllAdminNotifications(options?: AxiosRequestConfig) : Promise<AxiosResponse<Array<SingleNotificationDto>>> {
799
- return NotificationsApiFp(this.configuration).getAllAdminNotifications(options).then((request) => request(this.axios, this.basePath));
762
+ public async getUnreadCount(options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
763
+ return NotificationsApiFp(this.configuration).getUnreadCount(options).then((request) => request(this.axios, this.basePath));
800
764
  }
801
765
  /**
802
766
  *
803
- * @summary Get all notifications for the user
767
+ * @summary Mark all notifications as read
804
768
  * @param {*} [options] Override http request option.
805
769
  * @throws {RequiredError}
806
770
  * @memberof NotificationsApi
807
771
  */
808
- public async getAllNotificationsForUser(options?: AxiosRequestConfig) : Promise<AxiosResponse<Array<SingleNotificationDto>>> {
809
- return NotificationsApiFp(this.configuration).getAllNotificationsForUser(options).then((request) => request(this.axios, this.basePath));
772
+ public async markAllAsRead(options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
773
+ return NotificationsApiFp(this.configuration).markAllAsRead(options).then((request) => request(this.axios, this.basePath));
810
774
  }
811
775
  /**
812
776
  *
813
- * @summary Mark all notifications as read
777
+ * @summary Mark notification as read
778
+ * @param {string} id Notification ID
814
779
  * @param {*} [options] Override http request option.
815
780
  * @throws {RequiredError}
816
781
  * @memberof NotificationsApi
817
782
  */
818
- public async markAllNotificationsAsRead(options?: AxiosRequestConfig) : Promise<AxiosResponse<Array<SingleNotificationDto>>> {
819
- return NotificationsApiFp(this.configuration).markAllNotificationsAsRead(options).then((request) => request(this.axios, this.basePath));
783
+ public async markAsRead(id: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
784
+ return NotificationsApiFp(this.configuration).markAsRead(id, options).then((request) => request(this.axios, this.basePath));
820
785
  }
821
786
  /**
822
- *
823
- * @summary Mark a notification as read
824
- * @param {string} notificationId
787
+ * Connect with ?token=JWT to receive real-time updates. EventSource cannot send headers.
788
+ * @summary SSE stream for real-time notifications
789
+ * @param {string} token JWT auth token
825
790
  * @param {*} [options] Override http request option.
826
791
  * @throws {RequiredError}
827
792
  * @memberof NotificationsApi
828
793
  */
829
- public async markNotificationAsRead(notificationId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<SingleNotificationDto>> {
830
- return NotificationsApiFp(this.configuration).markNotificationAsRead(notificationId, options).then((request) => request(this.axios, this.basePath));
794
+ public async stream(token: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
795
+ return NotificationsApiFp(this.configuration).stream(token, options).then((request) => request(this.axios, this.basePath));
831
796
  }
832
797
  /**
833
798
  *
834
- * @summary Mark a notification as unread
835
- * @param {string} notificationId
799
+ * @summary Update notification settings
800
+ * @param {UpdateNotificationSettingsDto} body
836
801
  * @param {*} [options] Override http request option.
837
802
  * @throws {RequiredError}
838
803
  * @memberof NotificationsApi
839
804
  */
840
- public async markNotificationAsUnread(notificationId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<SingleNotificationDto>> {
841
- return NotificationsApiFp(this.configuration).markNotificationAsUnread(notificationId, options).then((request) => request(this.axios, this.basePath));
805
+ public async updateSettings(body: UpdateNotificationSettingsDto, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
806
+ return NotificationsApiFp(this.configuration).updateSettings(body, options).then((request) => request(this.axios, this.basePath));
842
807
  }
843
808
  }