@ignos/api-client 20250130.0.11044 → 20250203.0.11064
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/lib/ignosportal-api.d.ts +75 -0
- package/lib/ignosportal-api.js +290 -0
- package/package.json +1 -1
- package/src/ignosportal-api.ts +356 -0
package/lib/ignosportal-api.d.ts
CHANGED
|
@@ -806,6 +806,22 @@ export declare class KpiAdminClient extends AuthorizedApiBase implements IKpiAdm
|
|
|
806
806
|
updateCalenderCapacityAdmin(request: UpdateCalenderCapacity): Promise<CalenderCapacityDto>;
|
|
807
807
|
protected processUpdateCalenderCapacityAdmin(response: Response): Promise<CalenderCapacityDto>;
|
|
808
808
|
}
|
|
809
|
+
export interface IKpiClient {
|
|
810
|
+
getMachineKpi(machineExternalId: string | undefined, startDate: Date | undefined, endDate: Date | undefined): Promise<MachineKpiDto[]>;
|
|
811
|
+
getMachineDailyUptime(machineExternalId: string | undefined, date: Date | undefined): Promise<MachineDailyUptimeDto>;
|
|
812
|
+
}
|
|
813
|
+
export declare class KpiClient extends AuthorizedApiBase implements IKpiClient {
|
|
814
|
+
private http;
|
|
815
|
+
private baseUrl;
|
|
816
|
+
protected jsonParseReviver: ((key: string, value: any) => any) | undefined;
|
|
817
|
+
constructor(configuration: IAccessTokenProvider, baseUrl?: string, http?: {
|
|
818
|
+
fetch(url: RequestInfo, init?: RequestInit): Promise<Response>;
|
|
819
|
+
});
|
|
820
|
+
getMachineKpi(machineExternalId: string | undefined, startDate: Date | undefined, endDate: Date | undefined): Promise<MachineKpiDto[]>;
|
|
821
|
+
protected processGetMachineKpi(response: Response): Promise<MachineKpiDto[]>;
|
|
822
|
+
getMachineDailyUptime(machineExternalId: string | undefined, date: Date | undefined): Promise<MachineDailyUptimeDto>;
|
|
823
|
+
protected processGetMachineDailyUptime(response: Response): Promise<MachineDailyUptimeDto>;
|
|
824
|
+
}
|
|
809
825
|
export interface IMachinesClient {
|
|
810
826
|
listMachines(onlyConnectedMachines: boolean | undefined): Promise<MachineDto[]>;
|
|
811
827
|
listMachineGroups(): Promise<MachineGroupDto[]>;
|
|
@@ -814,6 +830,7 @@ export interface IMachinesClient {
|
|
|
814
830
|
deleteMachineGroup(id: string): Promise<void>;
|
|
815
831
|
listCurrentMachineStates(assetId: number | null | undefined): Promise<MachineStateListDto>;
|
|
816
832
|
listMachineStates(id: number, startTime: Date | null | undefined, endTime: Date | null | undefined): Promise<MachineStateDatapoint[]>;
|
|
833
|
+
listLastDowntimeMachineStates(id: number, endTime: Date | null | undefined, maxStates: number | null | undefined): Promise<DowntimeMachineStateDto[]>;
|
|
817
834
|
getMachineStatesSummary(id: number, startTime: Date | null | undefined, endTime: Date | null | undefined): Promise<MachineStatesSummaryDto>;
|
|
818
835
|
listMachineErpData(): Promise<MachineErpDataListDto>;
|
|
819
836
|
getMachineErpData(id: number): Promise<MachineErpDataDto>;
|
|
@@ -846,6 +863,8 @@ export declare class MachinesClient extends AuthorizedApiBase implements IMachin
|
|
|
846
863
|
protected processListCurrentMachineStates(response: Response): Promise<MachineStateListDto>;
|
|
847
864
|
listMachineStates(id: number, startTime: Date | null | undefined, endTime: Date | null | undefined): Promise<MachineStateDatapoint[]>;
|
|
848
865
|
protected processListMachineStates(response: Response): Promise<MachineStateDatapoint[]>;
|
|
866
|
+
listLastDowntimeMachineStates(id: number, endTime: Date | null | undefined, maxStates: number | null | undefined): Promise<DowntimeMachineStateDto[]>;
|
|
867
|
+
protected processListLastDowntimeMachineStates(response: Response): Promise<DowntimeMachineStateDto[]>;
|
|
849
868
|
getMachineStatesSummary(id: number, startTime: Date | null | undefined, endTime: Date | null | undefined): Promise<MachineStatesSummaryDto>;
|
|
850
869
|
protected processGetMachineStatesSummary(response: Response): Promise<MachineStatesSummaryDto>;
|
|
851
870
|
listMachineErpData(): Promise<MachineErpDataListDto>;
|
|
@@ -5598,6 +5617,48 @@ export interface IUpdateCalenderCapacity {
|
|
|
5598
5617
|
date?: Date;
|
|
5599
5618
|
dayCapacity?: CalenderDayCapacityDto;
|
|
5600
5619
|
}
|
|
5620
|
+
export declare class MachineKpiDto implements IMachineKpiDto {
|
|
5621
|
+
date?: Date;
|
|
5622
|
+
uptime?: number;
|
|
5623
|
+
capacity?: number;
|
|
5624
|
+
utilizationGoal?: number;
|
|
5625
|
+
constructor(data?: IMachineKpiDto);
|
|
5626
|
+
init(_data?: any): void;
|
|
5627
|
+
static fromJS(data: any): MachineKpiDto;
|
|
5628
|
+
toJSON(data?: any): any;
|
|
5629
|
+
}
|
|
5630
|
+
export interface IMachineKpiDto {
|
|
5631
|
+
date?: Date;
|
|
5632
|
+
uptime?: number;
|
|
5633
|
+
capacity?: number;
|
|
5634
|
+
utilizationGoal?: number;
|
|
5635
|
+
}
|
|
5636
|
+
export declare class MachineDailyUptimeDto implements IMachineDailyUptimeDto {
|
|
5637
|
+
date?: Date;
|
|
5638
|
+
historicUptimeDataPoints?: MachineDailyUptimePointDto[] | null;
|
|
5639
|
+
todayUptimeDataPoints?: MachineDailyUptimePointDto[] | null;
|
|
5640
|
+
constructor(data?: IMachineDailyUptimeDto);
|
|
5641
|
+
init(_data?: any): void;
|
|
5642
|
+
static fromJS(data: any): MachineDailyUptimeDto;
|
|
5643
|
+
toJSON(data?: any): any;
|
|
5644
|
+
}
|
|
5645
|
+
export interface IMachineDailyUptimeDto {
|
|
5646
|
+
date?: Date;
|
|
5647
|
+
historicUptimeDataPoints?: MachineDailyUptimePointDto[] | null;
|
|
5648
|
+
todayUptimeDataPoints?: MachineDailyUptimePointDto[] | null;
|
|
5649
|
+
}
|
|
5650
|
+
export declare class MachineDailyUptimePointDto implements IMachineDailyUptimePointDto {
|
|
5651
|
+
date?: Date;
|
|
5652
|
+
uptime?: number;
|
|
5653
|
+
constructor(data?: IMachineDailyUptimePointDto);
|
|
5654
|
+
init(_data?: any): void;
|
|
5655
|
+
static fromJS(data: any): MachineDailyUptimePointDto;
|
|
5656
|
+
toJSON(data?: any): any;
|
|
5657
|
+
}
|
|
5658
|
+
export interface IMachineDailyUptimePointDto {
|
|
5659
|
+
date?: Date;
|
|
5660
|
+
uptime?: number;
|
|
5661
|
+
}
|
|
5601
5662
|
export declare class MachineDto implements IMachineDto {
|
|
5602
5663
|
id: number;
|
|
5603
5664
|
externalId: string;
|
|
@@ -5724,6 +5785,20 @@ export interface IMachineStateDto {
|
|
|
5724
5785
|
machineState: MachineState;
|
|
5725
5786
|
startTime?: Date;
|
|
5726
5787
|
}
|
|
5788
|
+
export declare class DowntimeMachineStateDto implements IDowntimeMachineStateDto {
|
|
5789
|
+
datapoint?: MachineStateDatapoint;
|
|
5790
|
+
startTime?: Date;
|
|
5791
|
+
endTime?: Date;
|
|
5792
|
+
constructor(data?: IDowntimeMachineStateDto);
|
|
5793
|
+
init(_data?: any): void;
|
|
5794
|
+
static fromJS(data: any): DowntimeMachineStateDto;
|
|
5795
|
+
toJSON(data?: any): any;
|
|
5796
|
+
}
|
|
5797
|
+
export interface IDowntimeMachineStateDto {
|
|
5798
|
+
datapoint?: MachineStateDatapoint;
|
|
5799
|
+
startTime?: Date;
|
|
5800
|
+
endTime?: Date;
|
|
5801
|
+
}
|
|
5727
5802
|
export declare class MachineErpDataListDto implements IMachineErpDataListDto {
|
|
5728
5803
|
machines?: SingleMachineErpDataListDto[];
|
|
5729
5804
|
constructor(data?: IMachineErpDataListDto);
|
package/lib/ignosportal-api.js
CHANGED
|
@@ -6110,6 +6110,112 @@ export class KpiAdminClient extends AuthorizedApiBase {
|
|
|
6110
6110
|
return Promise.resolve(null);
|
|
6111
6111
|
}
|
|
6112
6112
|
}
|
|
6113
|
+
export class KpiClient extends AuthorizedApiBase {
|
|
6114
|
+
constructor(configuration, baseUrl, http) {
|
|
6115
|
+
super(configuration);
|
|
6116
|
+
this.jsonParseReviver = undefined;
|
|
6117
|
+
this.http = http ? http : window;
|
|
6118
|
+
this.baseUrl = baseUrl !== null && baseUrl !== void 0 ? baseUrl : "";
|
|
6119
|
+
}
|
|
6120
|
+
getMachineKpi(machineExternalId, startDate, endDate) {
|
|
6121
|
+
let url_ = this.baseUrl + "/kpi/capacity?";
|
|
6122
|
+
if (machineExternalId === null)
|
|
6123
|
+
throw new Error("The parameter 'machineExternalId' cannot be null.");
|
|
6124
|
+
else if (machineExternalId !== undefined)
|
|
6125
|
+
url_ += "machineExternalId=" + encodeURIComponent("" + machineExternalId) + "&";
|
|
6126
|
+
if (startDate === null)
|
|
6127
|
+
throw new Error("The parameter 'startDate' cannot be null.");
|
|
6128
|
+
else if (startDate !== undefined)
|
|
6129
|
+
url_ += "startDate=" + encodeURIComponent(startDate ? "" + startDate.toISOString() : "") + "&";
|
|
6130
|
+
if (endDate === null)
|
|
6131
|
+
throw new Error("The parameter 'endDate' cannot be null.");
|
|
6132
|
+
else if (endDate !== undefined)
|
|
6133
|
+
url_ += "endDate=" + encodeURIComponent(endDate ? "" + endDate.toISOString() : "") + "&";
|
|
6134
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
6135
|
+
let options_ = {
|
|
6136
|
+
method: "GET",
|
|
6137
|
+
headers: {
|
|
6138
|
+
"Accept": "application/json"
|
|
6139
|
+
}
|
|
6140
|
+
};
|
|
6141
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
6142
|
+
return this.http.fetch(url_, transformedOptions_);
|
|
6143
|
+
}).then((_response) => {
|
|
6144
|
+
return this.processGetMachineKpi(_response);
|
|
6145
|
+
});
|
|
6146
|
+
}
|
|
6147
|
+
processGetMachineKpi(response) {
|
|
6148
|
+
const status = response.status;
|
|
6149
|
+
let _headers = {};
|
|
6150
|
+
if (response.headers && response.headers.forEach) {
|
|
6151
|
+
response.headers.forEach((v, k) => _headers[k] = v);
|
|
6152
|
+
}
|
|
6153
|
+
;
|
|
6154
|
+
if (status === 200) {
|
|
6155
|
+
return response.text().then((_responseText) => {
|
|
6156
|
+
let result200 = null;
|
|
6157
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
6158
|
+
if (Array.isArray(resultData200)) {
|
|
6159
|
+
result200 = [];
|
|
6160
|
+
for (let item of resultData200)
|
|
6161
|
+
result200.push(MachineKpiDto.fromJS(item));
|
|
6162
|
+
}
|
|
6163
|
+
return result200;
|
|
6164
|
+
});
|
|
6165
|
+
}
|
|
6166
|
+
else if (status !== 200 && status !== 204) {
|
|
6167
|
+
return response.text().then((_responseText) => {
|
|
6168
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
6169
|
+
});
|
|
6170
|
+
}
|
|
6171
|
+
return Promise.resolve(null);
|
|
6172
|
+
}
|
|
6173
|
+
getMachineDailyUptime(machineExternalId, date) {
|
|
6174
|
+
let url_ = this.baseUrl + "/kpi/daily-uptime?";
|
|
6175
|
+
if (machineExternalId === null)
|
|
6176
|
+
throw new Error("The parameter 'machineExternalId' cannot be null.");
|
|
6177
|
+
else if (machineExternalId !== undefined)
|
|
6178
|
+
url_ += "machineExternalId=" + encodeURIComponent("" + machineExternalId) + "&";
|
|
6179
|
+
if (date === null)
|
|
6180
|
+
throw new Error("The parameter 'date' cannot be null.");
|
|
6181
|
+
else if (date !== undefined)
|
|
6182
|
+
url_ += "date=" + encodeURIComponent(date ? "" + date.toISOString() : "") + "&";
|
|
6183
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
6184
|
+
let options_ = {
|
|
6185
|
+
method: "GET",
|
|
6186
|
+
headers: {
|
|
6187
|
+
"Accept": "application/json"
|
|
6188
|
+
}
|
|
6189
|
+
};
|
|
6190
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
6191
|
+
return this.http.fetch(url_, transformedOptions_);
|
|
6192
|
+
}).then((_response) => {
|
|
6193
|
+
return this.processGetMachineDailyUptime(_response);
|
|
6194
|
+
});
|
|
6195
|
+
}
|
|
6196
|
+
processGetMachineDailyUptime(response) {
|
|
6197
|
+
const status = response.status;
|
|
6198
|
+
let _headers = {};
|
|
6199
|
+
if (response.headers && response.headers.forEach) {
|
|
6200
|
+
response.headers.forEach((v, k) => _headers[k] = v);
|
|
6201
|
+
}
|
|
6202
|
+
;
|
|
6203
|
+
if (status === 200) {
|
|
6204
|
+
return response.text().then((_responseText) => {
|
|
6205
|
+
let result200 = null;
|
|
6206
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
6207
|
+
result200 = MachineDailyUptimeDto.fromJS(resultData200);
|
|
6208
|
+
return result200;
|
|
6209
|
+
});
|
|
6210
|
+
}
|
|
6211
|
+
else if (status !== 200 && status !== 204) {
|
|
6212
|
+
return response.text().then((_responseText) => {
|
|
6213
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
6214
|
+
});
|
|
6215
|
+
}
|
|
6216
|
+
return Promise.resolve(null);
|
|
6217
|
+
}
|
|
6218
|
+
}
|
|
6113
6219
|
export class MachinesClient extends AuthorizedApiBase {
|
|
6114
6220
|
constructor(configuration, baseUrl, http) {
|
|
6115
6221
|
super(configuration);
|
|
@@ -6404,6 +6510,54 @@ export class MachinesClient extends AuthorizedApiBase {
|
|
|
6404
6510
|
}
|
|
6405
6511
|
return Promise.resolve(null);
|
|
6406
6512
|
}
|
|
6513
|
+
listLastDowntimeMachineStates(id, endTime, maxStates) {
|
|
6514
|
+
let url_ = this.baseUrl + "/machines/{id}/lastdowntimestates?";
|
|
6515
|
+
if (id === undefined || id === null)
|
|
6516
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
6517
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
6518
|
+
if (endTime !== undefined && endTime !== null)
|
|
6519
|
+
url_ += "endTime=" + encodeURIComponent(endTime ? "" + endTime.toISOString() : "") + "&";
|
|
6520
|
+
if (maxStates !== undefined && maxStates !== null)
|
|
6521
|
+
url_ += "maxStates=" + encodeURIComponent("" + maxStates) + "&";
|
|
6522
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
6523
|
+
let options_ = {
|
|
6524
|
+
method: "GET",
|
|
6525
|
+
headers: {
|
|
6526
|
+
"Accept": "application/json"
|
|
6527
|
+
}
|
|
6528
|
+
};
|
|
6529
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
6530
|
+
return this.http.fetch(url_, transformedOptions_);
|
|
6531
|
+
}).then((_response) => {
|
|
6532
|
+
return this.processListLastDowntimeMachineStates(_response);
|
|
6533
|
+
});
|
|
6534
|
+
}
|
|
6535
|
+
processListLastDowntimeMachineStates(response) {
|
|
6536
|
+
const status = response.status;
|
|
6537
|
+
let _headers = {};
|
|
6538
|
+
if (response.headers && response.headers.forEach) {
|
|
6539
|
+
response.headers.forEach((v, k) => _headers[k] = v);
|
|
6540
|
+
}
|
|
6541
|
+
;
|
|
6542
|
+
if (status === 200) {
|
|
6543
|
+
return response.text().then((_responseText) => {
|
|
6544
|
+
let result200 = null;
|
|
6545
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
6546
|
+
if (Array.isArray(resultData200)) {
|
|
6547
|
+
result200 = [];
|
|
6548
|
+
for (let item of resultData200)
|
|
6549
|
+
result200.push(DowntimeMachineStateDto.fromJS(item));
|
|
6550
|
+
}
|
|
6551
|
+
return result200;
|
|
6552
|
+
});
|
|
6553
|
+
}
|
|
6554
|
+
else if (status !== 200 && status !== 204) {
|
|
6555
|
+
return response.text().then((_responseText) => {
|
|
6556
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
6557
|
+
});
|
|
6558
|
+
}
|
|
6559
|
+
return Promise.resolve(null);
|
|
6560
|
+
}
|
|
6407
6561
|
getMachineStatesSummary(id, startTime, endTime) {
|
|
6408
6562
|
let url_ = this.baseUrl + "/machines/{id}/states/summary?";
|
|
6409
6563
|
if (id === undefined || id === null)
|
|
@@ -27192,6 +27346,112 @@ export class UpdateCalenderCapacity {
|
|
|
27192
27346
|
return data;
|
|
27193
27347
|
}
|
|
27194
27348
|
}
|
|
27349
|
+
export class MachineKpiDto {
|
|
27350
|
+
constructor(data) {
|
|
27351
|
+
if (data) {
|
|
27352
|
+
for (var property in data) {
|
|
27353
|
+
if (data.hasOwnProperty(property))
|
|
27354
|
+
this[property] = data[property];
|
|
27355
|
+
}
|
|
27356
|
+
}
|
|
27357
|
+
}
|
|
27358
|
+
init(_data) {
|
|
27359
|
+
if (_data) {
|
|
27360
|
+
this.date = _data["date"] ? new Date(_data["date"].toString()) : undefined;
|
|
27361
|
+
this.uptime = _data["uptime"];
|
|
27362
|
+
this.capacity = _data["capacity"];
|
|
27363
|
+
this.utilizationGoal = _data["utilizationGoal"];
|
|
27364
|
+
}
|
|
27365
|
+
}
|
|
27366
|
+
static fromJS(data) {
|
|
27367
|
+
data = typeof data === 'object' ? data : {};
|
|
27368
|
+
let result = new MachineKpiDto();
|
|
27369
|
+
result.init(data);
|
|
27370
|
+
return result;
|
|
27371
|
+
}
|
|
27372
|
+
toJSON(data) {
|
|
27373
|
+
data = typeof data === 'object' ? data : {};
|
|
27374
|
+
data["date"] = this.date ? this.date.toISOString() : undefined;
|
|
27375
|
+
data["uptime"] = this.uptime;
|
|
27376
|
+
data["capacity"] = this.capacity;
|
|
27377
|
+
data["utilizationGoal"] = this.utilizationGoal;
|
|
27378
|
+
return data;
|
|
27379
|
+
}
|
|
27380
|
+
}
|
|
27381
|
+
export class MachineDailyUptimeDto {
|
|
27382
|
+
constructor(data) {
|
|
27383
|
+
if (data) {
|
|
27384
|
+
for (var property in data) {
|
|
27385
|
+
if (data.hasOwnProperty(property))
|
|
27386
|
+
this[property] = data[property];
|
|
27387
|
+
}
|
|
27388
|
+
}
|
|
27389
|
+
}
|
|
27390
|
+
init(_data) {
|
|
27391
|
+
if (_data) {
|
|
27392
|
+
this.date = _data["date"] ? new Date(_data["date"].toString()) : undefined;
|
|
27393
|
+
if (Array.isArray(_data["historicUptimeDataPoints"])) {
|
|
27394
|
+
this.historicUptimeDataPoints = [];
|
|
27395
|
+
for (let item of _data["historicUptimeDataPoints"])
|
|
27396
|
+
this.historicUptimeDataPoints.push(MachineDailyUptimePointDto.fromJS(item));
|
|
27397
|
+
}
|
|
27398
|
+
if (Array.isArray(_data["todayUptimeDataPoints"])) {
|
|
27399
|
+
this.todayUptimeDataPoints = [];
|
|
27400
|
+
for (let item of _data["todayUptimeDataPoints"])
|
|
27401
|
+
this.todayUptimeDataPoints.push(MachineDailyUptimePointDto.fromJS(item));
|
|
27402
|
+
}
|
|
27403
|
+
}
|
|
27404
|
+
}
|
|
27405
|
+
static fromJS(data) {
|
|
27406
|
+
data = typeof data === 'object' ? data : {};
|
|
27407
|
+
let result = new MachineDailyUptimeDto();
|
|
27408
|
+
result.init(data);
|
|
27409
|
+
return result;
|
|
27410
|
+
}
|
|
27411
|
+
toJSON(data) {
|
|
27412
|
+
data = typeof data === 'object' ? data : {};
|
|
27413
|
+
data["date"] = this.date ? this.date.toISOString() : undefined;
|
|
27414
|
+
if (Array.isArray(this.historicUptimeDataPoints)) {
|
|
27415
|
+
data["historicUptimeDataPoints"] = [];
|
|
27416
|
+
for (let item of this.historicUptimeDataPoints)
|
|
27417
|
+
data["historicUptimeDataPoints"].push(item.toJSON());
|
|
27418
|
+
}
|
|
27419
|
+
if (Array.isArray(this.todayUptimeDataPoints)) {
|
|
27420
|
+
data["todayUptimeDataPoints"] = [];
|
|
27421
|
+
for (let item of this.todayUptimeDataPoints)
|
|
27422
|
+
data["todayUptimeDataPoints"].push(item.toJSON());
|
|
27423
|
+
}
|
|
27424
|
+
return data;
|
|
27425
|
+
}
|
|
27426
|
+
}
|
|
27427
|
+
export class MachineDailyUptimePointDto {
|
|
27428
|
+
constructor(data) {
|
|
27429
|
+
if (data) {
|
|
27430
|
+
for (var property in data) {
|
|
27431
|
+
if (data.hasOwnProperty(property))
|
|
27432
|
+
this[property] = data[property];
|
|
27433
|
+
}
|
|
27434
|
+
}
|
|
27435
|
+
}
|
|
27436
|
+
init(_data) {
|
|
27437
|
+
if (_data) {
|
|
27438
|
+
this.date = _data["date"] ? new Date(_data["date"].toString()) : undefined;
|
|
27439
|
+
this.uptime = _data["uptime"];
|
|
27440
|
+
}
|
|
27441
|
+
}
|
|
27442
|
+
static fromJS(data) {
|
|
27443
|
+
data = typeof data === 'object' ? data : {};
|
|
27444
|
+
let result = new MachineDailyUptimePointDto();
|
|
27445
|
+
result.init(data);
|
|
27446
|
+
return result;
|
|
27447
|
+
}
|
|
27448
|
+
toJSON(data) {
|
|
27449
|
+
data = typeof data === 'object' ? data : {};
|
|
27450
|
+
data["date"] = this.date ? this.date.toISOString() : undefined;
|
|
27451
|
+
data["uptime"] = this.uptime;
|
|
27452
|
+
return data;
|
|
27453
|
+
}
|
|
27454
|
+
}
|
|
27195
27455
|
export class MachineDto {
|
|
27196
27456
|
constructor(data) {
|
|
27197
27457
|
if (data) {
|
|
@@ -27489,6 +27749,36 @@ export class MachineStateDto {
|
|
|
27489
27749
|
return data;
|
|
27490
27750
|
}
|
|
27491
27751
|
}
|
|
27752
|
+
export class DowntimeMachineStateDto {
|
|
27753
|
+
constructor(data) {
|
|
27754
|
+
if (data) {
|
|
27755
|
+
for (var property in data) {
|
|
27756
|
+
if (data.hasOwnProperty(property))
|
|
27757
|
+
this[property] = data[property];
|
|
27758
|
+
}
|
|
27759
|
+
}
|
|
27760
|
+
}
|
|
27761
|
+
init(_data) {
|
|
27762
|
+
if (_data) {
|
|
27763
|
+
this.datapoint = _data["datapoint"] ? MachineStateDatapoint.fromJS(_data["datapoint"]) : undefined;
|
|
27764
|
+
this.startTime = _data["startTime"] ? new Date(_data["startTime"].toString()) : undefined;
|
|
27765
|
+
this.endTime = _data["endTime"] ? new Date(_data["endTime"].toString()) : undefined;
|
|
27766
|
+
}
|
|
27767
|
+
}
|
|
27768
|
+
static fromJS(data) {
|
|
27769
|
+
data = typeof data === 'object' ? data : {};
|
|
27770
|
+
let result = new DowntimeMachineStateDto();
|
|
27771
|
+
result.init(data);
|
|
27772
|
+
return result;
|
|
27773
|
+
}
|
|
27774
|
+
toJSON(data) {
|
|
27775
|
+
data = typeof data === 'object' ? data : {};
|
|
27776
|
+
data["datapoint"] = this.datapoint ? this.datapoint.toJSON() : undefined;
|
|
27777
|
+
data["startTime"] = this.startTime ? this.startTime.toISOString() : undefined;
|
|
27778
|
+
data["endTime"] = this.endTime ? this.endTime.toISOString() : undefined;
|
|
27779
|
+
return data;
|
|
27780
|
+
}
|
|
27781
|
+
}
|
|
27492
27782
|
export class MachineErpDataListDto {
|
|
27493
27783
|
constructor(data) {
|
|
27494
27784
|
if (data) {
|
package/package.json
CHANGED
package/src/ignosportal-api.ts
CHANGED
|
@@ -6558,6 +6558,121 @@ export class KpiAdminClient extends AuthorizedApiBase implements IKpiAdminClient
|
|
|
6558
6558
|
}
|
|
6559
6559
|
}
|
|
6560
6560
|
|
|
6561
|
+
export interface IKpiClient {
|
|
6562
|
+
|
|
6563
|
+
getMachineKpi(machineExternalId: string | undefined, startDate: Date | undefined, endDate: Date | undefined): Promise<MachineKpiDto[]>;
|
|
6564
|
+
|
|
6565
|
+
getMachineDailyUptime(machineExternalId: string | undefined, date: Date | undefined): Promise<MachineDailyUptimeDto>;
|
|
6566
|
+
}
|
|
6567
|
+
|
|
6568
|
+
export class KpiClient extends AuthorizedApiBase implements IKpiClient {
|
|
6569
|
+
private http: { fetch(url: RequestInfo, init?: RequestInit): Promise<Response> };
|
|
6570
|
+
private baseUrl: string;
|
|
6571
|
+
protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined;
|
|
6572
|
+
|
|
6573
|
+
constructor(configuration: IAccessTokenProvider, baseUrl?: string, http?: { fetch(url: RequestInfo, init?: RequestInit): Promise<Response> }) {
|
|
6574
|
+
super(configuration);
|
|
6575
|
+
this.http = http ? http : window as any;
|
|
6576
|
+
this.baseUrl = baseUrl ?? "";
|
|
6577
|
+
}
|
|
6578
|
+
|
|
6579
|
+
getMachineKpi(machineExternalId: string | undefined, startDate: Date | undefined, endDate: Date | undefined): Promise<MachineKpiDto[]> {
|
|
6580
|
+
let url_ = this.baseUrl + "/kpi/capacity?";
|
|
6581
|
+
if (machineExternalId === null)
|
|
6582
|
+
throw new Error("The parameter 'machineExternalId' cannot be null.");
|
|
6583
|
+
else if (machineExternalId !== undefined)
|
|
6584
|
+
url_ += "machineExternalId=" + encodeURIComponent("" + machineExternalId) + "&";
|
|
6585
|
+
if (startDate === null)
|
|
6586
|
+
throw new Error("The parameter 'startDate' cannot be null.");
|
|
6587
|
+
else if (startDate !== undefined)
|
|
6588
|
+
url_ += "startDate=" + encodeURIComponent(startDate ? "" + startDate.toISOString() : "") + "&";
|
|
6589
|
+
if (endDate === null)
|
|
6590
|
+
throw new Error("The parameter 'endDate' cannot be null.");
|
|
6591
|
+
else if (endDate !== undefined)
|
|
6592
|
+
url_ += "endDate=" + encodeURIComponent(endDate ? "" + endDate.toISOString() : "") + "&";
|
|
6593
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
6594
|
+
|
|
6595
|
+
let options_: RequestInit = {
|
|
6596
|
+
method: "GET",
|
|
6597
|
+
headers: {
|
|
6598
|
+
"Accept": "application/json"
|
|
6599
|
+
}
|
|
6600
|
+
};
|
|
6601
|
+
|
|
6602
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
6603
|
+
return this.http.fetch(url_, transformedOptions_);
|
|
6604
|
+
}).then((_response: Response) => {
|
|
6605
|
+
return this.processGetMachineKpi(_response);
|
|
6606
|
+
});
|
|
6607
|
+
}
|
|
6608
|
+
|
|
6609
|
+
protected processGetMachineKpi(response: Response): Promise<MachineKpiDto[]> {
|
|
6610
|
+
const status = response.status;
|
|
6611
|
+
let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
|
|
6612
|
+
if (status === 200) {
|
|
6613
|
+
return response.text().then((_responseText) => {
|
|
6614
|
+
let result200: any = null;
|
|
6615
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
6616
|
+
if (Array.isArray(resultData200)) {
|
|
6617
|
+
result200 = [] as any;
|
|
6618
|
+
for (let item of resultData200)
|
|
6619
|
+
result200!.push(MachineKpiDto.fromJS(item));
|
|
6620
|
+
}
|
|
6621
|
+
return result200;
|
|
6622
|
+
});
|
|
6623
|
+
} else if (status !== 200 && status !== 204) {
|
|
6624
|
+
return response.text().then((_responseText) => {
|
|
6625
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
6626
|
+
});
|
|
6627
|
+
}
|
|
6628
|
+
return Promise.resolve<MachineKpiDto[]>(null as any);
|
|
6629
|
+
}
|
|
6630
|
+
|
|
6631
|
+
getMachineDailyUptime(machineExternalId: string | undefined, date: Date | undefined): Promise<MachineDailyUptimeDto> {
|
|
6632
|
+
let url_ = this.baseUrl + "/kpi/daily-uptime?";
|
|
6633
|
+
if (machineExternalId === null)
|
|
6634
|
+
throw new Error("The parameter 'machineExternalId' cannot be null.");
|
|
6635
|
+
else if (machineExternalId !== undefined)
|
|
6636
|
+
url_ += "machineExternalId=" + encodeURIComponent("" + machineExternalId) + "&";
|
|
6637
|
+
if (date === null)
|
|
6638
|
+
throw new Error("The parameter 'date' cannot be null.");
|
|
6639
|
+
else if (date !== undefined)
|
|
6640
|
+
url_ += "date=" + encodeURIComponent(date ? "" + date.toISOString() : "") + "&";
|
|
6641
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
6642
|
+
|
|
6643
|
+
let options_: RequestInit = {
|
|
6644
|
+
method: "GET",
|
|
6645
|
+
headers: {
|
|
6646
|
+
"Accept": "application/json"
|
|
6647
|
+
}
|
|
6648
|
+
};
|
|
6649
|
+
|
|
6650
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
6651
|
+
return this.http.fetch(url_, transformedOptions_);
|
|
6652
|
+
}).then((_response: Response) => {
|
|
6653
|
+
return this.processGetMachineDailyUptime(_response);
|
|
6654
|
+
});
|
|
6655
|
+
}
|
|
6656
|
+
|
|
6657
|
+
protected processGetMachineDailyUptime(response: Response): Promise<MachineDailyUptimeDto> {
|
|
6658
|
+
const status = response.status;
|
|
6659
|
+
let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
|
|
6660
|
+
if (status === 200) {
|
|
6661
|
+
return response.text().then((_responseText) => {
|
|
6662
|
+
let result200: any = null;
|
|
6663
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
6664
|
+
result200 = MachineDailyUptimeDto.fromJS(resultData200);
|
|
6665
|
+
return result200;
|
|
6666
|
+
});
|
|
6667
|
+
} else if (status !== 200 && status !== 204) {
|
|
6668
|
+
return response.text().then((_responseText) => {
|
|
6669
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
6670
|
+
});
|
|
6671
|
+
}
|
|
6672
|
+
return Promise.resolve<MachineDailyUptimeDto>(null as any);
|
|
6673
|
+
}
|
|
6674
|
+
}
|
|
6675
|
+
|
|
6561
6676
|
export interface IMachinesClient {
|
|
6562
6677
|
|
|
6563
6678
|
listMachines(onlyConnectedMachines: boolean | undefined): Promise<MachineDto[]>;
|
|
@@ -6574,6 +6689,8 @@ export interface IMachinesClient {
|
|
|
6574
6689
|
|
|
6575
6690
|
listMachineStates(id: number, startTime: Date | null | undefined, endTime: Date | null | undefined): Promise<MachineStateDatapoint[]>;
|
|
6576
6691
|
|
|
6692
|
+
listLastDowntimeMachineStates(id: number, endTime: Date | null | undefined, maxStates: number | null | undefined): Promise<DowntimeMachineStateDto[]>;
|
|
6693
|
+
|
|
6577
6694
|
getMachineStatesSummary(id: number, startTime: Date | null | undefined, endTime: Date | null | undefined): Promise<MachineStatesSummaryDto>;
|
|
6578
6695
|
|
|
6579
6696
|
listMachineErpData(): Promise<MachineErpDataListDto>;
|
|
@@ -6889,6 +7006,53 @@ export class MachinesClient extends AuthorizedApiBase implements IMachinesClient
|
|
|
6889
7006
|
return Promise.resolve<MachineStateDatapoint[]>(null as any);
|
|
6890
7007
|
}
|
|
6891
7008
|
|
|
7009
|
+
listLastDowntimeMachineStates(id: number, endTime: Date | null | undefined, maxStates: number | null | undefined): Promise<DowntimeMachineStateDto[]> {
|
|
7010
|
+
let url_ = this.baseUrl + "/machines/{id}/lastdowntimestates?";
|
|
7011
|
+
if (id === undefined || id === null)
|
|
7012
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
7013
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
7014
|
+
if (endTime !== undefined && endTime !== null)
|
|
7015
|
+
url_ += "endTime=" + encodeURIComponent(endTime ? "" + endTime.toISOString() : "") + "&";
|
|
7016
|
+
if (maxStates !== undefined && maxStates !== null)
|
|
7017
|
+
url_ += "maxStates=" + encodeURIComponent("" + maxStates) + "&";
|
|
7018
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
7019
|
+
|
|
7020
|
+
let options_: RequestInit = {
|
|
7021
|
+
method: "GET",
|
|
7022
|
+
headers: {
|
|
7023
|
+
"Accept": "application/json"
|
|
7024
|
+
}
|
|
7025
|
+
};
|
|
7026
|
+
|
|
7027
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
7028
|
+
return this.http.fetch(url_, transformedOptions_);
|
|
7029
|
+
}).then((_response: Response) => {
|
|
7030
|
+
return this.processListLastDowntimeMachineStates(_response);
|
|
7031
|
+
});
|
|
7032
|
+
}
|
|
7033
|
+
|
|
7034
|
+
protected processListLastDowntimeMachineStates(response: Response): Promise<DowntimeMachineStateDto[]> {
|
|
7035
|
+
const status = response.status;
|
|
7036
|
+
let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
|
|
7037
|
+
if (status === 200) {
|
|
7038
|
+
return response.text().then((_responseText) => {
|
|
7039
|
+
let result200: any = null;
|
|
7040
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
7041
|
+
if (Array.isArray(resultData200)) {
|
|
7042
|
+
result200 = [] as any;
|
|
7043
|
+
for (let item of resultData200)
|
|
7044
|
+
result200!.push(DowntimeMachineStateDto.fromJS(item));
|
|
7045
|
+
}
|
|
7046
|
+
return result200;
|
|
7047
|
+
});
|
|
7048
|
+
} else if (status !== 200 && status !== 204) {
|
|
7049
|
+
return response.text().then((_responseText) => {
|
|
7050
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
7051
|
+
});
|
|
7052
|
+
}
|
|
7053
|
+
return Promise.resolve<DowntimeMachineStateDto[]>(null as any);
|
|
7054
|
+
}
|
|
7055
|
+
|
|
6892
7056
|
getMachineStatesSummary(id: number, startTime: Date | null | undefined, endTime: Date | null | undefined): Promise<MachineStatesSummaryDto> {
|
|
6893
7057
|
let url_ = this.baseUrl + "/machines/{id}/states/summary?";
|
|
6894
7058
|
if (id === undefined || id === null)
|
|
@@ -31702,6 +31866,154 @@ export interface IUpdateCalenderCapacity {
|
|
|
31702
31866
|
dayCapacity?: CalenderDayCapacityDto;
|
|
31703
31867
|
}
|
|
31704
31868
|
|
|
31869
|
+
export class MachineKpiDto implements IMachineKpiDto {
|
|
31870
|
+
date?: Date;
|
|
31871
|
+
uptime?: number;
|
|
31872
|
+
capacity?: number;
|
|
31873
|
+
utilizationGoal?: number;
|
|
31874
|
+
|
|
31875
|
+
constructor(data?: IMachineKpiDto) {
|
|
31876
|
+
if (data) {
|
|
31877
|
+
for (var property in data) {
|
|
31878
|
+
if (data.hasOwnProperty(property))
|
|
31879
|
+
(<any>this)[property] = (<any>data)[property];
|
|
31880
|
+
}
|
|
31881
|
+
}
|
|
31882
|
+
}
|
|
31883
|
+
|
|
31884
|
+
init(_data?: any) {
|
|
31885
|
+
if (_data) {
|
|
31886
|
+
this.date = _data["date"] ? new Date(_data["date"].toString()) : <any>undefined;
|
|
31887
|
+
this.uptime = _data["uptime"];
|
|
31888
|
+
this.capacity = _data["capacity"];
|
|
31889
|
+
this.utilizationGoal = _data["utilizationGoal"];
|
|
31890
|
+
}
|
|
31891
|
+
}
|
|
31892
|
+
|
|
31893
|
+
static fromJS(data: any): MachineKpiDto {
|
|
31894
|
+
data = typeof data === 'object' ? data : {};
|
|
31895
|
+
let result = new MachineKpiDto();
|
|
31896
|
+
result.init(data);
|
|
31897
|
+
return result;
|
|
31898
|
+
}
|
|
31899
|
+
|
|
31900
|
+
toJSON(data?: any) {
|
|
31901
|
+
data = typeof data === 'object' ? data : {};
|
|
31902
|
+
data["date"] = this.date ? this.date.toISOString() : <any>undefined;
|
|
31903
|
+
data["uptime"] = this.uptime;
|
|
31904
|
+
data["capacity"] = this.capacity;
|
|
31905
|
+
data["utilizationGoal"] = this.utilizationGoal;
|
|
31906
|
+
return data;
|
|
31907
|
+
}
|
|
31908
|
+
}
|
|
31909
|
+
|
|
31910
|
+
export interface IMachineKpiDto {
|
|
31911
|
+
date?: Date;
|
|
31912
|
+
uptime?: number;
|
|
31913
|
+
capacity?: number;
|
|
31914
|
+
utilizationGoal?: number;
|
|
31915
|
+
}
|
|
31916
|
+
|
|
31917
|
+
export class MachineDailyUptimeDto implements IMachineDailyUptimeDto {
|
|
31918
|
+
date?: Date;
|
|
31919
|
+
historicUptimeDataPoints?: MachineDailyUptimePointDto[] | null;
|
|
31920
|
+
todayUptimeDataPoints?: MachineDailyUptimePointDto[] | null;
|
|
31921
|
+
|
|
31922
|
+
constructor(data?: IMachineDailyUptimeDto) {
|
|
31923
|
+
if (data) {
|
|
31924
|
+
for (var property in data) {
|
|
31925
|
+
if (data.hasOwnProperty(property))
|
|
31926
|
+
(<any>this)[property] = (<any>data)[property];
|
|
31927
|
+
}
|
|
31928
|
+
}
|
|
31929
|
+
}
|
|
31930
|
+
|
|
31931
|
+
init(_data?: any) {
|
|
31932
|
+
if (_data) {
|
|
31933
|
+
this.date = _data["date"] ? new Date(_data["date"].toString()) : <any>undefined;
|
|
31934
|
+
if (Array.isArray(_data["historicUptimeDataPoints"])) {
|
|
31935
|
+
this.historicUptimeDataPoints = [] as any;
|
|
31936
|
+
for (let item of _data["historicUptimeDataPoints"])
|
|
31937
|
+
this.historicUptimeDataPoints!.push(MachineDailyUptimePointDto.fromJS(item));
|
|
31938
|
+
}
|
|
31939
|
+
if (Array.isArray(_data["todayUptimeDataPoints"])) {
|
|
31940
|
+
this.todayUptimeDataPoints = [] as any;
|
|
31941
|
+
for (let item of _data["todayUptimeDataPoints"])
|
|
31942
|
+
this.todayUptimeDataPoints!.push(MachineDailyUptimePointDto.fromJS(item));
|
|
31943
|
+
}
|
|
31944
|
+
}
|
|
31945
|
+
}
|
|
31946
|
+
|
|
31947
|
+
static fromJS(data: any): MachineDailyUptimeDto {
|
|
31948
|
+
data = typeof data === 'object' ? data : {};
|
|
31949
|
+
let result = new MachineDailyUptimeDto();
|
|
31950
|
+
result.init(data);
|
|
31951
|
+
return result;
|
|
31952
|
+
}
|
|
31953
|
+
|
|
31954
|
+
toJSON(data?: any) {
|
|
31955
|
+
data = typeof data === 'object' ? data : {};
|
|
31956
|
+
data["date"] = this.date ? this.date.toISOString() : <any>undefined;
|
|
31957
|
+
if (Array.isArray(this.historicUptimeDataPoints)) {
|
|
31958
|
+
data["historicUptimeDataPoints"] = [];
|
|
31959
|
+
for (let item of this.historicUptimeDataPoints)
|
|
31960
|
+
data["historicUptimeDataPoints"].push(item.toJSON());
|
|
31961
|
+
}
|
|
31962
|
+
if (Array.isArray(this.todayUptimeDataPoints)) {
|
|
31963
|
+
data["todayUptimeDataPoints"] = [];
|
|
31964
|
+
for (let item of this.todayUptimeDataPoints)
|
|
31965
|
+
data["todayUptimeDataPoints"].push(item.toJSON());
|
|
31966
|
+
}
|
|
31967
|
+
return data;
|
|
31968
|
+
}
|
|
31969
|
+
}
|
|
31970
|
+
|
|
31971
|
+
export interface IMachineDailyUptimeDto {
|
|
31972
|
+
date?: Date;
|
|
31973
|
+
historicUptimeDataPoints?: MachineDailyUptimePointDto[] | null;
|
|
31974
|
+
todayUptimeDataPoints?: MachineDailyUptimePointDto[] | null;
|
|
31975
|
+
}
|
|
31976
|
+
|
|
31977
|
+
export class MachineDailyUptimePointDto implements IMachineDailyUptimePointDto {
|
|
31978
|
+
date?: Date;
|
|
31979
|
+
uptime?: number;
|
|
31980
|
+
|
|
31981
|
+
constructor(data?: IMachineDailyUptimePointDto) {
|
|
31982
|
+
if (data) {
|
|
31983
|
+
for (var property in data) {
|
|
31984
|
+
if (data.hasOwnProperty(property))
|
|
31985
|
+
(<any>this)[property] = (<any>data)[property];
|
|
31986
|
+
}
|
|
31987
|
+
}
|
|
31988
|
+
}
|
|
31989
|
+
|
|
31990
|
+
init(_data?: any) {
|
|
31991
|
+
if (_data) {
|
|
31992
|
+
this.date = _data["date"] ? new Date(_data["date"].toString()) : <any>undefined;
|
|
31993
|
+
this.uptime = _data["uptime"];
|
|
31994
|
+
}
|
|
31995
|
+
}
|
|
31996
|
+
|
|
31997
|
+
static fromJS(data: any): MachineDailyUptimePointDto {
|
|
31998
|
+
data = typeof data === 'object' ? data : {};
|
|
31999
|
+
let result = new MachineDailyUptimePointDto();
|
|
32000
|
+
result.init(data);
|
|
32001
|
+
return result;
|
|
32002
|
+
}
|
|
32003
|
+
|
|
32004
|
+
toJSON(data?: any) {
|
|
32005
|
+
data = typeof data === 'object' ? data : {};
|
|
32006
|
+
data["date"] = this.date ? this.date.toISOString() : <any>undefined;
|
|
32007
|
+
data["uptime"] = this.uptime;
|
|
32008
|
+
return data;
|
|
32009
|
+
}
|
|
32010
|
+
}
|
|
32011
|
+
|
|
32012
|
+
export interface IMachineDailyUptimePointDto {
|
|
32013
|
+
date?: Date;
|
|
32014
|
+
uptime?: number;
|
|
32015
|
+
}
|
|
32016
|
+
|
|
31705
32017
|
export class MachineDto implements IMachineDto {
|
|
31706
32018
|
id!: number;
|
|
31707
32019
|
externalId!: string;
|
|
@@ -32125,6 +32437,50 @@ export interface IMachineStateDto {
|
|
|
32125
32437
|
startTime?: Date;
|
|
32126
32438
|
}
|
|
32127
32439
|
|
|
32440
|
+
export class DowntimeMachineStateDto implements IDowntimeMachineStateDto {
|
|
32441
|
+
datapoint?: MachineStateDatapoint;
|
|
32442
|
+
startTime?: Date;
|
|
32443
|
+
endTime?: Date;
|
|
32444
|
+
|
|
32445
|
+
constructor(data?: IDowntimeMachineStateDto) {
|
|
32446
|
+
if (data) {
|
|
32447
|
+
for (var property in data) {
|
|
32448
|
+
if (data.hasOwnProperty(property))
|
|
32449
|
+
(<any>this)[property] = (<any>data)[property];
|
|
32450
|
+
}
|
|
32451
|
+
}
|
|
32452
|
+
}
|
|
32453
|
+
|
|
32454
|
+
init(_data?: any) {
|
|
32455
|
+
if (_data) {
|
|
32456
|
+
this.datapoint = _data["datapoint"] ? MachineStateDatapoint.fromJS(_data["datapoint"]) : <any>undefined;
|
|
32457
|
+
this.startTime = _data["startTime"] ? new Date(_data["startTime"].toString()) : <any>undefined;
|
|
32458
|
+
this.endTime = _data["endTime"] ? new Date(_data["endTime"].toString()) : <any>undefined;
|
|
32459
|
+
}
|
|
32460
|
+
}
|
|
32461
|
+
|
|
32462
|
+
static fromJS(data: any): DowntimeMachineStateDto {
|
|
32463
|
+
data = typeof data === 'object' ? data : {};
|
|
32464
|
+
let result = new DowntimeMachineStateDto();
|
|
32465
|
+
result.init(data);
|
|
32466
|
+
return result;
|
|
32467
|
+
}
|
|
32468
|
+
|
|
32469
|
+
toJSON(data?: any) {
|
|
32470
|
+
data = typeof data === 'object' ? data : {};
|
|
32471
|
+
data["datapoint"] = this.datapoint ? this.datapoint.toJSON() : <any>undefined;
|
|
32472
|
+
data["startTime"] = this.startTime ? this.startTime.toISOString() : <any>undefined;
|
|
32473
|
+
data["endTime"] = this.endTime ? this.endTime.toISOString() : <any>undefined;
|
|
32474
|
+
return data;
|
|
32475
|
+
}
|
|
32476
|
+
}
|
|
32477
|
+
|
|
32478
|
+
export interface IDowntimeMachineStateDto {
|
|
32479
|
+
datapoint?: MachineStateDatapoint;
|
|
32480
|
+
startTime?: Date;
|
|
32481
|
+
endTime?: Date;
|
|
32482
|
+
}
|
|
32483
|
+
|
|
32128
32484
|
export class MachineErpDataListDto implements IMachineErpDataListDto {
|
|
32129
32485
|
machines?: SingleMachineErpDataListDto[];
|
|
32130
32486
|
|