@ignos/api-client 20250707.0.12102 → 20250708.0.12105
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 +15 -0
- package/lib/ignosportal-api.js +80 -0
- package/package.json +1 -1
- package/src/ignosportal-api.ts +93 -0
package/lib/ignosportal-api.d.ts
CHANGED
|
@@ -176,6 +176,7 @@ export interface IMachineUtilizationClient {
|
|
|
176
176
|
listMachineUptimesToday(request: ListMachineUptimesTodayRequest): Promise<MachineUptimesAggregateDto>;
|
|
177
177
|
listPowerOnUtilizationDatapoints(id: number | null | undefined, externalId: string | null | undefined, nDays: number | null | undefined, startTime: Date | null | undefined, endTime: Date | null | undefined): Promise<PowerOnUtilizationList>;
|
|
178
178
|
getFactoryUtilization(): Promise<PowerOnUtilizationDto>;
|
|
179
|
+
getProgramTimeline(id: string, startTime: Date | undefined, endTime: Date | undefined): Promise<ProgramDatapoint[]>;
|
|
179
180
|
}
|
|
180
181
|
export declare class MachineUtilizationClient extends AuthorizedApiBase implements IMachineUtilizationClient {
|
|
181
182
|
private http;
|
|
@@ -217,6 +218,8 @@ export declare class MachineUtilizationClient extends AuthorizedApiBase implemen
|
|
|
217
218
|
protected processListPowerOnUtilizationDatapoints(response: Response): Promise<PowerOnUtilizationList>;
|
|
218
219
|
getFactoryUtilization(): Promise<PowerOnUtilizationDto>;
|
|
219
220
|
protected processGetFactoryUtilization(response: Response): Promise<PowerOnUtilizationDto>;
|
|
221
|
+
getProgramTimeline(id: string, startTime: Date | undefined, endTime: Date | undefined): Promise<ProgramDatapoint[]>;
|
|
222
|
+
protected processGetProgramTimeline(response: Response): Promise<ProgramDatapoint[]>;
|
|
220
223
|
}
|
|
221
224
|
export interface IMeClient {
|
|
222
225
|
getMyApps(): Promise<UserAppDto[]>;
|
|
@@ -3112,6 +3115,18 @@ export interface INumericNullableValueWithTimestamp {
|
|
|
3112
3115
|
timestamp?: number;
|
|
3113
3116
|
value?: number | null;
|
|
3114
3117
|
}
|
|
3118
|
+
export declare class ProgramDatapoint implements IProgramDatapoint {
|
|
3119
|
+
timestamp?: number;
|
|
3120
|
+
programValue?: string;
|
|
3121
|
+
constructor(data?: IProgramDatapoint);
|
|
3122
|
+
init(_data?: any): void;
|
|
3123
|
+
static fromJS(data: any): ProgramDatapoint;
|
|
3124
|
+
toJSON(data?: any): any;
|
|
3125
|
+
}
|
|
3126
|
+
export interface IProgramDatapoint {
|
|
3127
|
+
timestamp?: number;
|
|
3128
|
+
programValue?: string;
|
|
3129
|
+
}
|
|
3115
3130
|
export declare class UserAppDto implements IUserAppDto {
|
|
3116
3131
|
key: string;
|
|
3117
3132
|
name: string;
|
package/lib/ignosportal-api.js
CHANGED
|
@@ -970,6 +970,58 @@ export class MachineUtilizationClient extends AuthorizedApiBase {
|
|
|
970
970
|
}
|
|
971
971
|
return Promise.resolve(null);
|
|
972
972
|
}
|
|
973
|
+
getProgramTimeline(id, startTime, endTime) {
|
|
974
|
+
let url_ = this.baseUrl + "/machineutilization/{id}/program-timeline?";
|
|
975
|
+
if (id === undefined || id === null)
|
|
976
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
977
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
978
|
+
if (startTime === null)
|
|
979
|
+
throw new Error("The parameter 'startTime' cannot be null.");
|
|
980
|
+
else if (startTime !== undefined)
|
|
981
|
+
url_ += "startTime=" + encodeURIComponent(startTime ? "" + startTime.toISOString() : "") + "&";
|
|
982
|
+
if (endTime === null)
|
|
983
|
+
throw new Error("The parameter 'endTime' cannot be null.");
|
|
984
|
+
else if (endTime !== undefined)
|
|
985
|
+
url_ += "endTime=" + encodeURIComponent(endTime ? "" + endTime.toISOString() : "") + "&";
|
|
986
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
987
|
+
let options_ = {
|
|
988
|
+
method: "GET",
|
|
989
|
+
headers: {
|
|
990
|
+
"Accept": "application/json"
|
|
991
|
+
}
|
|
992
|
+
};
|
|
993
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
994
|
+
return this.http.fetch(url_, transformedOptions_);
|
|
995
|
+
}).then((_response) => {
|
|
996
|
+
return this.processGetProgramTimeline(_response);
|
|
997
|
+
});
|
|
998
|
+
}
|
|
999
|
+
processGetProgramTimeline(response) {
|
|
1000
|
+
const status = response.status;
|
|
1001
|
+
let _headers = {};
|
|
1002
|
+
if (response.headers && response.headers.forEach) {
|
|
1003
|
+
response.headers.forEach((v, k) => _headers[k] = v);
|
|
1004
|
+
}
|
|
1005
|
+
;
|
|
1006
|
+
if (status === 200) {
|
|
1007
|
+
return response.text().then((_responseText) => {
|
|
1008
|
+
let result200 = null;
|
|
1009
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
1010
|
+
if (Array.isArray(resultData200)) {
|
|
1011
|
+
result200 = [];
|
|
1012
|
+
for (let item of resultData200)
|
|
1013
|
+
result200.push(ProgramDatapoint.fromJS(item));
|
|
1014
|
+
}
|
|
1015
|
+
return result200;
|
|
1016
|
+
});
|
|
1017
|
+
}
|
|
1018
|
+
else if (status !== 200 && status !== 204) {
|
|
1019
|
+
return response.text().then((_responseText) => {
|
|
1020
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1021
|
+
});
|
|
1022
|
+
}
|
|
1023
|
+
return Promise.resolve(null);
|
|
1024
|
+
}
|
|
973
1025
|
}
|
|
974
1026
|
export class MeClient extends AuthorizedApiBase {
|
|
975
1027
|
constructor(configuration, baseUrl, http) {
|
|
@@ -23418,6 +23470,34 @@ export class NumericNullableValueWithTimestamp {
|
|
|
23418
23470
|
return data;
|
|
23419
23471
|
}
|
|
23420
23472
|
}
|
|
23473
|
+
export class ProgramDatapoint {
|
|
23474
|
+
constructor(data) {
|
|
23475
|
+
if (data) {
|
|
23476
|
+
for (var property in data) {
|
|
23477
|
+
if (data.hasOwnProperty(property))
|
|
23478
|
+
this[property] = data[property];
|
|
23479
|
+
}
|
|
23480
|
+
}
|
|
23481
|
+
}
|
|
23482
|
+
init(_data) {
|
|
23483
|
+
if (_data) {
|
|
23484
|
+
this.timestamp = _data["timestamp"];
|
|
23485
|
+
this.programValue = _data["programValue"];
|
|
23486
|
+
}
|
|
23487
|
+
}
|
|
23488
|
+
static fromJS(data) {
|
|
23489
|
+
data = typeof data === 'object' ? data : {};
|
|
23490
|
+
let result = new ProgramDatapoint();
|
|
23491
|
+
result.init(data);
|
|
23492
|
+
return result;
|
|
23493
|
+
}
|
|
23494
|
+
toJSON(data) {
|
|
23495
|
+
data = typeof data === 'object' ? data : {};
|
|
23496
|
+
data["timestamp"] = this.timestamp;
|
|
23497
|
+
data["programValue"] = this.programValue;
|
|
23498
|
+
return data;
|
|
23499
|
+
}
|
|
23500
|
+
}
|
|
23421
23501
|
export class UserAppDto {
|
|
23422
23502
|
constructor(data) {
|
|
23423
23503
|
if (data) {
|
package/package.json
CHANGED
package/src/ignosportal-api.ts
CHANGED
|
@@ -716,6 +716,8 @@ export interface IMachineUtilizationClient {
|
|
|
716
716
|
listPowerOnUtilizationDatapoints(id: number | null | undefined, externalId: string | null | undefined, nDays: number | null | undefined, startTime: Date | null | undefined, endTime: Date | null | undefined): Promise<PowerOnUtilizationList>;
|
|
717
717
|
|
|
718
718
|
getFactoryUtilization(): Promise<PowerOnUtilizationDto>;
|
|
719
|
+
|
|
720
|
+
getProgramTimeline(id: string, startTime: Date | undefined, endTime: Date | undefined): Promise<ProgramDatapoint[]>;
|
|
719
721
|
}
|
|
720
722
|
|
|
721
723
|
export class MachineUtilizationClient extends AuthorizedApiBase implements IMachineUtilizationClient {
|
|
@@ -1091,6 +1093,57 @@ export class MachineUtilizationClient extends AuthorizedApiBase implements IMach
|
|
|
1091
1093
|
}
|
|
1092
1094
|
return Promise.resolve<PowerOnUtilizationDto>(null as any);
|
|
1093
1095
|
}
|
|
1096
|
+
|
|
1097
|
+
getProgramTimeline(id: string, startTime: Date | undefined, endTime: Date | undefined): Promise<ProgramDatapoint[]> {
|
|
1098
|
+
let url_ = this.baseUrl + "/machineutilization/{id}/program-timeline?";
|
|
1099
|
+
if (id === undefined || id === null)
|
|
1100
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
1101
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
1102
|
+
if (startTime === null)
|
|
1103
|
+
throw new Error("The parameter 'startTime' cannot be null.");
|
|
1104
|
+
else if (startTime !== undefined)
|
|
1105
|
+
url_ += "startTime=" + encodeURIComponent(startTime ? "" + startTime.toISOString() : "") + "&";
|
|
1106
|
+
if (endTime === null)
|
|
1107
|
+
throw new Error("The parameter 'endTime' cannot be null.");
|
|
1108
|
+
else if (endTime !== undefined)
|
|
1109
|
+
url_ += "endTime=" + encodeURIComponent(endTime ? "" + endTime.toISOString() : "") + "&";
|
|
1110
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1111
|
+
|
|
1112
|
+
let options_: RequestInit = {
|
|
1113
|
+
method: "GET",
|
|
1114
|
+
headers: {
|
|
1115
|
+
"Accept": "application/json"
|
|
1116
|
+
}
|
|
1117
|
+
};
|
|
1118
|
+
|
|
1119
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1120
|
+
return this.http.fetch(url_, transformedOptions_);
|
|
1121
|
+
}).then((_response: Response) => {
|
|
1122
|
+
return this.processGetProgramTimeline(_response);
|
|
1123
|
+
});
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
protected processGetProgramTimeline(response: Response): Promise<ProgramDatapoint[]> {
|
|
1127
|
+
const status = response.status;
|
|
1128
|
+
let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
|
|
1129
|
+
if (status === 200) {
|
|
1130
|
+
return response.text().then((_responseText) => {
|
|
1131
|
+
let result200: any = null;
|
|
1132
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
1133
|
+
if (Array.isArray(resultData200)) {
|
|
1134
|
+
result200 = [] as any;
|
|
1135
|
+
for (let item of resultData200)
|
|
1136
|
+
result200!.push(ProgramDatapoint.fromJS(item));
|
|
1137
|
+
}
|
|
1138
|
+
return result200;
|
|
1139
|
+
});
|
|
1140
|
+
} else if (status !== 200 && status !== 204) {
|
|
1141
|
+
return response.text().then((_responseText) => {
|
|
1142
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1143
|
+
});
|
|
1144
|
+
}
|
|
1145
|
+
return Promise.resolve<ProgramDatapoint[]>(null as any);
|
|
1146
|
+
}
|
|
1094
1147
|
}
|
|
1095
1148
|
|
|
1096
1149
|
export interface IMeClient {
|
|
@@ -25328,6 +25381,46 @@ export interface INumericNullableValueWithTimestamp {
|
|
|
25328
25381
|
value?: number | null;
|
|
25329
25382
|
}
|
|
25330
25383
|
|
|
25384
|
+
export class ProgramDatapoint implements IProgramDatapoint {
|
|
25385
|
+
timestamp?: number;
|
|
25386
|
+
programValue?: string;
|
|
25387
|
+
|
|
25388
|
+
constructor(data?: IProgramDatapoint) {
|
|
25389
|
+
if (data) {
|
|
25390
|
+
for (var property in data) {
|
|
25391
|
+
if (data.hasOwnProperty(property))
|
|
25392
|
+
(<any>this)[property] = (<any>data)[property];
|
|
25393
|
+
}
|
|
25394
|
+
}
|
|
25395
|
+
}
|
|
25396
|
+
|
|
25397
|
+
init(_data?: any) {
|
|
25398
|
+
if (_data) {
|
|
25399
|
+
this.timestamp = _data["timestamp"];
|
|
25400
|
+
this.programValue = _data["programValue"];
|
|
25401
|
+
}
|
|
25402
|
+
}
|
|
25403
|
+
|
|
25404
|
+
static fromJS(data: any): ProgramDatapoint {
|
|
25405
|
+
data = typeof data === 'object' ? data : {};
|
|
25406
|
+
let result = new ProgramDatapoint();
|
|
25407
|
+
result.init(data);
|
|
25408
|
+
return result;
|
|
25409
|
+
}
|
|
25410
|
+
|
|
25411
|
+
toJSON(data?: any) {
|
|
25412
|
+
data = typeof data === 'object' ? data : {};
|
|
25413
|
+
data["timestamp"] = this.timestamp;
|
|
25414
|
+
data["programValue"] = this.programValue;
|
|
25415
|
+
return data;
|
|
25416
|
+
}
|
|
25417
|
+
}
|
|
25418
|
+
|
|
25419
|
+
export interface IProgramDatapoint {
|
|
25420
|
+
timestamp?: number;
|
|
25421
|
+
programValue?: string;
|
|
25422
|
+
}
|
|
25423
|
+
|
|
25331
25424
|
export class UserAppDto implements IUserAppDto {
|
|
25332
25425
|
key!: string;
|
|
25333
25426
|
name!: string;
|