@ignos/api-client 20250130.0.11044 → 20250130.0.11051
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 +46 -0
- package/lib/ignosportal-api.js +171 -0
- package/package.json +1 -1
- package/src/ignosportal-api.ts +210 -0
package/lib/ignosportal-api.d.ts
CHANGED
|
@@ -806,6 +806,19 @@ 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
|
+
}
|
|
812
|
+
export declare class KpiClient extends AuthorizedApiBase implements IKpiClient {
|
|
813
|
+
private http;
|
|
814
|
+
private baseUrl;
|
|
815
|
+
protected jsonParseReviver: ((key: string, value: any) => any) | undefined;
|
|
816
|
+
constructor(configuration: IAccessTokenProvider, baseUrl?: string, http?: {
|
|
817
|
+
fetch(url: RequestInfo, init?: RequestInit): Promise<Response>;
|
|
818
|
+
});
|
|
819
|
+
getMachineKpi(machineExternalId: string | undefined, startDate: Date | undefined, endDate: Date | undefined): Promise<MachineKpiDto[]>;
|
|
820
|
+
protected processGetMachineKpi(response: Response): Promise<MachineKpiDto[]>;
|
|
821
|
+
}
|
|
809
822
|
export interface IMachinesClient {
|
|
810
823
|
listMachines(onlyConnectedMachines: boolean | undefined): Promise<MachineDto[]>;
|
|
811
824
|
listMachineGroups(): Promise<MachineGroupDto[]>;
|
|
@@ -814,6 +827,7 @@ export interface IMachinesClient {
|
|
|
814
827
|
deleteMachineGroup(id: string): Promise<void>;
|
|
815
828
|
listCurrentMachineStates(assetId: number | null | undefined): Promise<MachineStateListDto>;
|
|
816
829
|
listMachineStates(id: number, startTime: Date | null | undefined, endTime: Date | null | undefined): Promise<MachineStateDatapoint[]>;
|
|
830
|
+
listLastDowntimeMachineStates(id: number, endTime: Date | null | undefined, maxStates: number | null | undefined): Promise<DowntimeMachineStateDto[]>;
|
|
817
831
|
getMachineStatesSummary(id: number, startTime: Date | null | undefined, endTime: Date | null | undefined): Promise<MachineStatesSummaryDto>;
|
|
818
832
|
listMachineErpData(): Promise<MachineErpDataListDto>;
|
|
819
833
|
getMachineErpData(id: number): Promise<MachineErpDataDto>;
|
|
@@ -846,6 +860,8 @@ export declare class MachinesClient extends AuthorizedApiBase implements IMachin
|
|
|
846
860
|
protected processListCurrentMachineStates(response: Response): Promise<MachineStateListDto>;
|
|
847
861
|
listMachineStates(id: number, startTime: Date | null | undefined, endTime: Date | null | undefined): Promise<MachineStateDatapoint[]>;
|
|
848
862
|
protected processListMachineStates(response: Response): Promise<MachineStateDatapoint[]>;
|
|
863
|
+
listLastDowntimeMachineStates(id: number, endTime: Date | null | undefined, maxStates: number | null | undefined): Promise<DowntimeMachineStateDto[]>;
|
|
864
|
+
protected processListLastDowntimeMachineStates(response: Response): Promise<DowntimeMachineStateDto[]>;
|
|
849
865
|
getMachineStatesSummary(id: number, startTime: Date | null | undefined, endTime: Date | null | undefined): Promise<MachineStatesSummaryDto>;
|
|
850
866
|
protected processGetMachineStatesSummary(response: Response): Promise<MachineStatesSummaryDto>;
|
|
851
867
|
listMachineErpData(): Promise<MachineErpDataListDto>;
|
|
@@ -5598,6 +5614,22 @@ export interface IUpdateCalenderCapacity {
|
|
|
5598
5614
|
date?: Date;
|
|
5599
5615
|
dayCapacity?: CalenderDayCapacityDto;
|
|
5600
5616
|
}
|
|
5617
|
+
export declare class MachineKpiDto implements IMachineKpiDto {
|
|
5618
|
+
date?: Date;
|
|
5619
|
+
hoursCapacity?: number;
|
|
5620
|
+
uptime?: number;
|
|
5621
|
+
utilizationGoal?: number;
|
|
5622
|
+
constructor(data?: IMachineKpiDto);
|
|
5623
|
+
init(_data?: any): void;
|
|
5624
|
+
static fromJS(data: any): MachineKpiDto;
|
|
5625
|
+
toJSON(data?: any): any;
|
|
5626
|
+
}
|
|
5627
|
+
export interface IMachineKpiDto {
|
|
5628
|
+
date?: Date;
|
|
5629
|
+
hoursCapacity?: number;
|
|
5630
|
+
uptime?: number;
|
|
5631
|
+
utilizationGoal?: number;
|
|
5632
|
+
}
|
|
5601
5633
|
export declare class MachineDto implements IMachineDto {
|
|
5602
5634
|
id: number;
|
|
5603
5635
|
externalId: string;
|
|
@@ -5724,6 +5756,20 @@ export interface IMachineStateDto {
|
|
|
5724
5756
|
machineState: MachineState;
|
|
5725
5757
|
startTime?: Date;
|
|
5726
5758
|
}
|
|
5759
|
+
export declare class DowntimeMachineStateDto implements IDowntimeMachineStateDto {
|
|
5760
|
+
datapoint?: MachineStateDatapoint;
|
|
5761
|
+
startTime?: Date;
|
|
5762
|
+
endTime?: Date;
|
|
5763
|
+
constructor(data?: IDowntimeMachineStateDto);
|
|
5764
|
+
init(_data?: any): void;
|
|
5765
|
+
static fromJS(data: any): DowntimeMachineStateDto;
|
|
5766
|
+
toJSON(data?: any): any;
|
|
5767
|
+
}
|
|
5768
|
+
export interface IDowntimeMachineStateDto {
|
|
5769
|
+
datapoint?: MachineStateDatapoint;
|
|
5770
|
+
startTime?: Date;
|
|
5771
|
+
endTime?: Date;
|
|
5772
|
+
}
|
|
5727
5773
|
export declare class MachineErpDataListDto implements IMachineErpDataListDto {
|
|
5728
5774
|
machines?: SingleMachineErpDataListDto[];
|
|
5729
5775
|
constructor(data?: IMachineErpDataListDto);
|
package/lib/ignosportal-api.js
CHANGED
|
@@ -6110,6 +6110,67 @@ 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
|
+
}
|
|
6113
6174
|
export class MachinesClient extends AuthorizedApiBase {
|
|
6114
6175
|
constructor(configuration, baseUrl, http) {
|
|
6115
6176
|
super(configuration);
|
|
@@ -6404,6 +6465,54 @@ export class MachinesClient extends AuthorizedApiBase {
|
|
|
6404
6465
|
}
|
|
6405
6466
|
return Promise.resolve(null);
|
|
6406
6467
|
}
|
|
6468
|
+
listLastDowntimeMachineStates(id, endTime, maxStates) {
|
|
6469
|
+
let url_ = this.baseUrl + "/machines/{id}/lastdowntimestates?";
|
|
6470
|
+
if (id === undefined || id === null)
|
|
6471
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
6472
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
6473
|
+
if (endTime !== undefined && endTime !== null)
|
|
6474
|
+
url_ += "endTime=" + encodeURIComponent(endTime ? "" + endTime.toISOString() : "") + "&";
|
|
6475
|
+
if (maxStates !== undefined && maxStates !== null)
|
|
6476
|
+
url_ += "maxStates=" + encodeURIComponent("" + maxStates) + "&";
|
|
6477
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
6478
|
+
let options_ = {
|
|
6479
|
+
method: "GET",
|
|
6480
|
+
headers: {
|
|
6481
|
+
"Accept": "application/json"
|
|
6482
|
+
}
|
|
6483
|
+
};
|
|
6484
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
6485
|
+
return this.http.fetch(url_, transformedOptions_);
|
|
6486
|
+
}).then((_response) => {
|
|
6487
|
+
return this.processListLastDowntimeMachineStates(_response);
|
|
6488
|
+
});
|
|
6489
|
+
}
|
|
6490
|
+
processListLastDowntimeMachineStates(response) {
|
|
6491
|
+
const status = response.status;
|
|
6492
|
+
let _headers = {};
|
|
6493
|
+
if (response.headers && response.headers.forEach) {
|
|
6494
|
+
response.headers.forEach((v, k) => _headers[k] = v);
|
|
6495
|
+
}
|
|
6496
|
+
;
|
|
6497
|
+
if (status === 200) {
|
|
6498
|
+
return response.text().then((_responseText) => {
|
|
6499
|
+
let result200 = null;
|
|
6500
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
6501
|
+
if (Array.isArray(resultData200)) {
|
|
6502
|
+
result200 = [];
|
|
6503
|
+
for (let item of resultData200)
|
|
6504
|
+
result200.push(DowntimeMachineStateDto.fromJS(item));
|
|
6505
|
+
}
|
|
6506
|
+
return result200;
|
|
6507
|
+
});
|
|
6508
|
+
}
|
|
6509
|
+
else if (status !== 200 && status !== 204) {
|
|
6510
|
+
return response.text().then((_responseText) => {
|
|
6511
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
6512
|
+
});
|
|
6513
|
+
}
|
|
6514
|
+
return Promise.resolve(null);
|
|
6515
|
+
}
|
|
6407
6516
|
getMachineStatesSummary(id, startTime, endTime) {
|
|
6408
6517
|
let url_ = this.baseUrl + "/machines/{id}/states/summary?";
|
|
6409
6518
|
if (id === undefined || id === null)
|
|
@@ -27192,6 +27301,38 @@ export class UpdateCalenderCapacity {
|
|
|
27192
27301
|
return data;
|
|
27193
27302
|
}
|
|
27194
27303
|
}
|
|
27304
|
+
export class MachineKpiDto {
|
|
27305
|
+
constructor(data) {
|
|
27306
|
+
if (data) {
|
|
27307
|
+
for (var property in data) {
|
|
27308
|
+
if (data.hasOwnProperty(property))
|
|
27309
|
+
this[property] = data[property];
|
|
27310
|
+
}
|
|
27311
|
+
}
|
|
27312
|
+
}
|
|
27313
|
+
init(_data) {
|
|
27314
|
+
if (_data) {
|
|
27315
|
+
this.date = _data["date"] ? new Date(_data["date"].toString()) : undefined;
|
|
27316
|
+
this.hoursCapacity = _data["hoursCapacity"];
|
|
27317
|
+
this.uptime = _data["uptime"];
|
|
27318
|
+
this.utilizationGoal = _data["utilizationGoal"];
|
|
27319
|
+
}
|
|
27320
|
+
}
|
|
27321
|
+
static fromJS(data) {
|
|
27322
|
+
data = typeof data === 'object' ? data : {};
|
|
27323
|
+
let result = new MachineKpiDto();
|
|
27324
|
+
result.init(data);
|
|
27325
|
+
return result;
|
|
27326
|
+
}
|
|
27327
|
+
toJSON(data) {
|
|
27328
|
+
data = typeof data === 'object' ? data : {};
|
|
27329
|
+
data["date"] = this.date ? this.date.toISOString() : undefined;
|
|
27330
|
+
data["hoursCapacity"] = this.hoursCapacity;
|
|
27331
|
+
data["uptime"] = this.uptime;
|
|
27332
|
+
data["utilizationGoal"] = this.utilizationGoal;
|
|
27333
|
+
return data;
|
|
27334
|
+
}
|
|
27335
|
+
}
|
|
27195
27336
|
export class MachineDto {
|
|
27196
27337
|
constructor(data) {
|
|
27197
27338
|
if (data) {
|
|
@@ -27489,6 +27630,36 @@ export class MachineStateDto {
|
|
|
27489
27630
|
return data;
|
|
27490
27631
|
}
|
|
27491
27632
|
}
|
|
27633
|
+
export class DowntimeMachineStateDto {
|
|
27634
|
+
constructor(data) {
|
|
27635
|
+
if (data) {
|
|
27636
|
+
for (var property in data) {
|
|
27637
|
+
if (data.hasOwnProperty(property))
|
|
27638
|
+
this[property] = data[property];
|
|
27639
|
+
}
|
|
27640
|
+
}
|
|
27641
|
+
}
|
|
27642
|
+
init(_data) {
|
|
27643
|
+
if (_data) {
|
|
27644
|
+
this.datapoint = _data["datapoint"] ? MachineStateDatapoint.fromJS(_data["datapoint"]) : undefined;
|
|
27645
|
+
this.startTime = _data["startTime"] ? new Date(_data["startTime"].toString()) : undefined;
|
|
27646
|
+
this.endTime = _data["endTime"] ? new Date(_data["endTime"].toString()) : undefined;
|
|
27647
|
+
}
|
|
27648
|
+
}
|
|
27649
|
+
static fromJS(data) {
|
|
27650
|
+
data = typeof data === 'object' ? data : {};
|
|
27651
|
+
let result = new DowntimeMachineStateDto();
|
|
27652
|
+
result.init(data);
|
|
27653
|
+
return result;
|
|
27654
|
+
}
|
|
27655
|
+
toJSON(data) {
|
|
27656
|
+
data = typeof data === 'object' ? data : {};
|
|
27657
|
+
data["datapoint"] = this.datapoint ? this.datapoint.toJSON() : undefined;
|
|
27658
|
+
data["startTime"] = this.startTime ? this.startTime.toISOString() : undefined;
|
|
27659
|
+
data["endTime"] = this.endTime ? this.endTime.toISOString() : undefined;
|
|
27660
|
+
return data;
|
|
27661
|
+
}
|
|
27662
|
+
}
|
|
27492
27663
|
export class MachineErpDataListDto {
|
|
27493
27664
|
constructor(data) {
|
|
27494
27665
|
if (data) {
|
package/package.json
CHANGED
package/src/ignosportal-api.ts
CHANGED
|
@@ -6558,6 +6558,75 @@ 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
|
+
|
|
6566
|
+
export class KpiClient extends AuthorizedApiBase implements IKpiClient {
|
|
6567
|
+
private http: { fetch(url: RequestInfo, init?: RequestInit): Promise<Response> };
|
|
6568
|
+
private baseUrl: string;
|
|
6569
|
+
protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined;
|
|
6570
|
+
|
|
6571
|
+
constructor(configuration: IAccessTokenProvider, baseUrl?: string, http?: { fetch(url: RequestInfo, init?: RequestInit): Promise<Response> }) {
|
|
6572
|
+
super(configuration);
|
|
6573
|
+
this.http = http ? http : window as any;
|
|
6574
|
+
this.baseUrl = baseUrl ?? "";
|
|
6575
|
+
}
|
|
6576
|
+
|
|
6577
|
+
getMachineKpi(machineExternalId: string | undefined, startDate: Date | undefined, endDate: Date | undefined): Promise<MachineKpiDto[]> {
|
|
6578
|
+
let url_ = this.baseUrl + "/kpi/capacity?";
|
|
6579
|
+
if (machineExternalId === null)
|
|
6580
|
+
throw new Error("The parameter 'machineExternalId' cannot be null.");
|
|
6581
|
+
else if (machineExternalId !== undefined)
|
|
6582
|
+
url_ += "machineExternalId=" + encodeURIComponent("" + machineExternalId) + "&";
|
|
6583
|
+
if (startDate === null)
|
|
6584
|
+
throw new Error("The parameter 'startDate' cannot be null.");
|
|
6585
|
+
else if (startDate !== undefined)
|
|
6586
|
+
url_ += "startDate=" + encodeURIComponent(startDate ? "" + startDate.toISOString() : "") + "&";
|
|
6587
|
+
if (endDate === null)
|
|
6588
|
+
throw new Error("The parameter 'endDate' cannot be null.");
|
|
6589
|
+
else if (endDate !== undefined)
|
|
6590
|
+
url_ += "endDate=" + encodeURIComponent(endDate ? "" + endDate.toISOString() : "") + "&";
|
|
6591
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
6592
|
+
|
|
6593
|
+
let options_: RequestInit = {
|
|
6594
|
+
method: "GET",
|
|
6595
|
+
headers: {
|
|
6596
|
+
"Accept": "application/json"
|
|
6597
|
+
}
|
|
6598
|
+
};
|
|
6599
|
+
|
|
6600
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
6601
|
+
return this.http.fetch(url_, transformedOptions_);
|
|
6602
|
+
}).then((_response: Response) => {
|
|
6603
|
+
return this.processGetMachineKpi(_response);
|
|
6604
|
+
});
|
|
6605
|
+
}
|
|
6606
|
+
|
|
6607
|
+
protected processGetMachineKpi(response: Response): Promise<MachineKpiDto[]> {
|
|
6608
|
+
const status = response.status;
|
|
6609
|
+
let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
|
|
6610
|
+
if (status === 200) {
|
|
6611
|
+
return response.text().then((_responseText) => {
|
|
6612
|
+
let result200: any = null;
|
|
6613
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
6614
|
+
if (Array.isArray(resultData200)) {
|
|
6615
|
+
result200 = [] as any;
|
|
6616
|
+
for (let item of resultData200)
|
|
6617
|
+
result200!.push(MachineKpiDto.fromJS(item));
|
|
6618
|
+
}
|
|
6619
|
+
return result200;
|
|
6620
|
+
});
|
|
6621
|
+
} else if (status !== 200 && status !== 204) {
|
|
6622
|
+
return response.text().then((_responseText) => {
|
|
6623
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
6624
|
+
});
|
|
6625
|
+
}
|
|
6626
|
+
return Promise.resolve<MachineKpiDto[]>(null as any);
|
|
6627
|
+
}
|
|
6628
|
+
}
|
|
6629
|
+
|
|
6561
6630
|
export interface IMachinesClient {
|
|
6562
6631
|
|
|
6563
6632
|
listMachines(onlyConnectedMachines: boolean | undefined): Promise<MachineDto[]>;
|
|
@@ -6574,6 +6643,8 @@ export interface IMachinesClient {
|
|
|
6574
6643
|
|
|
6575
6644
|
listMachineStates(id: number, startTime: Date | null | undefined, endTime: Date | null | undefined): Promise<MachineStateDatapoint[]>;
|
|
6576
6645
|
|
|
6646
|
+
listLastDowntimeMachineStates(id: number, endTime: Date | null | undefined, maxStates: number | null | undefined): Promise<DowntimeMachineStateDto[]>;
|
|
6647
|
+
|
|
6577
6648
|
getMachineStatesSummary(id: number, startTime: Date | null | undefined, endTime: Date | null | undefined): Promise<MachineStatesSummaryDto>;
|
|
6578
6649
|
|
|
6579
6650
|
listMachineErpData(): Promise<MachineErpDataListDto>;
|
|
@@ -6889,6 +6960,53 @@ export class MachinesClient extends AuthorizedApiBase implements IMachinesClient
|
|
|
6889
6960
|
return Promise.resolve<MachineStateDatapoint[]>(null as any);
|
|
6890
6961
|
}
|
|
6891
6962
|
|
|
6963
|
+
listLastDowntimeMachineStates(id: number, endTime: Date | null | undefined, maxStates: number | null | undefined): Promise<DowntimeMachineStateDto[]> {
|
|
6964
|
+
let url_ = this.baseUrl + "/machines/{id}/lastdowntimestates?";
|
|
6965
|
+
if (id === undefined || id === null)
|
|
6966
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
6967
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
6968
|
+
if (endTime !== undefined && endTime !== null)
|
|
6969
|
+
url_ += "endTime=" + encodeURIComponent(endTime ? "" + endTime.toISOString() : "") + "&";
|
|
6970
|
+
if (maxStates !== undefined && maxStates !== null)
|
|
6971
|
+
url_ += "maxStates=" + encodeURIComponent("" + maxStates) + "&";
|
|
6972
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
6973
|
+
|
|
6974
|
+
let options_: RequestInit = {
|
|
6975
|
+
method: "GET",
|
|
6976
|
+
headers: {
|
|
6977
|
+
"Accept": "application/json"
|
|
6978
|
+
}
|
|
6979
|
+
};
|
|
6980
|
+
|
|
6981
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
6982
|
+
return this.http.fetch(url_, transformedOptions_);
|
|
6983
|
+
}).then((_response: Response) => {
|
|
6984
|
+
return this.processListLastDowntimeMachineStates(_response);
|
|
6985
|
+
});
|
|
6986
|
+
}
|
|
6987
|
+
|
|
6988
|
+
protected processListLastDowntimeMachineStates(response: Response): Promise<DowntimeMachineStateDto[]> {
|
|
6989
|
+
const status = response.status;
|
|
6990
|
+
let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
|
|
6991
|
+
if (status === 200) {
|
|
6992
|
+
return response.text().then((_responseText) => {
|
|
6993
|
+
let result200: any = null;
|
|
6994
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
6995
|
+
if (Array.isArray(resultData200)) {
|
|
6996
|
+
result200 = [] as any;
|
|
6997
|
+
for (let item of resultData200)
|
|
6998
|
+
result200!.push(DowntimeMachineStateDto.fromJS(item));
|
|
6999
|
+
}
|
|
7000
|
+
return result200;
|
|
7001
|
+
});
|
|
7002
|
+
} else if (status !== 200 && status !== 204) {
|
|
7003
|
+
return response.text().then((_responseText) => {
|
|
7004
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
7005
|
+
});
|
|
7006
|
+
}
|
|
7007
|
+
return Promise.resolve<DowntimeMachineStateDto[]>(null as any);
|
|
7008
|
+
}
|
|
7009
|
+
|
|
6892
7010
|
getMachineStatesSummary(id: number, startTime: Date | null | undefined, endTime: Date | null | undefined): Promise<MachineStatesSummaryDto> {
|
|
6893
7011
|
let url_ = this.baseUrl + "/machines/{id}/states/summary?";
|
|
6894
7012
|
if (id === undefined || id === null)
|
|
@@ -31702,6 +31820,54 @@ export interface IUpdateCalenderCapacity {
|
|
|
31702
31820
|
dayCapacity?: CalenderDayCapacityDto;
|
|
31703
31821
|
}
|
|
31704
31822
|
|
|
31823
|
+
export class MachineKpiDto implements IMachineKpiDto {
|
|
31824
|
+
date?: Date;
|
|
31825
|
+
hoursCapacity?: number;
|
|
31826
|
+
uptime?: number;
|
|
31827
|
+
utilizationGoal?: number;
|
|
31828
|
+
|
|
31829
|
+
constructor(data?: IMachineKpiDto) {
|
|
31830
|
+
if (data) {
|
|
31831
|
+
for (var property in data) {
|
|
31832
|
+
if (data.hasOwnProperty(property))
|
|
31833
|
+
(<any>this)[property] = (<any>data)[property];
|
|
31834
|
+
}
|
|
31835
|
+
}
|
|
31836
|
+
}
|
|
31837
|
+
|
|
31838
|
+
init(_data?: any) {
|
|
31839
|
+
if (_data) {
|
|
31840
|
+
this.date = _data["date"] ? new Date(_data["date"].toString()) : <any>undefined;
|
|
31841
|
+
this.hoursCapacity = _data["hoursCapacity"];
|
|
31842
|
+
this.uptime = _data["uptime"];
|
|
31843
|
+
this.utilizationGoal = _data["utilizationGoal"];
|
|
31844
|
+
}
|
|
31845
|
+
}
|
|
31846
|
+
|
|
31847
|
+
static fromJS(data: any): MachineKpiDto {
|
|
31848
|
+
data = typeof data === 'object' ? data : {};
|
|
31849
|
+
let result = new MachineKpiDto();
|
|
31850
|
+
result.init(data);
|
|
31851
|
+
return result;
|
|
31852
|
+
}
|
|
31853
|
+
|
|
31854
|
+
toJSON(data?: any) {
|
|
31855
|
+
data = typeof data === 'object' ? data : {};
|
|
31856
|
+
data["date"] = this.date ? this.date.toISOString() : <any>undefined;
|
|
31857
|
+
data["hoursCapacity"] = this.hoursCapacity;
|
|
31858
|
+
data["uptime"] = this.uptime;
|
|
31859
|
+
data["utilizationGoal"] = this.utilizationGoal;
|
|
31860
|
+
return data;
|
|
31861
|
+
}
|
|
31862
|
+
}
|
|
31863
|
+
|
|
31864
|
+
export interface IMachineKpiDto {
|
|
31865
|
+
date?: Date;
|
|
31866
|
+
hoursCapacity?: number;
|
|
31867
|
+
uptime?: number;
|
|
31868
|
+
utilizationGoal?: number;
|
|
31869
|
+
}
|
|
31870
|
+
|
|
31705
31871
|
export class MachineDto implements IMachineDto {
|
|
31706
31872
|
id!: number;
|
|
31707
31873
|
externalId!: string;
|
|
@@ -32125,6 +32291,50 @@ export interface IMachineStateDto {
|
|
|
32125
32291
|
startTime?: Date;
|
|
32126
32292
|
}
|
|
32127
32293
|
|
|
32294
|
+
export class DowntimeMachineStateDto implements IDowntimeMachineStateDto {
|
|
32295
|
+
datapoint?: MachineStateDatapoint;
|
|
32296
|
+
startTime?: Date;
|
|
32297
|
+
endTime?: Date;
|
|
32298
|
+
|
|
32299
|
+
constructor(data?: IDowntimeMachineStateDto) {
|
|
32300
|
+
if (data) {
|
|
32301
|
+
for (var property in data) {
|
|
32302
|
+
if (data.hasOwnProperty(property))
|
|
32303
|
+
(<any>this)[property] = (<any>data)[property];
|
|
32304
|
+
}
|
|
32305
|
+
}
|
|
32306
|
+
}
|
|
32307
|
+
|
|
32308
|
+
init(_data?: any) {
|
|
32309
|
+
if (_data) {
|
|
32310
|
+
this.datapoint = _data["datapoint"] ? MachineStateDatapoint.fromJS(_data["datapoint"]) : <any>undefined;
|
|
32311
|
+
this.startTime = _data["startTime"] ? new Date(_data["startTime"].toString()) : <any>undefined;
|
|
32312
|
+
this.endTime = _data["endTime"] ? new Date(_data["endTime"].toString()) : <any>undefined;
|
|
32313
|
+
}
|
|
32314
|
+
}
|
|
32315
|
+
|
|
32316
|
+
static fromJS(data: any): DowntimeMachineStateDto {
|
|
32317
|
+
data = typeof data === 'object' ? data : {};
|
|
32318
|
+
let result = new DowntimeMachineStateDto();
|
|
32319
|
+
result.init(data);
|
|
32320
|
+
return result;
|
|
32321
|
+
}
|
|
32322
|
+
|
|
32323
|
+
toJSON(data?: any) {
|
|
32324
|
+
data = typeof data === 'object' ? data : {};
|
|
32325
|
+
data["datapoint"] = this.datapoint ? this.datapoint.toJSON() : <any>undefined;
|
|
32326
|
+
data["startTime"] = this.startTime ? this.startTime.toISOString() : <any>undefined;
|
|
32327
|
+
data["endTime"] = this.endTime ? this.endTime.toISOString() : <any>undefined;
|
|
32328
|
+
return data;
|
|
32329
|
+
}
|
|
32330
|
+
}
|
|
32331
|
+
|
|
32332
|
+
export interface IDowntimeMachineStateDto {
|
|
32333
|
+
datapoint?: MachineStateDatapoint;
|
|
32334
|
+
startTime?: Date;
|
|
32335
|
+
endTime?: Date;
|
|
32336
|
+
}
|
|
32337
|
+
|
|
32128
32338
|
export class MachineErpDataListDto implements IMachineErpDataListDto {
|
|
32129
32339
|
machines?: SingleMachineErpDataListDto[];
|
|
32130
32340
|
|