@ignos/api-client 20250312.0.11352 → 20250312.0.11355
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 +3 -0
- package/lib/ignosportal-api.js +44 -0
- package/package.json +1 -1
- package/src/ignosportal-api.ts +45 -0
package/lib/ignosportal-api.d.ts
CHANGED
|
@@ -834,6 +834,7 @@ export interface IMachinesClient {
|
|
|
834
834
|
listCurrentMachineStates(assetId: number | null | undefined): Promise<MachineStateListDto>;
|
|
835
835
|
listMachineStates(id: number, startTime: Date | null | undefined, endTime: Date | null | undefined): Promise<MachineStateDatapoint[]>;
|
|
836
836
|
listLastDowntimeMachineStates(id: number, endTime: Date | null | undefined, maxStates: number | null | undefined): Promise<DowntimeMachineStateDto[]>;
|
|
837
|
+
getMachineStateWithDowntimePeriods(id: number, timestamp: number | undefined): Promise<DowntimeMachineStateDto>;
|
|
837
838
|
getMachineStatesSummary(id: number, startTime: Date | null | undefined, endTime: Date | null | undefined): Promise<MachineStatesSummaryDto>;
|
|
838
839
|
listMachineErpData(): Promise<MachineErpDataListDto>;
|
|
839
840
|
getMachineErpData(id: number): Promise<MachineErpDataDto>;
|
|
@@ -868,6 +869,8 @@ export declare class MachinesClient extends AuthorizedApiBase implements IMachin
|
|
|
868
869
|
protected processListMachineStates(response: Response): Promise<MachineStateDatapoint[]>;
|
|
869
870
|
listLastDowntimeMachineStates(id: number, endTime: Date | null | undefined, maxStates: number | null | undefined): Promise<DowntimeMachineStateDto[]>;
|
|
870
871
|
protected processListLastDowntimeMachineStates(response: Response): Promise<DowntimeMachineStateDto[]>;
|
|
872
|
+
getMachineStateWithDowntimePeriods(id: number, timestamp: number | undefined): Promise<DowntimeMachineStateDto>;
|
|
873
|
+
protected processGetMachineStateWithDowntimePeriods(response: Response): Promise<DowntimeMachineStateDto>;
|
|
871
874
|
getMachineStatesSummary(id: number, startTime: Date | null | undefined, endTime: Date | null | undefined): Promise<MachineStatesSummaryDto>;
|
|
872
875
|
protected processGetMachineStatesSummary(response: Response): Promise<MachineStatesSummaryDto>;
|
|
873
876
|
listMachineErpData(): Promise<MachineErpDataListDto>;
|
package/lib/ignosportal-api.js
CHANGED
|
@@ -6615,6 +6615,50 @@ export class MachinesClient extends AuthorizedApiBase {
|
|
|
6615
6615
|
}
|
|
6616
6616
|
return Promise.resolve(null);
|
|
6617
6617
|
}
|
|
6618
|
+
getMachineStateWithDowntimePeriods(id, timestamp) {
|
|
6619
|
+
let url_ = this.baseUrl + "/machines/{id}/statewithdowntimeperiods?";
|
|
6620
|
+
if (id === undefined || id === null)
|
|
6621
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
6622
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
6623
|
+
if (timestamp === null)
|
|
6624
|
+
throw new Error("The parameter 'timestamp' cannot be null.");
|
|
6625
|
+
else if (timestamp !== undefined)
|
|
6626
|
+
url_ += "timestamp=" + encodeURIComponent("" + timestamp) + "&";
|
|
6627
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
6628
|
+
let options_ = {
|
|
6629
|
+
method: "GET",
|
|
6630
|
+
headers: {
|
|
6631
|
+
"Accept": "application/json"
|
|
6632
|
+
}
|
|
6633
|
+
};
|
|
6634
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
6635
|
+
return this.http.fetch(url_, transformedOptions_);
|
|
6636
|
+
}).then((_response) => {
|
|
6637
|
+
return this.processGetMachineStateWithDowntimePeriods(_response);
|
|
6638
|
+
});
|
|
6639
|
+
}
|
|
6640
|
+
processGetMachineStateWithDowntimePeriods(response) {
|
|
6641
|
+
const status = response.status;
|
|
6642
|
+
let _headers = {};
|
|
6643
|
+
if (response.headers && response.headers.forEach) {
|
|
6644
|
+
response.headers.forEach((v, k) => _headers[k] = v);
|
|
6645
|
+
}
|
|
6646
|
+
;
|
|
6647
|
+
if (status === 200) {
|
|
6648
|
+
return response.text().then((_responseText) => {
|
|
6649
|
+
let result200 = null;
|
|
6650
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
6651
|
+
result200 = DowntimeMachineStateDto.fromJS(resultData200);
|
|
6652
|
+
return result200;
|
|
6653
|
+
});
|
|
6654
|
+
}
|
|
6655
|
+
else if (status !== 200 && status !== 204) {
|
|
6656
|
+
return response.text().then((_responseText) => {
|
|
6657
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
6658
|
+
});
|
|
6659
|
+
}
|
|
6660
|
+
return Promise.resolve(null);
|
|
6661
|
+
}
|
|
6618
6662
|
getMachineStatesSummary(id, startTime, endTime) {
|
|
6619
6663
|
let url_ = this.baseUrl + "/machines/{id}/states/summary?";
|
|
6620
6664
|
if (id === undefined || id === null)
|
package/package.json
CHANGED
package/src/ignosportal-api.ts
CHANGED
|
@@ -6749,6 +6749,8 @@ export interface IMachinesClient {
|
|
|
6749
6749
|
|
|
6750
6750
|
listLastDowntimeMachineStates(id: number, endTime: Date | null | undefined, maxStates: number | null | undefined): Promise<DowntimeMachineStateDto[]>;
|
|
6751
6751
|
|
|
6752
|
+
getMachineStateWithDowntimePeriods(id: number, timestamp: number | undefined): Promise<DowntimeMachineStateDto>;
|
|
6753
|
+
|
|
6752
6754
|
getMachineStatesSummary(id: number, startTime: Date | null | undefined, endTime: Date | null | undefined): Promise<MachineStatesSummaryDto>;
|
|
6753
6755
|
|
|
6754
6756
|
listMachineErpData(): Promise<MachineErpDataListDto>;
|
|
@@ -7111,6 +7113,49 @@ export class MachinesClient extends AuthorizedApiBase implements IMachinesClient
|
|
|
7111
7113
|
return Promise.resolve<DowntimeMachineStateDto[]>(null as any);
|
|
7112
7114
|
}
|
|
7113
7115
|
|
|
7116
|
+
getMachineStateWithDowntimePeriods(id: number, timestamp: number | undefined): Promise<DowntimeMachineStateDto> {
|
|
7117
|
+
let url_ = this.baseUrl + "/machines/{id}/statewithdowntimeperiods?";
|
|
7118
|
+
if (id === undefined || id === null)
|
|
7119
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
7120
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
7121
|
+
if (timestamp === null)
|
|
7122
|
+
throw new Error("The parameter 'timestamp' cannot be null.");
|
|
7123
|
+
else if (timestamp !== undefined)
|
|
7124
|
+
url_ += "timestamp=" + encodeURIComponent("" + timestamp) + "&";
|
|
7125
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
7126
|
+
|
|
7127
|
+
let options_: RequestInit = {
|
|
7128
|
+
method: "GET",
|
|
7129
|
+
headers: {
|
|
7130
|
+
"Accept": "application/json"
|
|
7131
|
+
}
|
|
7132
|
+
};
|
|
7133
|
+
|
|
7134
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
7135
|
+
return this.http.fetch(url_, transformedOptions_);
|
|
7136
|
+
}).then((_response: Response) => {
|
|
7137
|
+
return this.processGetMachineStateWithDowntimePeriods(_response);
|
|
7138
|
+
});
|
|
7139
|
+
}
|
|
7140
|
+
|
|
7141
|
+
protected processGetMachineStateWithDowntimePeriods(response: Response): Promise<DowntimeMachineStateDto> {
|
|
7142
|
+
const status = response.status;
|
|
7143
|
+
let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
|
|
7144
|
+
if (status === 200) {
|
|
7145
|
+
return response.text().then((_responseText) => {
|
|
7146
|
+
let result200: any = null;
|
|
7147
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
7148
|
+
result200 = DowntimeMachineStateDto.fromJS(resultData200);
|
|
7149
|
+
return result200;
|
|
7150
|
+
});
|
|
7151
|
+
} else if (status !== 200 && status !== 204) {
|
|
7152
|
+
return response.text().then((_responseText) => {
|
|
7153
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
7154
|
+
});
|
|
7155
|
+
}
|
|
7156
|
+
return Promise.resolve<DowntimeMachineStateDto>(null as any);
|
|
7157
|
+
}
|
|
7158
|
+
|
|
7114
7159
|
getMachineStatesSummary(id: number, startTime: Date | null | undefined, endTime: Date | null | undefined): Promise<MachineStatesSummaryDto> {
|
|
7115
7160
|
let url_ = this.baseUrl + "/machines/{id}/states/summary?";
|
|
7116
7161
|
if (id === undefined || id === null)
|