electric-coop-api 0.1.49 → 0.1.51

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 (58) hide show
  1. package/.openapi-generator/FILES +7 -0
  2. package/README.md +2 -2
  3. package/dist/apis/AdminAuditLogsApi.d.ts +64 -0
  4. package/dist/apis/AdminAuditLogsApi.js +90 -0
  5. package/dist/apis/AdminNotificationsApi.d.ts +50 -0
  6. package/dist/apis/AdminNotificationsApi.js +71 -0
  7. package/dist/apis/AdminWorkOrdersApi.d.ts +3 -1
  8. package/dist/apis/AdminWorkOrdersApi.js +3 -0
  9. package/dist/apis/index.d.ts +2 -0
  10. package/dist/apis/index.js +2 -0
  11. package/dist/esm/apis/AdminAuditLogsApi.d.ts +64 -0
  12. package/dist/esm/apis/AdminAuditLogsApi.js +86 -0
  13. package/dist/esm/apis/AdminNotificationsApi.d.ts +50 -0
  14. package/dist/esm/apis/AdminNotificationsApi.js +67 -0
  15. package/dist/esm/apis/AdminWorkOrdersApi.d.ts +3 -1
  16. package/dist/esm/apis/AdminWorkOrdersApi.js +3 -0
  17. package/dist/esm/apis/index.d.ts +2 -0
  18. package/dist/esm/apis/index.js +2 -0
  19. package/dist/esm/models/AdminAuditLogsPaginatedResponse.d.ts +52 -0
  20. package/dist/esm/models/AdminAuditLogsPaginatedResponse.js +55 -0
  21. package/dist/esm/models/AdminSendNotificationDto.d.ts +58 -0
  22. package/dist/esm/models/AdminSendNotificationDto.js +59 -0
  23. package/dist/esm/models/AdminSendNotificationResponse.d.ts +44 -0
  24. package/dist/esm/models/AdminSendNotificationResponse.js +49 -0
  25. package/dist/esm/models/AuditLog.d.ts +98 -0
  26. package/dist/esm/models/AuditLog.js +79 -0
  27. package/dist/esm/models/NotificationTargetEnum.d.ts +27 -0
  28. package/dist/esm/models/NotificationTargetEnum.js +45 -0
  29. package/dist/esm/models/UpdateWorkOrderDto.d.ts +6 -0
  30. package/dist/esm/models/UpdateWorkOrderDto.js +2 -0
  31. package/dist/esm/models/index.d.ts +5 -0
  32. package/dist/esm/models/index.js +5 -0
  33. package/dist/models/AdminAuditLogsPaginatedResponse.d.ts +52 -0
  34. package/dist/models/AdminAuditLogsPaginatedResponse.js +62 -0
  35. package/dist/models/AdminSendNotificationDto.d.ts +58 -0
  36. package/dist/models/AdminSendNotificationDto.js +66 -0
  37. package/dist/models/AdminSendNotificationResponse.d.ts +44 -0
  38. package/dist/models/AdminSendNotificationResponse.js +56 -0
  39. package/dist/models/AuditLog.d.ts +98 -0
  40. package/dist/models/AuditLog.js +86 -0
  41. package/dist/models/NotificationTargetEnum.d.ts +27 -0
  42. package/dist/models/NotificationTargetEnum.js +53 -0
  43. package/dist/models/UpdateWorkOrderDto.d.ts +6 -0
  44. package/dist/models/UpdateWorkOrderDto.js +2 -0
  45. package/dist/models/index.d.ts +5 -0
  46. package/dist/models/index.js +5 -0
  47. package/package.json +1 -1
  48. package/src/apis/AdminAuditLogsApi.ts +144 -0
  49. package/src/apis/AdminNotificationsApi.ts +111 -0
  50. package/src/apis/AdminWorkOrdersApi.ts +7 -1
  51. package/src/apis/index.ts +2 -0
  52. package/src/models/AdminAuditLogsPaginatedResponse.ts +107 -0
  53. package/src/models/AdminSendNotificationDto.ts +118 -0
  54. package/src/models/AdminSendNotificationResponse.ts +83 -0
  55. package/src/models/AuditLog.ts +161 -0
  56. package/src/models/NotificationTargetEnum.ts +55 -0
  57. package/src/models/UpdateWorkOrderDto.ts +8 -0
  58. package/src/models/index.ts +5 -0
@@ -4,10 +4,12 @@
4
4
  README.md
5
5
  package.json
6
6
  src/apis/AdminApi.ts
7
+ src/apis/AdminAuditLogsApi.ts
7
8
  src/apis/AdminAuthApi.ts
8
9
  src/apis/AdminBillsApi.ts
9
10
  src/apis/AdminComplaintsApi.ts
10
11
  src/apis/AdminConsumersApi.ts
12
+ src/apis/AdminNotificationsApi.ts
11
13
  src/apis/AdminOutagesApi.ts
12
14
  src/apis/AdminServiceRequestsApi.ts
13
15
  src/apis/AdminWorkOrdersApi.ts
@@ -32,10 +34,13 @@ src/models/AccountDto.ts
32
34
  src/models/AccountList.ts
33
35
  src/models/AccountListDto.ts
34
36
  src/models/AdminAssignWorkOrderResponse.ts
37
+ src/models/AdminAuditLogsPaginatedResponse.ts
35
38
  src/models/AdminCreateWorkOrderResponse.ts
36
39
  src/models/AdminLoginDto.ts
37
40
  src/models/AdminOutageStatsResponse.ts
38
41
  src/models/AdminOutagesPaginatedResponse.ts
42
+ src/models/AdminSendNotificationDto.ts
43
+ src/models/AdminSendNotificationResponse.ts
39
44
  src/models/AdminServiceRequestResponse.ts
40
45
  src/models/AdminServiceRequestStatsResponse.ts
41
46
  src/models/AdminServiceRequestsPaginatedResponse.ts
@@ -46,6 +51,7 @@ src/models/AdminWorkOrderStatsResponse.ts
46
51
  src/models/AdminWorkOrdersPaginatedResponse.ts
47
52
  src/models/ApproveRateAdjustmentDto.ts
48
53
  src/models/AssignWorkOrderDto.ts
54
+ src/models/AuditLog.ts
49
55
  src/models/AuthAdminLoginResponse.ts
50
56
  src/models/AuthConsumerAccountDto.ts
51
57
  src/models/AuthLoginResponse.ts
@@ -115,6 +121,7 @@ src/models/MeterStatsResponseDto.ts
115
121
  src/models/MeterStatsSuccessResponse.ts
116
122
  src/models/Notification.ts
117
123
  src/models/NotificationMarkedAsRead.ts
124
+ src/models/NotificationTargetEnum.ts
118
125
  src/models/NotificationTypeEnum.ts
119
126
  src/models/NotificationUnreadCount.ts
120
127
  src/models/NotificationUnreadCountResponseDto.ts
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- ## electric-coop-api@0.1.49
1
+ ## electric-coop-api@0.1.51
2
2
 
3
3
  This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments:
4
4
 
@@ -36,7 +36,7 @@ navigate to the folder of your consuming project and run one of the following co
36
36
  _published:_
37
37
 
38
38
  ```
39
- npm install electric-coop-api@0.1.49 --save
39
+ npm install electric-coop-api@0.1.51 --save
40
40
  ```
41
41
 
42
42
  _unPublished (not recommended):_
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Electric Cooperative Consumer Portal API
3
+ * Multi-tenant SaaS platform for Philippine electric cooperatives
4
+ *
5
+ * The version of the OpenAPI document: 1.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import * as runtime from '../runtime';
13
+ import type { AdminAuditLogsPaginatedResponse } from '../models/index';
14
+ export interface GetAdminAuditLogsRequest {
15
+ page?: number;
16
+ limit?: number;
17
+ search?: string;
18
+ entityType?: string;
19
+ action?: string;
20
+ userId?: string;
21
+ from?: string;
22
+ to?: string;
23
+ }
24
+ /**
25
+ * AdminAuditLogsApi - interface
26
+ *
27
+ * @export
28
+ * @interface AdminAuditLogsApiInterface
29
+ */
30
+ export interface AdminAuditLogsApiInterface {
31
+ /**
32
+ *
33
+ * @summary List audit logs (admin)
34
+ * @param {number} [page]
35
+ * @param {number} [limit]
36
+ * @param {string} [search]
37
+ * @param {string} [entityType] outage | work_order
38
+ * @param {string} [action] CREATE | UPDATE | ASSIGN | STATUS_CHANGE
39
+ * @param {string} [userId] Filter by actor user ID
40
+ * @param {string} [from] From date (ISO)
41
+ * @param {string} [to] To date (ISO)
42
+ * @param {*} [options] Override http request option.
43
+ * @throws {RequiredError}
44
+ * @memberof AdminAuditLogsApiInterface
45
+ */
46
+ getAdminAuditLogsRaw(requestParameters: GetAdminAuditLogsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AdminAuditLogsPaginatedResponse>>;
47
+ /**
48
+ * List audit logs (admin)
49
+ */
50
+ getAdminAuditLogs(requestParameters: GetAdminAuditLogsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AdminAuditLogsPaginatedResponse>;
51
+ }
52
+ /**
53
+ *
54
+ */
55
+ export declare class AdminAuditLogsApi extends runtime.BaseAPI implements AdminAuditLogsApiInterface {
56
+ /**
57
+ * List audit logs (admin)
58
+ */
59
+ getAdminAuditLogsRaw(requestParameters: GetAdminAuditLogsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AdminAuditLogsPaginatedResponse>>;
60
+ /**
61
+ * List audit logs (admin)
62
+ */
63
+ getAdminAuditLogs(requestParameters?: GetAdminAuditLogsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AdminAuditLogsPaginatedResponse>;
64
+ }
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Electric Cooperative Consumer Portal API
6
+ * Multi-tenant SaaS platform for Philippine electric cooperatives
7
+ *
8
+ * The version of the OpenAPI document: 1.0
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
16
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
17
+ return new (P || (P = Promise))(function (resolve, reject) {
18
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
19
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
20
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
21
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
22
+ });
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.AdminAuditLogsApi = void 0;
26
+ const runtime = require("../runtime");
27
+ const index_1 = require("../models/index");
28
+ /**
29
+ *
30
+ */
31
+ class AdminAuditLogsApi extends runtime.BaseAPI {
32
+ /**
33
+ * List audit logs (admin)
34
+ */
35
+ getAdminAuditLogsRaw(requestParameters, initOverrides) {
36
+ return __awaiter(this, void 0, void 0, function* () {
37
+ const queryParameters = {};
38
+ if (requestParameters['page'] != null) {
39
+ queryParameters['page'] = requestParameters['page'];
40
+ }
41
+ if (requestParameters['limit'] != null) {
42
+ queryParameters['limit'] = requestParameters['limit'];
43
+ }
44
+ if (requestParameters['search'] != null) {
45
+ queryParameters['search'] = requestParameters['search'];
46
+ }
47
+ if (requestParameters['entityType'] != null) {
48
+ queryParameters['entityType'] = requestParameters['entityType'];
49
+ }
50
+ if (requestParameters['action'] != null) {
51
+ queryParameters['action'] = requestParameters['action'];
52
+ }
53
+ if (requestParameters['userId'] != null) {
54
+ queryParameters['userId'] = requestParameters['userId'];
55
+ }
56
+ if (requestParameters['from'] != null) {
57
+ queryParameters['from'] = requestParameters['from'];
58
+ }
59
+ if (requestParameters['to'] != null) {
60
+ queryParameters['to'] = requestParameters['to'];
61
+ }
62
+ const headerParameters = {};
63
+ if (this.configuration && this.configuration.accessToken) {
64
+ const token = this.configuration.accessToken;
65
+ const tokenString = yield token("bearer", []);
66
+ if (tokenString) {
67
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
68
+ }
69
+ }
70
+ let urlPath = `/api/v1/admin/audit-logs`;
71
+ const response = yield this.request({
72
+ path: urlPath,
73
+ method: 'GET',
74
+ headers: headerParameters,
75
+ query: queryParameters,
76
+ }, initOverrides);
77
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.AdminAuditLogsPaginatedResponseFromJSON)(jsonValue));
78
+ });
79
+ }
80
+ /**
81
+ * List audit logs (admin)
82
+ */
83
+ getAdminAuditLogs() {
84
+ return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
85
+ const response = yield this.getAdminAuditLogsRaw(requestParameters, initOverrides);
86
+ return yield response.value();
87
+ });
88
+ }
89
+ }
90
+ exports.AdminAuditLogsApi = AdminAuditLogsApi;
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Electric Cooperative Consumer Portal API
3
+ * Multi-tenant SaaS platform for Philippine electric cooperatives
4
+ *
5
+ * The version of the OpenAPI document: 1.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import * as runtime from '../runtime';
13
+ import type { AdminSendNotificationDto, AdminSendNotificationResponse } from '../models/index';
14
+ export interface AdminSendNotificationRequest {
15
+ adminSendNotificationDto: AdminSendNotificationDto;
16
+ }
17
+ /**
18
+ * AdminNotificationsApi - interface
19
+ *
20
+ * @export
21
+ * @interface AdminNotificationsApiInterface
22
+ */
23
+ export interface AdminNotificationsApiInterface {
24
+ /**
25
+ *
26
+ * @summary Send/broadcast a notification (admin)
27
+ * @param {AdminSendNotificationDto} adminSendNotificationDto
28
+ * @param {*} [options] Override http request option.
29
+ * @throws {RequiredError}
30
+ * @memberof AdminNotificationsApiInterface
31
+ */
32
+ adminSendNotificationRaw(requestParameters: AdminSendNotificationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AdminSendNotificationResponse>>;
33
+ /**
34
+ * Send/broadcast a notification (admin)
35
+ */
36
+ adminSendNotification(requestParameters: AdminSendNotificationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AdminSendNotificationResponse>;
37
+ }
38
+ /**
39
+ *
40
+ */
41
+ export declare class AdminNotificationsApi extends runtime.BaseAPI implements AdminNotificationsApiInterface {
42
+ /**
43
+ * Send/broadcast a notification (admin)
44
+ */
45
+ adminSendNotificationRaw(requestParameters: AdminSendNotificationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AdminSendNotificationResponse>>;
46
+ /**
47
+ * Send/broadcast a notification (admin)
48
+ */
49
+ adminSendNotification(requestParameters: AdminSendNotificationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AdminSendNotificationResponse>;
50
+ }
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Electric Cooperative Consumer Portal API
6
+ * Multi-tenant SaaS platform for Philippine electric cooperatives
7
+ *
8
+ * The version of the OpenAPI document: 1.0
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
16
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
17
+ return new (P || (P = Promise))(function (resolve, reject) {
18
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
19
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
20
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
21
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
22
+ });
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.AdminNotificationsApi = void 0;
26
+ const runtime = require("../runtime");
27
+ const index_1 = require("../models/index");
28
+ /**
29
+ *
30
+ */
31
+ class AdminNotificationsApi extends runtime.BaseAPI {
32
+ /**
33
+ * Send/broadcast a notification (admin)
34
+ */
35
+ adminSendNotificationRaw(requestParameters, initOverrides) {
36
+ return __awaiter(this, void 0, void 0, function* () {
37
+ if (requestParameters['adminSendNotificationDto'] == null) {
38
+ throw new runtime.RequiredError('adminSendNotificationDto', 'Required parameter "adminSendNotificationDto" was null or undefined when calling adminSendNotification().');
39
+ }
40
+ const queryParameters = {};
41
+ const headerParameters = {};
42
+ headerParameters['Content-Type'] = 'application/json';
43
+ if (this.configuration && this.configuration.accessToken) {
44
+ const token = this.configuration.accessToken;
45
+ const tokenString = yield token("bearer", []);
46
+ if (tokenString) {
47
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
48
+ }
49
+ }
50
+ let urlPath = `/api/v1/admin/notifications/send`;
51
+ const response = yield this.request({
52
+ path: urlPath,
53
+ method: 'POST',
54
+ headers: headerParameters,
55
+ query: queryParameters,
56
+ body: (0, index_1.AdminSendNotificationDtoToJSON)(requestParameters['adminSendNotificationDto']),
57
+ }, initOverrides);
58
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.AdminSendNotificationResponseFromJSON)(jsonValue));
59
+ });
60
+ }
61
+ /**
62
+ * Send/broadcast a notification (admin)
63
+ */
64
+ adminSendNotification(requestParameters, initOverrides) {
65
+ return __awaiter(this, void 0, void 0, function* () {
66
+ const response = yield this.adminSendNotificationRaw(requestParameters, initOverrides);
67
+ return yield response.value();
68
+ });
69
+ }
70
+ }
71
+ exports.AdminNotificationsApi = AdminNotificationsApi;
@@ -29,6 +29,7 @@ export interface GetAdminWorkOrdersRequest {
29
29
  type?: WorkOrderTypeEnum;
30
30
  assignedTo?: string;
31
31
  consumerId?: string;
32
+ outageId?: string;
32
33
  }
33
34
  export interface UpdateAdminWorkOrderRequest {
34
35
  id: string;
@@ -98,11 +99,12 @@ export interface AdminWorkOrdersApiInterface {
98
99
  * @summary List work orders (admin)
99
100
  * @param {number} [page]
100
101
  * @param {number} [limit]
101
- * @param {string} [search]
102
+ * @param {string} [search] Search by work order number, title, or location
102
103
  * @param {WorkOrderStatusEnum} [status]
103
104
  * @param {WorkOrderTypeEnum} [type]
104
105
  * @param {string} [assignedTo]
105
106
  * @param {string} [consumerId]
107
+ * @param {string} [outageId] Filter work orders by linked outage
106
108
  * @param {*} [options] Override http request option.
107
109
  * @throws {RequiredError}
108
110
  * @memberof AdminWorkOrdersApiInterface
@@ -206,6 +206,9 @@ class AdminWorkOrdersApi extends runtime.BaseAPI {
206
206
  if (requestParameters['consumerId'] != null) {
207
207
  queryParameters['consumerId'] = requestParameters['consumerId'];
208
208
  }
209
+ if (requestParameters['outageId'] != null) {
210
+ queryParameters['outageId'] = requestParameters['outageId'];
211
+ }
209
212
  const headerParameters = {};
210
213
  if (this.configuration && this.configuration.accessToken) {
211
214
  const token = this.configuration.accessToken;
@@ -1,8 +1,10 @@
1
1
  export * from './AdminApi';
2
+ export * from './AdminAuditLogsApi';
2
3
  export * from './AdminAuthApi';
3
4
  export * from './AdminBillsApi';
4
5
  export * from './AdminComplaintsApi';
5
6
  export * from './AdminConsumersApi';
7
+ export * from './AdminNotificationsApi';
6
8
  export * from './AdminOutagesApi';
7
9
  export * from './AdminServiceRequestsApi';
8
10
  export * from './AdminWorkOrdersApi';
@@ -17,10 +17,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  /* tslint:disable */
18
18
  /* eslint-disable */
19
19
  __exportStar(require("./AdminApi"), exports);
20
+ __exportStar(require("./AdminAuditLogsApi"), exports);
20
21
  __exportStar(require("./AdminAuthApi"), exports);
21
22
  __exportStar(require("./AdminBillsApi"), exports);
22
23
  __exportStar(require("./AdminComplaintsApi"), exports);
23
24
  __exportStar(require("./AdminConsumersApi"), exports);
25
+ __exportStar(require("./AdminNotificationsApi"), exports);
24
26
  __exportStar(require("./AdminOutagesApi"), exports);
25
27
  __exportStar(require("./AdminServiceRequestsApi"), exports);
26
28
  __exportStar(require("./AdminWorkOrdersApi"), exports);
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Electric Cooperative Consumer Portal API
3
+ * Multi-tenant SaaS platform for Philippine electric cooperatives
4
+ *
5
+ * The version of the OpenAPI document: 1.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import * as runtime from '../runtime';
13
+ import type { AdminAuditLogsPaginatedResponse } from '../models/index';
14
+ export interface GetAdminAuditLogsRequest {
15
+ page?: number;
16
+ limit?: number;
17
+ search?: string;
18
+ entityType?: string;
19
+ action?: string;
20
+ userId?: string;
21
+ from?: string;
22
+ to?: string;
23
+ }
24
+ /**
25
+ * AdminAuditLogsApi - interface
26
+ *
27
+ * @export
28
+ * @interface AdminAuditLogsApiInterface
29
+ */
30
+ export interface AdminAuditLogsApiInterface {
31
+ /**
32
+ *
33
+ * @summary List audit logs (admin)
34
+ * @param {number} [page]
35
+ * @param {number} [limit]
36
+ * @param {string} [search]
37
+ * @param {string} [entityType] outage | work_order
38
+ * @param {string} [action] CREATE | UPDATE | ASSIGN | STATUS_CHANGE
39
+ * @param {string} [userId] Filter by actor user ID
40
+ * @param {string} [from] From date (ISO)
41
+ * @param {string} [to] To date (ISO)
42
+ * @param {*} [options] Override http request option.
43
+ * @throws {RequiredError}
44
+ * @memberof AdminAuditLogsApiInterface
45
+ */
46
+ getAdminAuditLogsRaw(requestParameters: GetAdminAuditLogsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AdminAuditLogsPaginatedResponse>>;
47
+ /**
48
+ * List audit logs (admin)
49
+ */
50
+ getAdminAuditLogs(requestParameters: GetAdminAuditLogsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AdminAuditLogsPaginatedResponse>;
51
+ }
52
+ /**
53
+ *
54
+ */
55
+ export declare class AdminAuditLogsApi extends runtime.BaseAPI implements AdminAuditLogsApiInterface {
56
+ /**
57
+ * List audit logs (admin)
58
+ */
59
+ getAdminAuditLogsRaw(requestParameters: GetAdminAuditLogsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AdminAuditLogsPaginatedResponse>>;
60
+ /**
61
+ * List audit logs (admin)
62
+ */
63
+ getAdminAuditLogs(requestParameters?: GetAdminAuditLogsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AdminAuditLogsPaginatedResponse>;
64
+ }
@@ -0,0 +1,86 @@
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
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
+ return new (P || (P = Promise))(function (resolve, reject) {
17
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
21
+ });
22
+ };
23
+ import * as runtime from '../runtime';
24
+ import { AdminAuditLogsPaginatedResponseFromJSON, } from '../models/index';
25
+ /**
26
+ *
27
+ */
28
+ export class AdminAuditLogsApi extends runtime.BaseAPI {
29
+ /**
30
+ * List audit logs (admin)
31
+ */
32
+ getAdminAuditLogsRaw(requestParameters, initOverrides) {
33
+ return __awaiter(this, void 0, void 0, function* () {
34
+ const queryParameters = {};
35
+ if (requestParameters['page'] != null) {
36
+ queryParameters['page'] = requestParameters['page'];
37
+ }
38
+ if (requestParameters['limit'] != null) {
39
+ queryParameters['limit'] = requestParameters['limit'];
40
+ }
41
+ if (requestParameters['search'] != null) {
42
+ queryParameters['search'] = requestParameters['search'];
43
+ }
44
+ if (requestParameters['entityType'] != null) {
45
+ queryParameters['entityType'] = requestParameters['entityType'];
46
+ }
47
+ if (requestParameters['action'] != null) {
48
+ queryParameters['action'] = requestParameters['action'];
49
+ }
50
+ if (requestParameters['userId'] != null) {
51
+ queryParameters['userId'] = requestParameters['userId'];
52
+ }
53
+ if (requestParameters['from'] != null) {
54
+ queryParameters['from'] = requestParameters['from'];
55
+ }
56
+ if (requestParameters['to'] != null) {
57
+ queryParameters['to'] = requestParameters['to'];
58
+ }
59
+ const headerParameters = {};
60
+ if (this.configuration && this.configuration.accessToken) {
61
+ const token = this.configuration.accessToken;
62
+ const tokenString = yield token("bearer", []);
63
+ if (tokenString) {
64
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
65
+ }
66
+ }
67
+ let urlPath = `/api/v1/admin/audit-logs`;
68
+ const response = yield this.request({
69
+ path: urlPath,
70
+ method: 'GET',
71
+ headers: headerParameters,
72
+ query: queryParameters,
73
+ }, initOverrides);
74
+ return new runtime.JSONApiResponse(response, (jsonValue) => AdminAuditLogsPaginatedResponseFromJSON(jsonValue));
75
+ });
76
+ }
77
+ /**
78
+ * List audit logs (admin)
79
+ */
80
+ getAdminAuditLogs() {
81
+ return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
82
+ const response = yield this.getAdminAuditLogsRaw(requestParameters, initOverrides);
83
+ return yield response.value();
84
+ });
85
+ }
86
+ }
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Electric Cooperative Consumer Portal API
3
+ * Multi-tenant SaaS platform for Philippine electric cooperatives
4
+ *
5
+ * The version of the OpenAPI document: 1.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import * as runtime from '../runtime';
13
+ import type { AdminSendNotificationDto, AdminSendNotificationResponse } from '../models/index';
14
+ export interface AdminSendNotificationRequest {
15
+ adminSendNotificationDto: AdminSendNotificationDto;
16
+ }
17
+ /**
18
+ * AdminNotificationsApi - interface
19
+ *
20
+ * @export
21
+ * @interface AdminNotificationsApiInterface
22
+ */
23
+ export interface AdminNotificationsApiInterface {
24
+ /**
25
+ *
26
+ * @summary Send/broadcast a notification (admin)
27
+ * @param {AdminSendNotificationDto} adminSendNotificationDto
28
+ * @param {*} [options] Override http request option.
29
+ * @throws {RequiredError}
30
+ * @memberof AdminNotificationsApiInterface
31
+ */
32
+ adminSendNotificationRaw(requestParameters: AdminSendNotificationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AdminSendNotificationResponse>>;
33
+ /**
34
+ * Send/broadcast a notification (admin)
35
+ */
36
+ adminSendNotification(requestParameters: AdminSendNotificationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AdminSendNotificationResponse>;
37
+ }
38
+ /**
39
+ *
40
+ */
41
+ export declare class AdminNotificationsApi extends runtime.BaseAPI implements AdminNotificationsApiInterface {
42
+ /**
43
+ * Send/broadcast a notification (admin)
44
+ */
45
+ adminSendNotificationRaw(requestParameters: AdminSendNotificationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AdminSendNotificationResponse>>;
46
+ /**
47
+ * Send/broadcast a notification (admin)
48
+ */
49
+ adminSendNotification(requestParameters: AdminSendNotificationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AdminSendNotificationResponse>;
50
+ }
@@ -0,0 +1,67 @@
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
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
+ return new (P || (P = Promise))(function (resolve, reject) {
17
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
21
+ });
22
+ };
23
+ import * as runtime from '../runtime';
24
+ import { AdminSendNotificationDtoToJSON, AdminSendNotificationResponseFromJSON, } from '../models/index';
25
+ /**
26
+ *
27
+ */
28
+ export class AdminNotificationsApi extends runtime.BaseAPI {
29
+ /**
30
+ * Send/broadcast a notification (admin)
31
+ */
32
+ adminSendNotificationRaw(requestParameters, initOverrides) {
33
+ return __awaiter(this, void 0, void 0, function* () {
34
+ if (requestParameters['adminSendNotificationDto'] == null) {
35
+ throw new runtime.RequiredError('adminSendNotificationDto', 'Required parameter "adminSendNotificationDto" was null or undefined when calling adminSendNotification().');
36
+ }
37
+ const queryParameters = {};
38
+ const headerParameters = {};
39
+ headerParameters['Content-Type'] = 'application/json';
40
+ if (this.configuration && this.configuration.accessToken) {
41
+ const token = this.configuration.accessToken;
42
+ const tokenString = yield token("bearer", []);
43
+ if (tokenString) {
44
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
45
+ }
46
+ }
47
+ let urlPath = `/api/v1/admin/notifications/send`;
48
+ const response = yield this.request({
49
+ path: urlPath,
50
+ method: 'POST',
51
+ headers: headerParameters,
52
+ query: queryParameters,
53
+ body: AdminSendNotificationDtoToJSON(requestParameters['adminSendNotificationDto']),
54
+ }, initOverrides);
55
+ return new runtime.JSONApiResponse(response, (jsonValue) => AdminSendNotificationResponseFromJSON(jsonValue));
56
+ });
57
+ }
58
+ /**
59
+ * Send/broadcast a notification (admin)
60
+ */
61
+ adminSendNotification(requestParameters, initOverrides) {
62
+ return __awaiter(this, void 0, void 0, function* () {
63
+ const response = yield this.adminSendNotificationRaw(requestParameters, initOverrides);
64
+ return yield response.value();
65
+ });
66
+ }
67
+ }