electric-coop-api 0.1.76 → 0.1.78
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/.openapi-generator/FILES +4 -13
- package/README.md +2 -2
- package/dist/apis/AdminComplaintsApi.d.ts +25 -1
- package/dist/apis/AdminComplaintsApi.js +38 -0
- package/dist/apis/AdminNotificationsApi.d.ts +99 -5
- package/dist/apis/AdminNotificationsApi.js +149 -2
- package/dist/apis/index.d.ts +0 -2
- package/dist/apis/index.js +0 -2
- package/dist/esm/apis/AdminComplaintsApi.d.ts +25 -1
- package/dist/esm/apis/AdminComplaintsApi.js +39 -1
- package/dist/esm/apis/AdminNotificationsApi.d.ts +99 -5
- package/dist/esm/apis/AdminNotificationsApi.js +150 -3
- package/dist/esm/apis/index.d.ts +0 -2
- package/dist/esm/apis/index.js +0 -2
- package/dist/esm/models/AdminNotificationMarkedAsRead.d.ts +45 -0
- package/dist/esm/models/{RatesSuccessResponse.js → AdminNotificationMarkedAsRead.js} +11 -11
- package/dist/esm/models/AdminNotificationUnreadCount.d.ts +45 -0
- package/dist/esm/models/{RateAdjustmentsSuccessResponse.js → AdminNotificationUnreadCount.js} +11 -11
- package/dist/esm/models/AuditLogEntityTypeEnum.d.ts +5 -0
- package/dist/esm/models/AuditLogEntityTypeEnum.js +6 -1
- package/dist/esm/models/CreateAdminComplaintDto.d.ts +64 -0
- package/dist/esm/models/CreateAdminComplaintDto.js +61 -0
- package/dist/esm/models/NotificationTypeEnum.d.ts +5 -0
- package/dist/esm/models/NotificationTypeEnum.js +6 -1
- package/dist/esm/models/PaginatedAdminNotifications.d.ts +52 -0
- package/dist/esm/models/PaginatedAdminNotifications.js +55 -0
- package/dist/esm/models/index.d.ts +4 -11
- package/dist/esm/models/index.js +4 -11
- package/dist/models/AdminNotificationMarkedAsRead.d.ts +45 -0
- package/dist/models/AdminNotificationMarkedAsRead.js +57 -0
- package/dist/models/AdminNotificationUnreadCount.d.ts +45 -0
- package/dist/models/AdminNotificationUnreadCount.js +57 -0
- package/dist/models/AuditLogEntityTypeEnum.d.ts +5 -0
- package/dist/models/AuditLogEntityTypeEnum.js +6 -1
- package/dist/models/CreateAdminComplaintDto.d.ts +64 -0
- package/dist/models/CreateAdminComplaintDto.js +68 -0
- package/dist/models/NotificationTypeEnum.d.ts +5 -0
- package/dist/models/NotificationTypeEnum.js +6 -1
- package/dist/models/PaginatedAdminNotifications.d.ts +52 -0
- package/dist/models/PaginatedAdminNotifications.js +62 -0
- package/dist/models/index.d.ts +4 -11
- package/dist/models/index.js +4 -11
- package/package.json +1 -1
- package/src/apis/AdminComplaintsApi.ts +69 -0
- package/src/apis/AdminNotificationsApi.ts +256 -4
- package/src/apis/index.ts +0 -2
- package/src/models/AdminNotificationMarkedAsRead.ts +91 -0
- package/src/models/AdminNotificationUnreadCount.ts +91 -0
- package/src/models/AuditLogEntityTypeEnum.ts +6 -1
- package/src/models/CreateAdminComplaintDto.ts +126 -0
- package/src/models/NotificationTypeEnum.ts +6 -1
- package/src/models/PaginatedAdminNotifications.ts +107 -0
- package/src/models/index.ts +4 -11
- package/dist/apis/RateAdjustmentsApi.d.ts +0 -150
- package/dist/apis/RateAdjustmentsApi.js +0 -227
- package/dist/apis/RatesApi.d.ts +0 -94
- package/dist/apis/RatesApi.js +0 -140
- package/dist/esm/apis/RateAdjustmentsApi.d.ts +0 -150
- package/dist/esm/apis/RateAdjustmentsApi.js +0 -223
- package/dist/esm/apis/RatesApi.d.ts +0 -94
- package/dist/esm/apis/RatesApi.js +0 -136
- package/dist/esm/models/ApproveRateAdjustmentDto.d.ts +0 -32
- package/dist/esm/models/ApproveRateAdjustmentDto.js +0 -41
- package/dist/esm/models/CreateRateAdjustmentDto.d.ts +0 -52
- package/dist/esm/models/CreateRateAdjustmentDto.js +0 -57
- package/dist/esm/models/Rate.d.ts +0 -172
- package/dist/esm/models/Rate.js +0 -135
- package/dist/esm/models/RateAdjustment.d.ts +0 -143
- package/dist/esm/models/RateAdjustment.js +0 -100
- package/dist/esm/models/RateAdjustmentChargeDto.d.ts +0 -45
- package/dist/esm/models/RateAdjustmentChargeDto.js +0 -52
- package/dist/esm/models/RateAdjustmentStatusEnum.d.ts +0 -27
- package/dist/esm/models/RateAdjustmentStatusEnum.js +0 -45
- package/dist/esm/models/RateAdjustmentsSuccessResponse.d.ts +0 -45
- package/dist/esm/models/RateChargeTypeEnum.d.ts +0 -40
- package/dist/esm/models/RateChargeTypeEnum.js +0 -58
- package/dist/esm/models/RateStatusEnum.d.ts +0 -26
- package/dist/esm/models/RateStatusEnum.js +0 -44
- package/dist/esm/models/RatesSuccessResponse.d.ts +0 -45
- package/dist/esm/models/RejectRateAdjustmentDto.d.ts +0 -32
- package/dist/esm/models/RejectRateAdjustmentDto.js +0 -43
- package/dist/models/ApproveRateAdjustmentDto.d.ts +0 -32
- package/dist/models/ApproveRateAdjustmentDto.js +0 -48
- package/dist/models/CreateRateAdjustmentDto.d.ts +0 -52
- package/dist/models/CreateRateAdjustmentDto.js +0 -64
- package/dist/models/Rate.d.ts +0 -172
- package/dist/models/Rate.js +0 -142
- package/dist/models/RateAdjustment.d.ts +0 -143
- package/dist/models/RateAdjustment.js +0 -107
- package/dist/models/RateAdjustmentChargeDto.d.ts +0 -45
- package/dist/models/RateAdjustmentChargeDto.js +0 -59
- package/dist/models/RateAdjustmentStatusEnum.d.ts +0 -27
- package/dist/models/RateAdjustmentStatusEnum.js +0 -53
- package/dist/models/RateAdjustmentsSuccessResponse.d.ts +0 -45
- package/dist/models/RateAdjustmentsSuccessResponse.js +0 -57
- package/dist/models/RateChargeTypeEnum.d.ts +0 -40
- package/dist/models/RateChargeTypeEnum.js +0 -66
- package/dist/models/RateStatusEnum.d.ts +0 -26
- package/dist/models/RateStatusEnum.js +0 -52
- package/dist/models/RatesSuccessResponse.d.ts +0 -45
- package/dist/models/RatesSuccessResponse.js +0 -57
- package/dist/models/RejectRateAdjustmentDto.d.ts +0 -32
- package/dist/models/RejectRateAdjustmentDto.js +0 -50
- package/src/apis/RateAdjustmentsApi.ts +0 -395
- package/src/apis/RatesApi.ts +0 -224
- package/src/models/ApproveRateAdjustmentDto.ts +0 -65
- package/src/models/CreateRateAdjustmentDto.ts +0 -110
- package/src/models/Rate.ts +0 -289
- package/src/models/RateAdjustment.ts +0 -243
- package/src/models/RateAdjustmentChargeDto.ts +0 -94
- package/src/models/RateAdjustmentStatusEnum.ts +0 -55
- package/src/models/RateAdjustmentsSuccessResponse.ts +0 -91
- package/src/models/RateChargeTypeEnum.ts +0 -68
- package/src/models/RateStatusEnum.ts +0 -54
- package/src/models/RatesSuccessResponse.ts +0 -91
- package/src/models/RejectRateAdjustmentDto.ts +0 -66
|
@@ -15,23 +15,43 @@
|
|
|
15
15
|
|
|
16
16
|
import * as runtime from '../runtime';
|
|
17
17
|
import type {
|
|
18
|
+
AdminNotificationMarkedAsRead,
|
|
19
|
+
AdminNotificationUnreadCount,
|
|
18
20
|
AdminSendNotificationDto,
|
|
19
21
|
AdminSendNotificationResponse,
|
|
20
22
|
ErrorResponseDto,
|
|
23
|
+
PaginatedAdminNotifications,
|
|
21
24
|
} from '../models/index';
|
|
22
25
|
import {
|
|
26
|
+
AdminNotificationMarkedAsReadFromJSON,
|
|
27
|
+
AdminNotificationMarkedAsReadToJSON,
|
|
28
|
+
AdminNotificationUnreadCountFromJSON,
|
|
29
|
+
AdminNotificationUnreadCountToJSON,
|
|
23
30
|
AdminSendNotificationDtoFromJSON,
|
|
24
31
|
AdminSendNotificationDtoToJSON,
|
|
25
32
|
AdminSendNotificationResponseFromJSON,
|
|
26
33
|
AdminSendNotificationResponseToJSON,
|
|
27
34
|
ErrorResponseDtoFromJSON,
|
|
28
35
|
ErrorResponseDtoToJSON,
|
|
36
|
+
PaginatedAdminNotificationsFromJSON,
|
|
37
|
+
PaginatedAdminNotificationsToJSON,
|
|
29
38
|
} from '../models/index';
|
|
30
39
|
|
|
31
40
|
export interface AdminSendNotificationRequest {
|
|
32
41
|
adminSendNotificationDto: AdminSendNotificationDto;
|
|
33
42
|
}
|
|
34
43
|
|
|
44
|
+
export interface GetAdminNotificationsRequest {
|
|
45
|
+
page?: number;
|
|
46
|
+
limit?: number;
|
|
47
|
+
search?: string;
|
|
48
|
+
unreadOnly?: boolean;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface MarkAdminNotificationReadRequest {
|
|
52
|
+
id: string;
|
|
53
|
+
}
|
|
54
|
+
|
|
35
55
|
/**
|
|
36
56
|
* AdminNotificationsApi - interface
|
|
37
57
|
*
|
|
@@ -41,7 +61,7 @@ export interface AdminSendNotificationRequest {
|
|
|
41
61
|
export interface AdminNotificationsApiInterface {
|
|
42
62
|
/**
|
|
43
63
|
*
|
|
44
|
-
* @summary
|
|
64
|
+
* @summary Broadcast a notification to admins, consumers or a specific user
|
|
45
65
|
* @param {AdminSendNotificationDto} adminSendNotificationDto
|
|
46
66
|
* @param {*} [options] Override http request option.
|
|
47
67
|
* @throws {RequiredError}
|
|
@@ -50,10 +70,71 @@ export interface AdminNotificationsApiInterface {
|
|
|
50
70
|
adminSendNotificationRaw(requestParameters: AdminSendNotificationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AdminSendNotificationResponse>>;
|
|
51
71
|
|
|
52
72
|
/**
|
|
53
|
-
*
|
|
73
|
+
* Broadcast a notification to admins, consumers or a specific user
|
|
54
74
|
*/
|
|
55
75
|
adminSendNotification(requestParameters: AdminSendNotificationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AdminSendNotificationResponse>;
|
|
56
76
|
|
|
77
|
+
/**
|
|
78
|
+
*
|
|
79
|
+
* @summary List admin notifications (paginated)
|
|
80
|
+
* @param {number} [page]
|
|
81
|
+
* @param {number} [limit]
|
|
82
|
+
* @param {string} [search]
|
|
83
|
+
* @param {boolean} [unreadOnly]
|
|
84
|
+
* @param {*} [options] Override http request option.
|
|
85
|
+
* @throws {RequiredError}
|
|
86
|
+
* @memberof AdminNotificationsApiInterface
|
|
87
|
+
*/
|
|
88
|
+
getAdminNotificationsRaw(requestParameters: GetAdminNotificationsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedAdminNotifications>>;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* List admin notifications (paginated)
|
|
92
|
+
*/
|
|
93
|
+
getAdminNotifications(requestParameters: GetAdminNotificationsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedAdminNotifications>;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
*
|
|
97
|
+
* @summary Get unread admin notification count
|
|
98
|
+
* @param {*} [options] Override http request option.
|
|
99
|
+
* @throws {RequiredError}
|
|
100
|
+
* @memberof AdminNotificationsApiInterface
|
|
101
|
+
*/
|
|
102
|
+
getAdminUnreadNotificationCountRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AdminNotificationUnreadCount>>;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Get unread admin notification count
|
|
106
|
+
*/
|
|
107
|
+
getAdminUnreadNotificationCount(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AdminNotificationUnreadCount>;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
*
|
|
111
|
+
* @summary Mark admin notification as read
|
|
112
|
+
* @param {string} id
|
|
113
|
+
* @param {*} [options] Override http request option.
|
|
114
|
+
* @throws {RequiredError}
|
|
115
|
+
* @memberof AdminNotificationsApiInterface
|
|
116
|
+
*/
|
|
117
|
+
markAdminNotificationReadRaw(requestParameters: MarkAdminNotificationReadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AdminNotificationMarkedAsRead>>;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Mark admin notification as read
|
|
121
|
+
*/
|
|
122
|
+
markAdminNotificationRead(requestParameters: MarkAdminNotificationReadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AdminNotificationMarkedAsRead>;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
*
|
|
126
|
+
* @summary Mark all admin notifications as read
|
|
127
|
+
* @param {*} [options] Override http request option.
|
|
128
|
+
* @throws {RequiredError}
|
|
129
|
+
* @memberof AdminNotificationsApiInterface
|
|
130
|
+
*/
|
|
131
|
+
markAllAdminNotificationsReadRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Mark all admin notifications as read
|
|
135
|
+
*/
|
|
136
|
+
markAllAdminNotificationsRead(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
137
|
+
|
|
57
138
|
}
|
|
58
139
|
|
|
59
140
|
/**
|
|
@@ -62,7 +143,7 @@ export interface AdminNotificationsApiInterface {
|
|
|
62
143
|
export class AdminNotificationsApi extends runtime.BaseAPI implements AdminNotificationsApiInterface {
|
|
63
144
|
|
|
64
145
|
/**
|
|
65
|
-
*
|
|
146
|
+
* Broadcast a notification to admins, consumers or a specific user
|
|
66
147
|
*/
|
|
67
148
|
async adminSendNotificationRaw(requestParameters: AdminSendNotificationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AdminSendNotificationResponse>> {
|
|
68
149
|
if (requestParameters['adminSendNotificationDto'] == null) {
|
|
@@ -101,11 +182,182 @@ export class AdminNotificationsApi extends runtime.BaseAPI implements AdminNotif
|
|
|
101
182
|
}
|
|
102
183
|
|
|
103
184
|
/**
|
|
104
|
-
*
|
|
185
|
+
* Broadcast a notification to admins, consumers or a specific user
|
|
105
186
|
*/
|
|
106
187
|
async adminSendNotification(requestParameters: AdminSendNotificationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AdminSendNotificationResponse> {
|
|
107
188
|
const response = await this.adminSendNotificationRaw(requestParameters, initOverrides);
|
|
108
189
|
return await response.value();
|
|
109
190
|
}
|
|
110
191
|
|
|
192
|
+
/**
|
|
193
|
+
* List admin notifications (paginated)
|
|
194
|
+
*/
|
|
195
|
+
async getAdminNotificationsRaw(requestParameters: GetAdminNotificationsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedAdminNotifications>> {
|
|
196
|
+
const queryParameters: any = {};
|
|
197
|
+
|
|
198
|
+
if (requestParameters['page'] != null) {
|
|
199
|
+
queryParameters['page'] = requestParameters['page'];
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
if (requestParameters['limit'] != null) {
|
|
203
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
if (requestParameters['search'] != null) {
|
|
207
|
+
queryParameters['search'] = requestParameters['search'];
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
if (requestParameters['unreadOnly'] != null) {
|
|
211
|
+
queryParameters['unreadOnly'] = requestParameters['unreadOnly'];
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
215
|
+
|
|
216
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
217
|
+
const token = this.configuration.accessToken;
|
|
218
|
+
const tokenString = await token("bearer", []);
|
|
219
|
+
|
|
220
|
+
if (tokenString) {
|
|
221
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
let urlPath = `/api/v1/admin/notifications`;
|
|
226
|
+
|
|
227
|
+
const response = await this.request({
|
|
228
|
+
path: urlPath,
|
|
229
|
+
method: 'GET',
|
|
230
|
+
headers: headerParameters,
|
|
231
|
+
query: queryParameters,
|
|
232
|
+
}, initOverrides);
|
|
233
|
+
|
|
234
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedAdminNotificationsFromJSON(jsonValue));
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* List admin notifications (paginated)
|
|
239
|
+
*/
|
|
240
|
+
async getAdminNotifications(requestParameters: GetAdminNotificationsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedAdminNotifications> {
|
|
241
|
+
const response = await this.getAdminNotificationsRaw(requestParameters, initOverrides);
|
|
242
|
+
return await response.value();
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* Get unread admin notification count
|
|
247
|
+
*/
|
|
248
|
+
async getAdminUnreadNotificationCountRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AdminNotificationUnreadCount>> {
|
|
249
|
+
const queryParameters: any = {};
|
|
250
|
+
|
|
251
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
252
|
+
|
|
253
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
254
|
+
const token = this.configuration.accessToken;
|
|
255
|
+
const tokenString = await token("bearer", []);
|
|
256
|
+
|
|
257
|
+
if (tokenString) {
|
|
258
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
let urlPath = `/api/v1/admin/notifications/unread-count`;
|
|
263
|
+
|
|
264
|
+
const response = await this.request({
|
|
265
|
+
path: urlPath,
|
|
266
|
+
method: 'GET',
|
|
267
|
+
headers: headerParameters,
|
|
268
|
+
query: queryParameters,
|
|
269
|
+
}, initOverrides);
|
|
270
|
+
|
|
271
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => AdminNotificationUnreadCountFromJSON(jsonValue));
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* Get unread admin notification count
|
|
276
|
+
*/
|
|
277
|
+
async getAdminUnreadNotificationCount(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AdminNotificationUnreadCount> {
|
|
278
|
+
const response = await this.getAdminUnreadNotificationCountRaw(initOverrides);
|
|
279
|
+
return await response.value();
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Mark admin notification as read
|
|
284
|
+
*/
|
|
285
|
+
async markAdminNotificationReadRaw(requestParameters: MarkAdminNotificationReadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AdminNotificationMarkedAsRead>> {
|
|
286
|
+
if (requestParameters['id'] == null) {
|
|
287
|
+
throw new runtime.RequiredError(
|
|
288
|
+
'id',
|
|
289
|
+
'Required parameter "id" was null or undefined when calling markAdminNotificationRead().'
|
|
290
|
+
);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
const queryParameters: any = {};
|
|
294
|
+
|
|
295
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
296
|
+
|
|
297
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
298
|
+
const token = this.configuration.accessToken;
|
|
299
|
+
const tokenString = await token("bearer", []);
|
|
300
|
+
|
|
301
|
+
if (tokenString) {
|
|
302
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
let urlPath = `/api/v1/admin/notifications/{id}/read`;
|
|
307
|
+
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
308
|
+
|
|
309
|
+
const response = await this.request({
|
|
310
|
+
path: urlPath,
|
|
311
|
+
method: 'PATCH',
|
|
312
|
+
headers: headerParameters,
|
|
313
|
+
query: queryParameters,
|
|
314
|
+
}, initOverrides);
|
|
315
|
+
|
|
316
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => AdminNotificationMarkedAsReadFromJSON(jsonValue));
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* Mark admin notification as read
|
|
321
|
+
*/
|
|
322
|
+
async markAdminNotificationRead(requestParameters: MarkAdminNotificationReadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AdminNotificationMarkedAsRead> {
|
|
323
|
+
const response = await this.markAdminNotificationReadRaw(requestParameters, initOverrides);
|
|
324
|
+
return await response.value();
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* Mark all admin notifications as read
|
|
329
|
+
*/
|
|
330
|
+
async markAllAdminNotificationsReadRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
331
|
+
const queryParameters: any = {};
|
|
332
|
+
|
|
333
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
334
|
+
|
|
335
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
336
|
+
const token = this.configuration.accessToken;
|
|
337
|
+
const tokenString = await token("bearer", []);
|
|
338
|
+
|
|
339
|
+
if (tokenString) {
|
|
340
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
let urlPath = `/api/v1/admin/notifications/mark-all-read`;
|
|
345
|
+
|
|
346
|
+
const response = await this.request({
|
|
347
|
+
path: urlPath,
|
|
348
|
+
method: 'PATCH',
|
|
349
|
+
headers: headerParameters,
|
|
350
|
+
query: queryParameters,
|
|
351
|
+
}, initOverrides);
|
|
352
|
+
|
|
353
|
+
return new runtime.VoidApiResponse(response);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* Mark all admin notifications as read
|
|
358
|
+
*/
|
|
359
|
+
async markAllAdminNotificationsRead(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
360
|
+
await this.markAllAdminNotificationsReadRaw(initOverrides);
|
|
361
|
+
}
|
|
362
|
+
|
|
111
363
|
}
|
package/src/apis/index.ts
CHANGED
|
@@ -21,9 +21,7 @@ export * from './FieldWorkOrdersApi';
|
|
|
21
21
|
export * from './ManagementDashboardApi';
|
|
22
22
|
export * from './MetersApi';
|
|
23
23
|
export * from './NotificationsApi';
|
|
24
|
-
export * from './RateAdjustmentsApi';
|
|
25
24
|
export * from './RateDisplayApi';
|
|
26
|
-
export * from './RatesApi';
|
|
27
25
|
export * from './ReportsApi';
|
|
28
26
|
export * from './SettingsApi';
|
|
29
27
|
export * from './UsersApi';
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Electric Cooperative Consumer Portal API
|
|
5
|
+
* Multi-tenant SaaS platform for Philippine electric cooperatives
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
import type { Notification } from './Notification';
|
|
17
|
+
import {
|
|
18
|
+
NotificationFromJSON,
|
|
19
|
+
NotificationFromJSONTyped,
|
|
20
|
+
NotificationToJSON,
|
|
21
|
+
NotificationToJSONTyped,
|
|
22
|
+
} from './Notification';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @export
|
|
27
|
+
* @interface AdminNotificationMarkedAsRead
|
|
28
|
+
*/
|
|
29
|
+
export interface AdminNotificationMarkedAsRead {
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @type {boolean}
|
|
33
|
+
* @memberof AdminNotificationMarkedAsRead
|
|
34
|
+
*/
|
|
35
|
+
success: boolean;
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @type {string}
|
|
39
|
+
* @memberof AdminNotificationMarkedAsRead
|
|
40
|
+
*/
|
|
41
|
+
error?: string;
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
* @type {Notification}
|
|
45
|
+
* @memberof AdminNotificationMarkedAsRead
|
|
46
|
+
*/
|
|
47
|
+
data: Notification;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Check if a given object implements the AdminNotificationMarkedAsRead interface.
|
|
52
|
+
*/
|
|
53
|
+
export function instanceOfAdminNotificationMarkedAsRead(value: object): value is AdminNotificationMarkedAsRead {
|
|
54
|
+
if (!('success' in value) || value['success'] === undefined) return false;
|
|
55
|
+
if (!('data' in value) || value['data'] === undefined) return false;
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function AdminNotificationMarkedAsReadFromJSON(json: any): AdminNotificationMarkedAsRead {
|
|
60
|
+
return AdminNotificationMarkedAsReadFromJSONTyped(json, false);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function AdminNotificationMarkedAsReadFromJSONTyped(json: any, ignoreDiscriminator: boolean): AdminNotificationMarkedAsRead {
|
|
64
|
+
if (json == null) {
|
|
65
|
+
return json;
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
|
|
69
|
+
'success': json['success'],
|
|
70
|
+
'error': json['error'] == null ? undefined : json['error'],
|
|
71
|
+
'data': NotificationFromJSON(json['data']),
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function AdminNotificationMarkedAsReadToJSON(json: any): AdminNotificationMarkedAsRead {
|
|
76
|
+
return AdminNotificationMarkedAsReadToJSONTyped(json, false);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function AdminNotificationMarkedAsReadToJSONTyped(value?: AdminNotificationMarkedAsRead | null, ignoreDiscriminator: boolean = false): any {
|
|
80
|
+
if (value == null) {
|
|
81
|
+
return value;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return {
|
|
85
|
+
|
|
86
|
+
'success': value['success'],
|
|
87
|
+
'error': value['error'],
|
|
88
|
+
'data': NotificationToJSON(value['data']),
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Electric Cooperative Consumer Portal API
|
|
5
|
+
* Multi-tenant SaaS platform for Philippine electric cooperatives
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
import type { NotificationUnreadCountResponseDto } from './NotificationUnreadCountResponseDto';
|
|
17
|
+
import {
|
|
18
|
+
NotificationUnreadCountResponseDtoFromJSON,
|
|
19
|
+
NotificationUnreadCountResponseDtoFromJSONTyped,
|
|
20
|
+
NotificationUnreadCountResponseDtoToJSON,
|
|
21
|
+
NotificationUnreadCountResponseDtoToJSONTyped,
|
|
22
|
+
} from './NotificationUnreadCountResponseDto';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @export
|
|
27
|
+
* @interface AdminNotificationUnreadCount
|
|
28
|
+
*/
|
|
29
|
+
export interface AdminNotificationUnreadCount {
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @type {boolean}
|
|
33
|
+
* @memberof AdminNotificationUnreadCount
|
|
34
|
+
*/
|
|
35
|
+
success: boolean;
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @type {string}
|
|
39
|
+
* @memberof AdminNotificationUnreadCount
|
|
40
|
+
*/
|
|
41
|
+
error?: string;
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
* @type {NotificationUnreadCountResponseDto}
|
|
45
|
+
* @memberof AdminNotificationUnreadCount
|
|
46
|
+
*/
|
|
47
|
+
data: NotificationUnreadCountResponseDto;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Check if a given object implements the AdminNotificationUnreadCount interface.
|
|
52
|
+
*/
|
|
53
|
+
export function instanceOfAdminNotificationUnreadCount(value: object): value is AdminNotificationUnreadCount {
|
|
54
|
+
if (!('success' in value) || value['success'] === undefined) return false;
|
|
55
|
+
if (!('data' in value) || value['data'] === undefined) return false;
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function AdminNotificationUnreadCountFromJSON(json: any): AdminNotificationUnreadCount {
|
|
60
|
+
return AdminNotificationUnreadCountFromJSONTyped(json, false);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function AdminNotificationUnreadCountFromJSONTyped(json: any, ignoreDiscriminator: boolean): AdminNotificationUnreadCount {
|
|
64
|
+
if (json == null) {
|
|
65
|
+
return json;
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
|
|
69
|
+
'success': json['success'],
|
|
70
|
+
'error': json['error'] == null ? undefined : json['error'],
|
|
71
|
+
'data': NotificationUnreadCountResponseDtoFromJSON(json['data']),
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function AdminNotificationUnreadCountToJSON(json: any): AdminNotificationUnreadCount {
|
|
76
|
+
return AdminNotificationUnreadCountToJSONTyped(json, false);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function AdminNotificationUnreadCountToJSONTyped(value?: AdminNotificationUnreadCount | null, ignoreDiscriminator: boolean = false): any {
|
|
80
|
+
if (value == null) {
|
|
81
|
+
return value;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return {
|
|
85
|
+
|
|
86
|
+
'success': value['success'],
|
|
87
|
+
'error': value['error'],
|
|
88
|
+
'data': NotificationUnreadCountResponseDtoToJSON(value['data']),
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
@@ -23,7 +23,12 @@ export const AuditLogEntityTypeEnum = {
|
|
|
23
23
|
User: 'user',
|
|
24
24
|
ConsumerAccount: 'consumer_account',
|
|
25
25
|
ServiceRequest: 'service_request',
|
|
26
|
-
Complaint: 'complaint'
|
|
26
|
+
Complaint: 'complaint',
|
|
27
|
+
Consumer: 'consumer',
|
|
28
|
+
RateAdjustment: 'rate_adjustment',
|
|
29
|
+
RateDisplay: 'rate_display',
|
|
30
|
+
Bill: 'bill',
|
|
31
|
+
Settings: 'settings'
|
|
27
32
|
} as const;
|
|
28
33
|
export type AuditLogEntityTypeEnum = typeof AuditLogEntityTypeEnum[keyof typeof AuditLogEntityTypeEnum];
|
|
29
34
|
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Electric Cooperative Consumer Portal API
|
|
5
|
+
* Multi-tenant SaaS platform for Philippine electric cooperatives
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
import type { ComplaintPriorityEnum } from './ComplaintPriorityEnum';
|
|
17
|
+
import {
|
|
18
|
+
ComplaintPriorityEnumFromJSON,
|
|
19
|
+
ComplaintPriorityEnumFromJSONTyped,
|
|
20
|
+
ComplaintPriorityEnumToJSON,
|
|
21
|
+
ComplaintPriorityEnumToJSONTyped,
|
|
22
|
+
} from './ComplaintPriorityEnum';
|
|
23
|
+
import type { ComplaintTypeEnum } from './ComplaintTypeEnum';
|
|
24
|
+
import {
|
|
25
|
+
ComplaintTypeEnumFromJSON,
|
|
26
|
+
ComplaintTypeEnumFromJSONTyped,
|
|
27
|
+
ComplaintTypeEnumToJSON,
|
|
28
|
+
ComplaintTypeEnumToJSONTyped,
|
|
29
|
+
} from './ComplaintTypeEnum';
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* @export
|
|
34
|
+
* @interface CreateAdminComplaintDto
|
|
35
|
+
*/
|
|
36
|
+
export interface CreateAdminComplaintDto {
|
|
37
|
+
/**
|
|
38
|
+
* Consumer ID to file the complaint on behalf of
|
|
39
|
+
* @type {string}
|
|
40
|
+
* @memberof CreateAdminComplaintDto
|
|
41
|
+
*/
|
|
42
|
+
consumerId: string;
|
|
43
|
+
/**
|
|
44
|
+
*
|
|
45
|
+
* @type {ComplaintTypeEnum}
|
|
46
|
+
* @memberof CreateAdminComplaintDto
|
|
47
|
+
*/
|
|
48
|
+
type: ComplaintTypeEnum;
|
|
49
|
+
/**
|
|
50
|
+
*
|
|
51
|
+
* @type {string}
|
|
52
|
+
* @memberof CreateAdminComplaintDto
|
|
53
|
+
*/
|
|
54
|
+
subject: string;
|
|
55
|
+
/**
|
|
56
|
+
*
|
|
57
|
+
* @type {string}
|
|
58
|
+
* @memberof CreateAdminComplaintDto
|
|
59
|
+
*/
|
|
60
|
+
description: string;
|
|
61
|
+
/**
|
|
62
|
+
*
|
|
63
|
+
* @type {ComplaintPriorityEnum}
|
|
64
|
+
* @memberof CreateAdminComplaintDto
|
|
65
|
+
*/
|
|
66
|
+
priority?: ComplaintPriorityEnum;
|
|
67
|
+
/**
|
|
68
|
+
*
|
|
69
|
+
* @type {Array<string>}
|
|
70
|
+
* @memberof CreateAdminComplaintDto
|
|
71
|
+
*/
|
|
72
|
+
photos?: Array<string>;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Check if a given object implements the CreateAdminComplaintDto interface.
|
|
79
|
+
*/
|
|
80
|
+
export function instanceOfCreateAdminComplaintDto(value: object): value is CreateAdminComplaintDto {
|
|
81
|
+
if (!('consumerId' in value) || value['consumerId'] === undefined) return false;
|
|
82
|
+
if (!('type' in value) || value['type'] === undefined) return false;
|
|
83
|
+
if (!('subject' in value) || value['subject'] === undefined) return false;
|
|
84
|
+
if (!('description' in value) || value['description'] === undefined) return false;
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export function CreateAdminComplaintDtoFromJSON(json: any): CreateAdminComplaintDto {
|
|
89
|
+
return CreateAdminComplaintDtoFromJSONTyped(json, false);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export function CreateAdminComplaintDtoFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateAdminComplaintDto {
|
|
93
|
+
if (json == null) {
|
|
94
|
+
return json;
|
|
95
|
+
}
|
|
96
|
+
return {
|
|
97
|
+
|
|
98
|
+
'consumerId': json['consumerId'],
|
|
99
|
+
'type': ComplaintTypeEnumFromJSON(json['type']),
|
|
100
|
+
'subject': json['subject'],
|
|
101
|
+
'description': json['description'],
|
|
102
|
+
'priority': json['priority'] == null ? undefined : ComplaintPriorityEnumFromJSON(json['priority']),
|
|
103
|
+
'photos': json['photos'] == null ? undefined : json['photos'],
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export function CreateAdminComplaintDtoToJSON(json: any): CreateAdminComplaintDto {
|
|
108
|
+
return CreateAdminComplaintDtoToJSONTyped(json, false);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export function CreateAdminComplaintDtoToJSONTyped(value?: CreateAdminComplaintDto | null, ignoreDiscriminator: boolean = false): any {
|
|
112
|
+
if (value == null) {
|
|
113
|
+
return value;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return {
|
|
117
|
+
|
|
118
|
+
'consumerId': value['consumerId'],
|
|
119
|
+
'type': ComplaintTypeEnumToJSON(value['type']),
|
|
120
|
+
'subject': value['subject'],
|
|
121
|
+
'description': value['description'],
|
|
122
|
+
'priority': ComplaintPriorityEnumToJSON(value['priority']),
|
|
123
|
+
'photos': value['photos'],
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
|
|
@@ -20,7 +20,12 @@
|
|
|
20
20
|
export const NotificationTypeEnum = {
|
|
21
21
|
Bill: 'bill',
|
|
22
22
|
Complaint: 'complaint',
|
|
23
|
-
System: 'system'
|
|
23
|
+
System: 'system',
|
|
24
|
+
ServiceRequest: 'service_request',
|
|
25
|
+
WorkOrder: 'work_order',
|
|
26
|
+
Outage: 'outage',
|
|
27
|
+
Payment: 'payment',
|
|
28
|
+
MeterReading: 'meter_reading'
|
|
24
29
|
} as const;
|
|
25
30
|
export type NotificationTypeEnum = typeof NotificationTypeEnum[keyof typeof NotificationTypeEnum];
|
|
26
31
|
|