@en-solutions/tgm-client-sdk 1.9.2 → 1.9.6
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/esm2022/lib/models/api/energy.models.mjs +1 -1
- package/esm2022/lib/models/api/grid.models.mjs +1 -1
- package/esm2022/lib/models/api/plugin.models.mjs +1 -1
- package/esm2022/lib/models/enums/status.enums.mjs +12 -2
- package/esm2022/lib/services/api/energy.service.mjs +18 -1
- package/esm2022/lib/services/api/grid.service.mjs +8 -1
- package/esm2022/lib/services/api/plugin.service.mjs +23 -1
- package/fesm2022/en-solutions-tgm-client-sdk.mjs +57 -1
- package/fesm2022/en-solutions-tgm-client-sdk.mjs.map +1 -1
- package/lib/models/api/energy.models.d.ts +34 -0
- package/lib/models/api/grid.models.d.ts +2 -0
- package/lib/models/api/plugin.models.d.ts +23 -0
- package/lib/models/enums/status.enums.d.ts +3 -0
- package/lib/services/api/energy.service.d.ts +13 -2
- package/lib/services/api/grid.service.d.ts +7 -0
- package/lib/services/api/plugin.service.d.ts +12 -1
- package/package.json +1 -1
|
@@ -84,6 +84,10 @@ export interface OutageEvent {
|
|
|
84
84
|
status?: OutageStatus;
|
|
85
85
|
unitId?: number;
|
|
86
86
|
failureId?: number;
|
|
87
|
+
/** Grid Management: the grid node this outage concerns (set for grid outages). */
|
|
88
|
+
gridNodeId?: number;
|
|
89
|
+
/** True when auto-created by the grid auto-response (vs entered manually). */
|
|
90
|
+
autoGenerated?: boolean;
|
|
87
91
|
plannedStart?: string;
|
|
88
92
|
plannedEnd?: string;
|
|
89
93
|
actualStart?: string;
|
|
@@ -104,6 +108,36 @@ export interface OutageEvent {
|
|
|
104
108
|
createdAt?: string;
|
|
105
109
|
updatedAt?: string;
|
|
106
110
|
}
|
|
111
|
+
/** Per-resource-type roll-up inside an {@link OutageAnalysis} (backend: ResourceSummaryDTO). */
|
|
112
|
+
export interface OutageResourceSummary {
|
|
113
|
+
resourceType?: string;
|
|
114
|
+
count: number;
|
|
115
|
+
estimatedHours: number;
|
|
116
|
+
actualHours: number;
|
|
117
|
+
variance: number;
|
|
118
|
+
}
|
|
119
|
+
/** Post-outage analysis contract (backend: PostOutageAnalysisDTO) returned by `getAnalysis(id)`. */
|
|
120
|
+
export interface OutageAnalysis {
|
|
121
|
+
outageId: number;
|
|
122
|
+
outageNumber?: string;
|
|
123
|
+
title?: string;
|
|
124
|
+
status?: string;
|
|
125
|
+
plannedDurationHours?: number;
|
|
126
|
+
actualDurationHours?: number;
|
|
127
|
+
durationVarianceHours?: number;
|
|
128
|
+
durationVariancePercent?: number;
|
|
129
|
+
estimatedCost?: number;
|
|
130
|
+
actualCost?: number;
|
|
131
|
+
costVariance?: number;
|
|
132
|
+
costVariancePercent?: number;
|
|
133
|
+
lostRevenue?: number;
|
|
134
|
+
lostCapacityMw?: number;
|
|
135
|
+
totalResourcesAssigned?: number;
|
|
136
|
+
totalEstimatedHours?: number;
|
|
137
|
+
totalActualHours?: number;
|
|
138
|
+
resourceHoursVariance?: number;
|
|
139
|
+
resourceBreakdown?: OutageResourceSummary[];
|
|
140
|
+
}
|
|
107
141
|
export interface OperatingEvent {
|
|
108
142
|
id: number;
|
|
109
143
|
name?: string;
|
|
@@ -51,5 +51,7 @@ export interface GridNodeStatus {
|
|
|
51
51
|
parentNodeId?: number;
|
|
52
52
|
lastTelemetryAt?: string;
|
|
53
53
|
activeAlertSeverity?: 'INFO' | 'WARNING' | 'CRITICAL' | 'EMERGENCY' | null;
|
|
54
|
+
/** Id of the worst active SensorAlert on this node — pass to acknowledge/resolve/escalate. */
|
|
55
|
+
activeAlertId?: number | null;
|
|
54
56
|
reachable: boolean;
|
|
55
57
|
}
|
|
@@ -10,6 +10,29 @@ export interface PluginStatus {
|
|
|
10
10
|
status: 'INSTALLED' | 'DISABLED' | 'NOT_INSTALLED' | string;
|
|
11
11
|
installedAt?: string | null;
|
|
12
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Full detail of one plugin = descriptor + curated rich content + this organization's install status.
|
|
15
|
+
* Returned by `GET /api/plugins/{id}`; everything a plugin detail page needs (pure JSON, no backend UI).
|
|
16
|
+
*/
|
|
17
|
+
export interface PluginDetail {
|
|
18
|
+
id: string;
|
|
19
|
+
name: string;
|
|
20
|
+
version: string;
|
|
21
|
+
category: string;
|
|
22
|
+
description: string;
|
|
23
|
+
tagline: string;
|
|
24
|
+
longDescription: string;
|
|
25
|
+
features: string[];
|
|
26
|
+
dataModel: string[];
|
|
27
|
+
endpoints: string[];
|
|
28
|
+
useCases: string[];
|
|
29
|
+
dependsOn: string[];
|
|
30
|
+
requiredLicenseFeature?: string | null;
|
|
31
|
+
menuModuleId?: string | null;
|
|
32
|
+
installed: boolean;
|
|
33
|
+
status: 'INSTALLED' | 'DISABLED' | 'NOT_INSTALLED' | string;
|
|
34
|
+
installedAt?: string | null;
|
|
35
|
+
}
|
|
13
36
|
export interface InstalledPlugin {
|
|
14
37
|
id?: number;
|
|
15
38
|
pluginId: string;
|
|
@@ -278,6 +278,9 @@ export declare const WorkflowStatus: {
|
|
|
278
278
|
};
|
|
279
279
|
export type WorkflowStatus = (typeof WorkflowStatus)[keyof typeof WorkflowStatus];
|
|
280
280
|
export declare const InterventionRequestStatus: {
|
|
281
|
+
readonly PENDING: "PENDING";
|
|
282
|
+
readonly THREATED: "THREATED";
|
|
283
|
+
readonly CANCELLED: "CANCELLED";
|
|
281
284
|
readonly ON_HOLD: "OnHold";
|
|
282
285
|
readonly ACCEPTED: "Accepted";
|
|
283
286
|
readonly REJECTED: "Rejected";
|
|
@@ -2,7 +2,7 @@ import { Observable } from 'rxjs';
|
|
|
2
2
|
import { TgmHttpClient } from '../../core/http-client.service';
|
|
3
3
|
import { BaseCrudService } from './base-crud.service';
|
|
4
4
|
import { ApiResponse } from '../../models/base.models';
|
|
5
|
-
import { AncillaryService, GridConnection, CurtailmentEvent, OutageEvent, OperatingEvent, SiteAssessment } from '../../models/api/energy.models';
|
|
5
|
+
import { AncillaryService, GridConnection, CurtailmentEvent, OutageEvent, OutageAnalysis, OperatingEvent, SiteAssessment } from '../../models/api/energy.models';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
export declare class AncillaryServiceCrudService extends BaseCrudService<AncillaryService> {
|
|
8
8
|
protected resourcePath: string;
|
|
@@ -26,9 +26,20 @@ export declare class OutageEventService extends BaseCrudService<OutageEvent> {
|
|
|
26
26
|
protected resourcePath: string;
|
|
27
27
|
constructor(http: TgmHttpClient);
|
|
28
28
|
getGantt(start: string, end: string): Observable<ApiResponse<any>>;
|
|
29
|
-
|
|
29
|
+
/** Post-outage impact analysis (backend: PostOutageAnalysisDTO). */
|
|
30
|
+
getAnalysis(id: number): Observable<ApiResponse<OutageAnalysis>>;
|
|
31
|
+
/** Schedule overlaps (backend: OverlapDTO[]). */
|
|
30
32
|
getOverlaps(id: number): Observable<ApiResponse<any[]>>;
|
|
33
|
+
/** Resource conflicts (backend: ResourceConflictDTO[]). */
|
|
31
34
|
getResourceConflicts(id: number): Observable<ApiResponse<any[]>>;
|
|
35
|
+
/**
|
|
36
|
+
* Lifecycle actions (backend: `POST /api/outages/{id}/approve|complete|cancel`).
|
|
37
|
+
* NB: `approve` drives the separate `approvalStatus` field (PENDING → APPROVED), while
|
|
38
|
+
* `complete`/`cancel` drive `status` (ACTIVE → COMPLETED/CANCELLED).
|
|
39
|
+
*/
|
|
40
|
+
approve(id: number, notes?: string): Observable<ApiResponse<OutageEvent>>;
|
|
41
|
+
complete(id: number, notes?: string): Observable<ApiResponse<OutageEvent>>;
|
|
42
|
+
cancel(id: number): Observable<ApiResponse<OutageEvent>>;
|
|
32
43
|
static ɵfac: i0.ɵɵFactoryDeclaration<OutageEventService, never>;
|
|
33
44
|
static ɵprov: i0.ɵɵInjectableDeclaration<OutageEventService>;
|
|
34
45
|
}
|
|
@@ -42,6 +42,13 @@ export declare class GridService {
|
|
|
42
42
|
recompute(): Observable<ApiResponse<{
|
|
43
43
|
changed: number;
|
|
44
44
|
}>>;
|
|
45
|
+
/**
|
|
46
|
+
* Admin: run the grid auto-response — opens/closes `OutageEvent`s (and maintenance tickets) from the
|
|
47
|
+
* current derived states. This is more than `recompute()` (which only persists/broadcasts states).
|
|
48
|
+
*/
|
|
49
|
+
autoResponse(): Observable<ApiResponse<{
|
|
50
|
+
changed: number;
|
|
51
|
+
}>>;
|
|
45
52
|
/**
|
|
46
53
|
* Live stream of full status snapshots pushed on `/topic/grid/status`.
|
|
47
54
|
* Ensure {@link WebSocketService.connect} has been called once after login.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
2
|
import { TgmHttpClient } from '../../core/http-client.service';
|
|
3
3
|
import { ApiResponse } from '../../models/base.models';
|
|
4
|
-
import { InstalledPlugin, PluginStatus } from '../../models/api/plugin.models';
|
|
4
|
+
import { InstalledPlugin, PluginDetail, PluginStatus } from '../../models/api/plugin.models';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
/**
|
|
7
7
|
* Installable modules (plugins) for the current organization.
|
|
@@ -16,10 +16,21 @@ export declare class PluginService {
|
|
|
16
16
|
constructor(http: TgmHttpClient);
|
|
17
17
|
/** Catalog of all plugins with this organization's install status. */
|
|
18
18
|
list(): Observable<ApiResponse<PluginStatus[]>>;
|
|
19
|
+
/** Full detail of one plugin (rich content + this organization's install status) — for a detail page. */
|
|
20
|
+
detail(pluginId: string): Observable<ApiResponse<PluginDetail>>;
|
|
19
21
|
/** True if the given plugin is installed for the current organization. */
|
|
20
22
|
isInstalled(pluginId: string): Observable<boolean>;
|
|
21
23
|
install(pluginId: string): Observable<ApiResponse<InstalledPlugin>>;
|
|
22
24
|
uninstall(pluginId: string): Observable<ApiResponse<void>>;
|
|
25
|
+
private platformBase;
|
|
26
|
+
/** Tenant-agnostic plugin catalog (descriptors). */
|
|
27
|
+
platformCatalog(): Observable<ApiResponse<PluginStatus[]>>;
|
|
28
|
+
/** Plugins with a specific client's install status. */
|
|
29
|
+
platformListForClient(clientId: string): Observable<ApiResponse<PluginStatus[]>>;
|
|
30
|
+
/** Install a plugin for a specific client. */
|
|
31
|
+
platformInstall(clientId: string, pluginId: string): Observable<ApiResponse<InstalledPlugin>>;
|
|
32
|
+
/** Disable a plugin for a specific client (data retained). */
|
|
33
|
+
platformUninstall(clientId: string, pluginId: string): Observable<ApiResponse<void>>;
|
|
23
34
|
static ɵfac: i0.ɵɵFactoryDeclaration<PluginService, never>;
|
|
24
35
|
static ɵprov: i0.ɵɵInjectableDeclaration<PluginService>;
|
|
25
36
|
}
|
package/package.json
CHANGED