@en-solutions/tgm-client-sdk 1.9.2 → 1.9.8
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/component.models.mjs +1 -1
- 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/intervention.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/models/enums/type.enums.mjs +3 -1
- package/esm2022/lib/services/api/energy.service.mjs +18 -1
- package/esm2022/lib/services/api/grid.service.mjs +23 -1
- package/esm2022/lib/services/api/plugin.service.mjs +23 -1
- package/fesm2022/en-solutions-tgm-client-sdk.mjs +75 -2
- package/fesm2022/en-solutions-tgm-client-sdk.mjs.map +1 -1
- package/lib/models/api/component.models.d.ts +7 -1
- package/lib/models/api/energy.models.d.ts +34 -0
- package/lib/models/api/grid.models.d.ts +4 -0
- package/lib/models/api/intervention.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/models/enums/type.enums.d.ts +7 -0
- package/lib/services/api/energy.service.d.ts +13 -2
- package/lib/services/api/grid.service.d.ts +27 -0
- package/lib/services/api/plugin.service.d.ts +12 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentType, ComponentCategory, ComponentInfoType, ComponentInfoCategory, ComponentInfoStatus, MeteringParameterType, MeteringParameterSubType, AssetPhase } from '../enums';
|
|
1
|
+
import { ComponentType, ComponentCategory, ComponentInfoType, ComponentInfoCategory, ComponentInfoStatus, MeteringParameterType, MeteringParameterSubType, AssetPhase, ChainSegment } from '../enums';
|
|
2
2
|
import { Failure } from './failure.models';
|
|
3
3
|
import { StrapiFile } from './media.models';
|
|
4
4
|
import { TurbineType } from './misc.models';
|
|
@@ -9,6 +9,8 @@ export interface Component {
|
|
|
9
9
|
description?: string;
|
|
10
10
|
type?: ComponentType;
|
|
11
11
|
category?: ComponentCategory;
|
|
12
|
+
/** Position in the electricity value chain (GENERATION / TRANSMISSION / DISTRIBUTION). */
|
|
13
|
+
chainSegment?: ChainSegment;
|
|
12
14
|
status?: ComponentInfoStatus;
|
|
13
15
|
isActive?: boolean;
|
|
14
16
|
isSubComponent?: boolean;
|
|
@@ -107,6 +109,8 @@ export type ComponentUpdateRequest = ComponentCreateRequest;
|
|
|
107
109
|
export interface ComponentGroup {
|
|
108
110
|
id: number;
|
|
109
111
|
name: string;
|
|
112
|
+
/** Position in the electricity value chain (GENERATION / TRANSMISSION / DISTRIBUTION). */
|
|
113
|
+
chainSegment?: ChainSegment;
|
|
110
114
|
description?: string;
|
|
111
115
|
isActive?: boolean;
|
|
112
116
|
code?: string;
|
|
@@ -156,6 +160,8 @@ export type ComponentGroupUpdateRequest = ComponentGroupCreateRequest;
|
|
|
156
160
|
export interface SubAssembly {
|
|
157
161
|
id: number;
|
|
158
162
|
name: string;
|
|
163
|
+
/** Position in the electricity value chain (GENERATION / TRANSMISSION / DISTRIBUTION). */
|
|
164
|
+
chainSegment?: ChainSegment;
|
|
159
165
|
code?: string;
|
|
160
166
|
description?: string;
|
|
161
167
|
isActive?: boolean;
|
|
@@ -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,9 @@ 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;
|
|
57
|
+
/** Number of OPEN interventions covering this node (badge "travaux en cours" on the map). */
|
|
58
|
+
openInterventions?: number;
|
|
55
59
|
}
|
|
@@ -211,6 +211,8 @@ export interface InterventionRequest {
|
|
|
211
211
|
components?: any[];
|
|
212
212
|
location?: any;
|
|
213
213
|
company?: any;
|
|
214
|
+
/** Grid Management: grid node(s) this intervention covers (lazy — read with ?populate=gridNodeIds). */
|
|
215
|
+
gridNodeIds?: number[];
|
|
214
216
|
locationId?: number;
|
|
215
217
|
unitId?: number;
|
|
216
218
|
componentId?: number;
|
|
@@ -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";
|
|
@@ -81,6 +81,13 @@ export declare const ComponentType: {
|
|
|
81
81
|
readonly HYBRID_PLANT: "HYBRIDPLANT";
|
|
82
82
|
};
|
|
83
83
|
export type ComponentType = (typeof ComponentType)[keyof typeof ComponentType];
|
|
84
|
+
/** Position of an asset element in the electricity value chain. */
|
|
85
|
+
export declare const ChainSegment: {
|
|
86
|
+
readonly GENERATION: "GENERATION";
|
|
87
|
+
readonly TRANSMISSION: "TRANSMISSION";
|
|
88
|
+
readonly DISTRIBUTION: "DISTRIBUTION";
|
|
89
|
+
};
|
|
90
|
+
export type ChainSegment = (typeof ChainSegment)[keyof typeof ChainSegment];
|
|
84
91
|
export declare const ConversationType: {
|
|
85
92
|
readonly DIRECT: "DIRECT";
|
|
86
93
|
readonly GROUP: "GROUP";
|
|
@@ -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
|
}
|
|
@@ -4,6 +4,7 @@ import { WebSocketService } from '../../core/websocket.service';
|
|
|
4
4
|
import { BaseCrudService } from './base-crud.service';
|
|
5
5
|
import { ApiResponse } from '../../models/base.models';
|
|
6
6
|
import { GridLink, GridNode, GridNodeStatus } from '../../models/api/grid.models';
|
|
7
|
+
import { InterventionRequest } from '../../models/api/intervention.models';
|
|
7
8
|
import * as i0 from "@angular/core";
|
|
8
9
|
/** CRUD for grid nodes (`/api/grid/nodes`). Requires the grid-management plugin. */
|
|
9
10
|
export declare class GridNodeService extends BaseCrudService<GridNode> {
|
|
@@ -42,6 +43,32 @@ export declare class GridService {
|
|
|
42
43
|
recompute(): Observable<ApiResponse<{
|
|
43
44
|
changed: number;
|
|
44
45
|
}>>;
|
|
46
|
+
/**
|
|
47
|
+
* Admin: run the grid auto-response — opens/closes `OutageEvent`s (and maintenance tickets) from the
|
|
48
|
+
* current derived states. This is more than `recompute()` (which only persists/broadcasts states).
|
|
49
|
+
*/
|
|
50
|
+
autoResponse(): Observable<ApiResponse<{
|
|
51
|
+
changed: number;
|
|
52
|
+
}>>;
|
|
53
|
+
/**
|
|
54
|
+
* Raise a maintenance intervention on a single grid node — routes the work into the core
|
|
55
|
+
* Intervention/Maintenance module, pre-filled from the node (component/location/grid link).
|
|
56
|
+
* `POST /api/grid/nodes/{id}/intervention`.
|
|
57
|
+
*/
|
|
58
|
+
createIntervention(nodeId: number, body?: {
|
|
59
|
+
title?: string;
|
|
60
|
+
description?: string;
|
|
61
|
+
priority?: string;
|
|
62
|
+
}): Observable<ApiResponse<InterventionRequest>>;
|
|
63
|
+
/**
|
|
64
|
+
* Raise ONE intervention covering several grid nodes (e.g. a feeder reconfiguration).
|
|
65
|
+
* `POST /api/grid/interventions`.
|
|
66
|
+
*/
|
|
67
|
+
createInterventionForNodes(gridNodeIds: number[], body?: {
|
|
68
|
+
title?: string;
|
|
69
|
+
description?: string;
|
|
70
|
+
priority?: string;
|
|
71
|
+
}): Observable<ApiResponse<InterventionRequest>>;
|
|
45
72
|
/**
|
|
46
73
|
* Live stream of full status snapshots pushed on `/topic/grid/status`.
|
|
47
74
|
* 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