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.
- package/dist/index.d.mts +1451 -1303
- package/dist/index.d.ts +1451 -1303
- package/dist/index.js +10502 -5728
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7817 -3059
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -3
- package/src/components/AccountReviewsTab.tsx +97 -0
- package/src/components/CouponCodeInput.tsx +190 -0
- package/src/components/Header.tsx +5 -1
- package/src/components/Notification.tsx +1 -1
- package/src/components/NotificationBell.tsx +33 -0
- package/src/components/NotificationCard.tsx +211 -0
- package/src/components/NotificationDrawer.tsx +195 -0
- package/src/components/OrderCard.tsx +164 -99
- package/src/components/ProductReviewsSection.tsx +30 -0
- package/src/components/RatingDistribution.tsx +86 -0
- package/src/components/ReviewCard.tsx +59 -0
- package/src/components/ReviewForm.tsx +207 -0
- package/src/components/ReviewPromptBanner.tsx +98 -0
- package/src/components/ReviewsList.tsx +151 -0
- package/src/components/StarRating.tsx +98 -0
- package/src/hooks/useDiscounts.ts +7 -0
- package/src/hooks/useOrders.ts +15 -0
- package/src/hooks/useReviews.ts +230 -0
- package/src/index.ts +25 -0
- package/src/lib/Apis/apis/discounts-api.ts +23 -72
- package/src/lib/Apis/apis/notifications-api.ts +196 -231
- package/src/lib/Apis/apis/products-api.ts +84 -0
- package/src/lib/Apis/apis/review-api.ts +283 -4
- package/src/lib/Apis/apis/stores-api.ts +180 -0
- package/src/lib/Apis/models/bulk-channel-toggle-dto.ts +52 -0
- package/src/lib/Apis/models/cart-body-populated.ts +3 -3
- package/src/lib/Apis/models/channel-settings-dto.ts +39 -0
- package/src/lib/Apis/models/{discount-paginated-response.ts → completed-order-dto.ts} +21 -16
- package/src/lib/Apis/models/create-discount-dto.ts +31 -92
- package/src/lib/Apis/models/create-review-dto.ts +4 -4
- package/src/lib/Apis/models/create-shippo-account-dto.ts +45 -0
- package/src/lib/Apis/models/create-store-dto.ts +6 -0
- package/src/lib/Apis/models/discount.ts +37 -98
- package/src/lib/Apis/models/discounts-insights-dto.ts +12 -0
- package/src/lib/Apis/models/index.ts +13 -7
- package/src/lib/Apis/models/{manual-discount.ts → manual-discount-dto.ts} +10 -10
- package/src/lib/Apis/models/manual-order-dto.ts +3 -3
- package/src/lib/Apis/models/populated-discount.ts +41 -101
- package/src/lib/Apis/models/preference-update-item.ts +59 -0
- package/src/lib/Apis/models/product-light-dto.ts +40 -0
- package/src/lib/Apis/models/{check-notifications-response-dto.ts → review-status-dto.ts} +8 -7
- package/src/lib/Apis/models/review.ts +9 -3
- package/src/lib/Apis/models/reviewable-order-dto.ts +58 -0
- package/src/lib/Apis/models/reviewable-product-dto.ts +81 -0
- package/src/lib/Apis/models/shippo-account-response-dto.ts +51 -0
- package/src/lib/Apis/models/store-entity.ts +6 -0
- package/src/lib/Apis/models/store.ts +6 -0
- package/src/lib/Apis/models/update-discount-dto.ts +31 -92
- package/src/lib/Apis/models/update-notification-settings-dto.ts +28 -0
- package/src/lib/Apis/models/update-review-dto.ts +4 -4
- package/src/lib/Apis/models/update-store-dto.ts +6 -0
- package/src/lib/Apis/models/{pick-type-class.ts → variant-light-dto.ts} +20 -14
- package/src/lib/utils/discount.ts +155 -0
- package/src/lib/validations/discount.ts +11 -0
- package/src/providers/CartProvider.tsx +2 -2
- package/src/providers/DiscountProvider.tsx +97 -0
- package/src/providers/EcommerceProvider.tsx +13 -5
- package/src/providers/NotificationCenterProvider.tsx +436 -0
- package/src/screens/CartScreen.tsx +1 -1
- package/src/screens/CheckoutScreen.tsx +39 -12
- package/src/screens/NotificationSettingsScreen.tsx +413 -0
- package/src/screens/OrderDetailScreen.tsx +283 -0
- package/src/screens/OrderReviewsScreen.tsx +308 -0
- package/src/screens/OrdersScreen.tsx +31 -7
- package/src/screens/ProductDetailScreen.tsx +24 -11
- package/src/screens/ProfileScreen.tsx +5 -0
- package/src/lib/Apis/models/create-notification-dto.ts +0 -75
- package/src/lib/Apis/models/notification.ts +0 -93
- 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 {
|
|
20
|
-
import {
|
|
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
|
|
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
|
-
|
|
36
|
-
|
|
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: '
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
87
|
-
|
|
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: '
|
|
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
|
|
134
|
-
* @param {
|
|
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
|
-
|
|
139
|
-
|
|
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: '
|
|
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
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
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
|
|
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
|
-
|
|
196
|
-
|
|
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: '
|
|
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
|
|
231
|
+
* @summary Get unread notification count
|
|
251
232
|
* @param {*} [options] Override http request option.
|
|
252
233
|
* @throws {RequiredError}
|
|
253
234
|
*/
|
|
254
|
-
|
|
255
|
-
const localVarPath = `/notifications/
|
|
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
|
|
274
|
+
* @summary Mark all notifications as read
|
|
302
275
|
* @param {*} [options] Override http request option.
|
|
303
276
|
* @throws {RequiredError}
|
|
304
277
|
*/
|
|
305
|
-
|
|
306
|
-
const localVarPath = `/notifications/
|
|
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: '
|
|
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
|
|
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
|
-
|
|
357
|
-
|
|
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: '
|
|
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
|
|
404
|
-
* @param {string}
|
|
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
|
-
|
|
409
|
-
// verify required parameter '
|
|
410
|
-
if (
|
|
411
|
-
throw new RequiredError('
|
|
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/
|
|
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: '
|
|
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
|
-
|
|
435
|
-
|
|
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
|
|
461
|
-
* @param {
|
|
418
|
+
* @summary Update notification settings
|
|
419
|
+
* @param {UpdateNotificationSettingsDto} body
|
|
462
420
|
* @param {*} [options] Override http request option.
|
|
463
421
|
* @throws {RequiredError}
|
|
464
422
|
*/
|
|
465
|
-
|
|
466
|
-
// verify required parameter '
|
|
467
|
-
if (
|
|
468
|
-
throw new RequiredError('
|
|
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/
|
|
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: '
|
|
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
|
-
|
|
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
|
|
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
|
|
531
|
-
const localVarAxiosArgs = await NotificationsApiAxiosParamCreator(configuration).
|
|
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
|
|
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
|
|
544
|
-
const localVarAxiosArgs = await NotificationsApiAxiosParamCreator(configuration).
|
|
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
|
|
553
|
-
* @param {
|
|
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
|
|
558
|
-
const localVarAxiosArgs = await NotificationsApiAxiosParamCreator(configuration).
|
|
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
|
|
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
|
|
572
|
-
const localVarAxiosArgs = await NotificationsApiAxiosParamCreator(configuration).
|
|
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
|
|
536
|
+
* @summary Get unread notification count
|
|
581
537
|
* @param {*} [options] Override http request option.
|
|
582
538
|
* @throws {RequiredError}
|
|
583
539
|
*/
|
|
584
|
-
async
|
|
585
|
-
const localVarAxiosArgs = await NotificationsApiAxiosParamCreator(configuration).
|
|
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
|
|
549
|
+
* @summary Mark all notifications as read
|
|
594
550
|
* @param {*} [options] Override http request option.
|
|
595
551
|
* @throws {RequiredError}
|
|
596
552
|
*/
|
|
597
|
-
async
|
|
598
|
-
const localVarAxiosArgs = await NotificationsApiAxiosParamCreator(configuration).
|
|
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
|
|
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
|
|
611
|
-
const localVarAxiosArgs = await NotificationsApiAxiosParamCreator(configuration).
|
|
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
|
|
620
|
-
* @param {string}
|
|
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
|
|
625
|
-
const localVarAxiosArgs = await NotificationsApiAxiosParamCreator(configuration).
|
|
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
|
|
634
|
-
* @param {
|
|
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
|
|
639
|
-
const localVarAxiosArgs = await NotificationsApiAxiosParamCreator(configuration).
|
|
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
|
|
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
|
|
661
|
-
return NotificationsApiFp(configuration).
|
|
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
|
|
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
|
|
670
|
-
return NotificationsApiFp(configuration).
|
|
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
|
|
675
|
-
* @param {
|
|
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
|
|
680
|
-
return NotificationsApiFp(configuration).
|
|
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
|
|
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
|
|
690
|
-
return NotificationsApiFp(configuration).
|
|
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
|
|
654
|
+
* @summary Get unread notification count
|
|
695
655
|
* @param {*} [options] Override http request option.
|
|
696
656
|
* @throws {RequiredError}
|
|
697
657
|
*/
|
|
698
|
-
async
|
|
699
|
-
return NotificationsApiFp(configuration).
|
|
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
|
|
663
|
+
* @summary Mark all notifications as read
|
|
704
664
|
* @param {*} [options] Override http request option.
|
|
705
665
|
* @throws {RequiredError}
|
|
706
666
|
*/
|
|
707
|
-
async
|
|
708
|
-
return NotificationsApiFp(configuration).
|
|
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
|
|
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
|
|
717
|
-
return NotificationsApiFp(configuration).
|
|
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
|
|
722
|
-
* @param {string}
|
|
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
|
|
727
|
-
return NotificationsApiFp(configuration).
|
|
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
|
|
732
|
-
* @param {
|
|
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
|
|
737
|
-
return NotificationsApiFp(configuration).
|
|
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
|
|
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
|
|
757
|
-
return NotificationsApiFp(this.configuration).
|
|
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
|
|
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
|
|
767
|
-
return NotificationsApiFp(this.configuration).
|
|
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
|
|
772
|
-
* @param {
|
|
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
|
|
778
|
-
return NotificationsApiFp(this.configuration).
|
|
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
|
|
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
|
|
789
|
-
return NotificationsApiFp(this.configuration).
|
|
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
|
|
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
|
|
799
|
-
return NotificationsApiFp(this.configuration).
|
|
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
|
|
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
|
|
809
|
-
return NotificationsApiFp(this.configuration).
|
|
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
|
|
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
|
|
819
|
-
return NotificationsApiFp(this.configuration).
|
|
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
|
|
824
|
-
* @param {string}
|
|
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
|
|
830
|
-
return NotificationsApiFp(this.configuration).
|
|
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
|
|
835
|
-
* @param {
|
|
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
|
|
841
|
-
return NotificationsApiFp(this.configuration).
|
|
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
|
}
|