@ignos/api-client 20260106.0.13658 → 20260108.0.13688-alpha
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 +146 -0
- package/lib/ignosportal-api.js +648 -0
- package/package.json +1 -1
- package/src/ignosportal-api.ts +761 -0
package/lib/ignosportal-api.js
CHANGED
|
@@ -1069,6 +1069,434 @@ export class MachineUtilizationClient extends AuthorizedApiBase {
|
|
|
1069
1069
|
return Promise.resolve(null);
|
|
1070
1070
|
}
|
|
1071
1071
|
}
|
|
1072
|
+
export class ResourceUtilizationClient extends AuthorizedApiBase {
|
|
1073
|
+
constructor(configuration, baseUrl, http) {
|
|
1074
|
+
super(configuration);
|
|
1075
|
+
this.jsonParseReviver = undefined;
|
|
1076
|
+
this.http = http ? http : window;
|
|
1077
|
+
this.baseUrl = baseUrl !== null && baseUrl !== void 0 ? baseUrl : "";
|
|
1078
|
+
}
|
|
1079
|
+
/**
|
|
1080
|
+
* Get machine utilization data. Historic utilizations start from now, whereas the start for current utilization is
|
|
1081
|
+
calculated based on startTimeToday or utcOffset. An UTC offset is
|
|
1082
|
+
obtained either from startTimeToday, utcOffset or the server's local
|
|
1083
|
+
time zone. The current utilization is calculated starting from the start of the current date offset from UTC
|
|
1084
|
+
by the offset used. Pass in utcOffset to avoid problems relating to clock drift between
|
|
1085
|
+
client and server
|
|
1086
|
+
* @param assetId (optional)
|
|
1087
|
+
* @param favorites (optional)
|
|
1088
|
+
* @param startTimeToday (optional) UTC offset for start of today's utilization is extracted from this value
|
|
1089
|
+
* @param utcOffset (optional) Explicit UTC offset for start of today's utilization
|
|
1090
|
+
*/
|
|
1091
|
+
getResourceUtilizations(assetId, favorites, startTimeToday, utcOffset) {
|
|
1092
|
+
let url_ = this.baseUrl + "/resourceutilization?";
|
|
1093
|
+
if (assetId !== undefined && assetId !== null)
|
|
1094
|
+
url_ += "assetId=" + encodeURIComponent("" + assetId) + "&";
|
|
1095
|
+
if (favorites === null)
|
|
1096
|
+
throw new globalThis.Error("The parameter 'favorites' cannot be null.");
|
|
1097
|
+
else if (favorites !== undefined)
|
|
1098
|
+
url_ += "favorites=" + encodeURIComponent("" + favorites) + "&";
|
|
1099
|
+
if (startTimeToday !== undefined && startTimeToday !== null)
|
|
1100
|
+
url_ += "startTimeToday=" + encodeURIComponent(startTimeToday ? "" + startTimeToday.toISOString() : "") + "&";
|
|
1101
|
+
if (utcOffset !== undefined && utcOffset !== null)
|
|
1102
|
+
url_ += "utcOffset=" + encodeURIComponent("" + utcOffset) + "&";
|
|
1103
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1104
|
+
let options_ = {
|
|
1105
|
+
method: "GET",
|
|
1106
|
+
headers: {
|
|
1107
|
+
"Accept": "application/json"
|
|
1108
|
+
}
|
|
1109
|
+
};
|
|
1110
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1111
|
+
return this.http.fetch(url_, transformedOptions_);
|
|
1112
|
+
}).then((_response) => {
|
|
1113
|
+
return this.processGetResourceUtilizations(_response);
|
|
1114
|
+
});
|
|
1115
|
+
}
|
|
1116
|
+
processGetResourceUtilizations(response) {
|
|
1117
|
+
const status = response.status;
|
|
1118
|
+
let _headers = {};
|
|
1119
|
+
if (response.headers && response.headers.forEach) {
|
|
1120
|
+
response.headers.forEach((v, k) => _headers[k] = v);
|
|
1121
|
+
}
|
|
1122
|
+
;
|
|
1123
|
+
if (status === 200) {
|
|
1124
|
+
return response.text().then((_responseText) => {
|
|
1125
|
+
let result200 = null;
|
|
1126
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
1127
|
+
result200 = ResourceUtilizationListDto.fromJS(resultData200);
|
|
1128
|
+
return result200;
|
|
1129
|
+
});
|
|
1130
|
+
}
|
|
1131
|
+
else if (status !== 200 && status !== 204) {
|
|
1132
|
+
return response.text().then((_responseText) => {
|
|
1133
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1134
|
+
});
|
|
1135
|
+
}
|
|
1136
|
+
return Promise.resolve(null);
|
|
1137
|
+
}
|
|
1138
|
+
getResourceUtilization(id, startTime, endTime) {
|
|
1139
|
+
let url_ = this.baseUrl + "/resourceutilization/{id}?";
|
|
1140
|
+
if (id === undefined || id === null)
|
|
1141
|
+
throw new globalThis.Error("The parameter 'id' must be defined.");
|
|
1142
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
1143
|
+
if (startTime === null)
|
|
1144
|
+
throw new globalThis.Error("The parameter 'startTime' cannot be null.");
|
|
1145
|
+
else if (startTime !== undefined)
|
|
1146
|
+
url_ += "startTime=" + encodeURIComponent(startTime ? "" + startTime.toISOString() : "") + "&";
|
|
1147
|
+
if (endTime !== undefined && endTime !== null)
|
|
1148
|
+
url_ += "endTime=" + encodeURIComponent(endTime ? "" + endTime.toISOString() : "") + "&";
|
|
1149
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1150
|
+
let options_ = {
|
|
1151
|
+
method: "GET",
|
|
1152
|
+
headers: {
|
|
1153
|
+
"Accept": "application/json"
|
|
1154
|
+
}
|
|
1155
|
+
};
|
|
1156
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1157
|
+
return this.http.fetch(url_, transformedOptions_);
|
|
1158
|
+
}).then((_response) => {
|
|
1159
|
+
return this.processGetResourceUtilization(_response);
|
|
1160
|
+
});
|
|
1161
|
+
}
|
|
1162
|
+
processGetResourceUtilization(response) {
|
|
1163
|
+
const status = response.status;
|
|
1164
|
+
let _headers = {};
|
|
1165
|
+
if (response.headers && response.headers.forEach) {
|
|
1166
|
+
response.headers.forEach((v, k) => _headers[k] = v);
|
|
1167
|
+
}
|
|
1168
|
+
;
|
|
1169
|
+
if (status === 200) {
|
|
1170
|
+
return response.text().then((_responseText) => {
|
|
1171
|
+
let result200 = null;
|
|
1172
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
1173
|
+
result200 = ResourceUtilizationDetailsDto.fromJS(resultData200);
|
|
1174
|
+
return result200;
|
|
1175
|
+
});
|
|
1176
|
+
}
|
|
1177
|
+
else if (status !== 200 && status !== 204) {
|
|
1178
|
+
return response.text().then((_responseText) => {
|
|
1179
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1180
|
+
});
|
|
1181
|
+
}
|
|
1182
|
+
return Promise.resolve(null);
|
|
1183
|
+
}
|
|
1184
|
+
getResourceTimelines(id, startTime, endTime, filter) {
|
|
1185
|
+
let url_ = this.baseUrl + "/resourceutilization/{id}/resource/timelines?";
|
|
1186
|
+
if (id === undefined || id === null)
|
|
1187
|
+
throw new globalThis.Error("The parameter 'id' must be defined.");
|
|
1188
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
1189
|
+
if (startTime !== undefined && startTime !== null)
|
|
1190
|
+
url_ += "startTime=" + encodeURIComponent(startTime ? "" + startTime.toISOString() : "") + "&";
|
|
1191
|
+
if (endTime !== undefined && endTime !== null)
|
|
1192
|
+
url_ += "endTime=" + encodeURIComponent(endTime ? "" + endTime.toISOString() : "") + "&";
|
|
1193
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1194
|
+
const content_ = JSON.stringify(filter);
|
|
1195
|
+
let options_ = {
|
|
1196
|
+
body: content_,
|
|
1197
|
+
method: "POST",
|
|
1198
|
+
headers: {
|
|
1199
|
+
"Content-Type": "application/json",
|
|
1200
|
+
"Accept": "application/json"
|
|
1201
|
+
}
|
|
1202
|
+
};
|
|
1203
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1204
|
+
return this.http.fetch(url_, transformedOptions_);
|
|
1205
|
+
}).then((_response) => {
|
|
1206
|
+
return this.processGetResourceTimelines(_response);
|
|
1207
|
+
});
|
|
1208
|
+
}
|
|
1209
|
+
processGetResourceTimelines(response) {
|
|
1210
|
+
const status = response.status;
|
|
1211
|
+
let _headers = {};
|
|
1212
|
+
if (response.headers && response.headers.forEach) {
|
|
1213
|
+
response.headers.forEach((v, k) => _headers[k] = v);
|
|
1214
|
+
}
|
|
1215
|
+
;
|
|
1216
|
+
if (status === 200) {
|
|
1217
|
+
return response.text().then((_responseText) => {
|
|
1218
|
+
let result200 = null;
|
|
1219
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
1220
|
+
result200 = TimelinesDto.fromJS(resultData200);
|
|
1221
|
+
return result200;
|
|
1222
|
+
});
|
|
1223
|
+
}
|
|
1224
|
+
else if (status !== 200 && status !== 204) {
|
|
1225
|
+
return response.text().then((_responseText) => {
|
|
1226
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1227
|
+
});
|
|
1228
|
+
}
|
|
1229
|
+
return Promise.resolve(null);
|
|
1230
|
+
}
|
|
1231
|
+
listMachineStates(id, startTime, endTime) {
|
|
1232
|
+
let url_ = this.baseUrl + "/resourceutilization/{id}/machine-states?";
|
|
1233
|
+
if (id === undefined || id === null)
|
|
1234
|
+
throw new globalThis.Error("The parameter 'id' must be defined.");
|
|
1235
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
1236
|
+
if (startTime !== undefined && startTime !== null)
|
|
1237
|
+
url_ += "startTime=" + encodeURIComponent(startTime ? "" + startTime.toISOString() : "") + "&";
|
|
1238
|
+
if (endTime !== undefined && endTime !== null)
|
|
1239
|
+
url_ += "endTime=" + encodeURIComponent(endTime ? "" + endTime.toISOString() : "") + "&";
|
|
1240
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1241
|
+
let options_ = {
|
|
1242
|
+
method: "GET",
|
|
1243
|
+
headers: {
|
|
1244
|
+
"Accept": "application/json"
|
|
1245
|
+
}
|
|
1246
|
+
};
|
|
1247
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1248
|
+
return this.http.fetch(url_, transformedOptions_);
|
|
1249
|
+
}).then((_response) => {
|
|
1250
|
+
return this.processListMachineStates(_response);
|
|
1251
|
+
});
|
|
1252
|
+
}
|
|
1253
|
+
processListMachineStates(response) {
|
|
1254
|
+
const status = response.status;
|
|
1255
|
+
let _headers = {};
|
|
1256
|
+
if (response.headers && response.headers.forEach) {
|
|
1257
|
+
response.headers.forEach((v, k) => _headers[k] = v);
|
|
1258
|
+
}
|
|
1259
|
+
;
|
|
1260
|
+
if (status === 200) {
|
|
1261
|
+
return response.text().then((_responseText) => {
|
|
1262
|
+
let result200 = null;
|
|
1263
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
1264
|
+
if (Array.isArray(resultData200)) {
|
|
1265
|
+
result200 = [];
|
|
1266
|
+
for (let item of resultData200)
|
|
1267
|
+
result200.push(MachineStateDatapoint.fromJS(item));
|
|
1268
|
+
}
|
|
1269
|
+
return result200;
|
|
1270
|
+
});
|
|
1271
|
+
}
|
|
1272
|
+
else if (status !== 200 && status !== 204) {
|
|
1273
|
+
return response.text().then((_responseText) => {
|
|
1274
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1275
|
+
});
|
|
1276
|
+
}
|
|
1277
|
+
return Promise.resolve(null);
|
|
1278
|
+
}
|
|
1279
|
+
getMachineStatesSummary(id, startTime, endTime) {
|
|
1280
|
+
let url_ = this.baseUrl + "/resourceutilization/{id}/machine-states/summary?";
|
|
1281
|
+
if (id === undefined || id === null)
|
|
1282
|
+
throw new globalThis.Error("The parameter 'id' must be defined.");
|
|
1283
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
1284
|
+
if (startTime !== undefined && startTime !== null)
|
|
1285
|
+
url_ += "startTime=" + encodeURIComponent(startTime ? "" + startTime.toISOString() : "") + "&";
|
|
1286
|
+
if (endTime !== undefined && endTime !== null)
|
|
1287
|
+
url_ += "endTime=" + encodeURIComponent(endTime ? "" + endTime.toISOString() : "") + "&";
|
|
1288
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1289
|
+
let options_ = {
|
|
1290
|
+
method: "GET",
|
|
1291
|
+
headers: {
|
|
1292
|
+
"Accept": "application/json"
|
|
1293
|
+
}
|
|
1294
|
+
};
|
|
1295
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1296
|
+
return this.http.fetch(url_, transformedOptions_);
|
|
1297
|
+
}).then((_response) => {
|
|
1298
|
+
return this.processGetMachineStatesSummary(_response);
|
|
1299
|
+
});
|
|
1300
|
+
}
|
|
1301
|
+
processGetMachineStatesSummary(response) {
|
|
1302
|
+
const status = response.status;
|
|
1303
|
+
let _headers = {};
|
|
1304
|
+
if (response.headers && response.headers.forEach) {
|
|
1305
|
+
response.headers.forEach((v, k) => _headers[k] = v);
|
|
1306
|
+
}
|
|
1307
|
+
;
|
|
1308
|
+
if (status === 200) {
|
|
1309
|
+
return response.text().then((_responseText) => {
|
|
1310
|
+
let result200 = null;
|
|
1311
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
1312
|
+
result200 = MachineStatesSummaryDto.fromJS(resultData200);
|
|
1313
|
+
return result200;
|
|
1314
|
+
});
|
|
1315
|
+
}
|
|
1316
|
+
else if (status !== 200 && status !== 204) {
|
|
1317
|
+
return response.text().then((_responseText) => {
|
|
1318
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1319
|
+
});
|
|
1320
|
+
}
|
|
1321
|
+
return Promise.resolve(null);
|
|
1322
|
+
}
|
|
1323
|
+
listResourceUptimesToday(request) {
|
|
1324
|
+
let url_ = this.baseUrl + "/resourceutilization/machine-states/uptime-today";
|
|
1325
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1326
|
+
const content_ = JSON.stringify(request);
|
|
1327
|
+
let options_ = {
|
|
1328
|
+
body: content_,
|
|
1329
|
+
method: "POST",
|
|
1330
|
+
headers: {
|
|
1331
|
+
"Content-Type": "application/json",
|
|
1332
|
+
"Accept": "application/json"
|
|
1333
|
+
}
|
|
1334
|
+
};
|
|
1335
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1336
|
+
return this.http.fetch(url_, transformedOptions_);
|
|
1337
|
+
}).then((_response) => {
|
|
1338
|
+
return this.processListResourceUptimesToday(_response);
|
|
1339
|
+
});
|
|
1340
|
+
}
|
|
1341
|
+
processListResourceUptimesToday(response) {
|
|
1342
|
+
const status = response.status;
|
|
1343
|
+
let _headers = {};
|
|
1344
|
+
if (response.headers && response.headers.forEach) {
|
|
1345
|
+
response.headers.forEach((v, k) => _headers[k] = v);
|
|
1346
|
+
}
|
|
1347
|
+
;
|
|
1348
|
+
if (status === 200) {
|
|
1349
|
+
return response.text().then((_responseText) => {
|
|
1350
|
+
let result200 = null;
|
|
1351
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
1352
|
+
result200 = MachineUptimesAggregateDto.fromJS(resultData200);
|
|
1353
|
+
return result200;
|
|
1354
|
+
});
|
|
1355
|
+
}
|
|
1356
|
+
else if (status !== 200 && status !== 204) {
|
|
1357
|
+
return response.text().then((_responseText) => {
|
|
1358
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1359
|
+
});
|
|
1360
|
+
}
|
|
1361
|
+
return Promise.resolve(null);
|
|
1362
|
+
}
|
|
1363
|
+
listPowerOnUtilizationDatapoints(id, externalId, nDays, startTime, endTime) {
|
|
1364
|
+
let url_ = this.baseUrl + "/resourceutilization/power-on/datapoints?";
|
|
1365
|
+
if (id !== undefined && id !== null)
|
|
1366
|
+
url_ += "id=" + encodeURIComponent("" + id) + "&";
|
|
1367
|
+
if (externalId !== undefined && externalId !== null)
|
|
1368
|
+
url_ += "externalId=" + encodeURIComponent("" + externalId) + "&";
|
|
1369
|
+
if (nDays !== undefined && nDays !== null)
|
|
1370
|
+
url_ += "nDays=" + encodeURIComponent("" + nDays) + "&";
|
|
1371
|
+
if (startTime !== undefined && startTime !== null)
|
|
1372
|
+
url_ += "startTime=" + encodeURIComponent(startTime ? "" + startTime.toISOString() : "") + "&";
|
|
1373
|
+
if (endTime !== undefined && endTime !== null)
|
|
1374
|
+
url_ += "endTime=" + encodeURIComponent(endTime ? "" + endTime.toISOString() : "") + "&";
|
|
1375
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1376
|
+
let options_ = {
|
|
1377
|
+
method: "GET",
|
|
1378
|
+
headers: {
|
|
1379
|
+
"Accept": "application/json"
|
|
1380
|
+
}
|
|
1381
|
+
};
|
|
1382
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1383
|
+
return this.http.fetch(url_, transformedOptions_);
|
|
1384
|
+
}).then((_response) => {
|
|
1385
|
+
return this.processListPowerOnUtilizationDatapoints(_response);
|
|
1386
|
+
});
|
|
1387
|
+
}
|
|
1388
|
+
processListPowerOnUtilizationDatapoints(response) {
|
|
1389
|
+
const status = response.status;
|
|
1390
|
+
let _headers = {};
|
|
1391
|
+
if (response.headers && response.headers.forEach) {
|
|
1392
|
+
response.headers.forEach((v, k) => _headers[k] = v);
|
|
1393
|
+
}
|
|
1394
|
+
;
|
|
1395
|
+
if (status === 200) {
|
|
1396
|
+
return response.text().then((_responseText) => {
|
|
1397
|
+
let result200 = null;
|
|
1398
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
1399
|
+
result200 = PowerOnUtilizationList.fromJS(resultData200);
|
|
1400
|
+
return result200;
|
|
1401
|
+
});
|
|
1402
|
+
}
|
|
1403
|
+
else if (status !== 200 && status !== 204) {
|
|
1404
|
+
return response.text().then((_responseText) => {
|
|
1405
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1406
|
+
});
|
|
1407
|
+
}
|
|
1408
|
+
return Promise.resolve(null);
|
|
1409
|
+
}
|
|
1410
|
+
getFactoryUtilization() {
|
|
1411
|
+
let url_ = this.baseUrl + "/resourceutilization/factory";
|
|
1412
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1413
|
+
let options_ = {
|
|
1414
|
+
method: "GET",
|
|
1415
|
+
headers: {
|
|
1416
|
+
"Accept": "application/json"
|
|
1417
|
+
}
|
|
1418
|
+
};
|
|
1419
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1420
|
+
return this.http.fetch(url_, transformedOptions_);
|
|
1421
|
+
}).then((_response) => {
|
|
1422
|
+
return this.processGetFactoryUtilization(_response);
|
|
1423
|
+
});
|
|
1424
|
+
}
|
|
1425
|
+
processGetFactoryUtilization(response) {
|
|
1426
|
+
const status = response.status;
|
|
1427
|
+
let _headers = {};
|
|
1428
|
+
if (response.headers && response.headers.forEach) {
|
|
1429
|
+
response.headers.forEach((v, k) => _headers[k] = v);
|
|
1430
|
+
}
|
|
1431
|
+
;
|
|
1432
|
+
if (status === 200) {
|
|
1433
|
+
return response.text().then((_responseText) => {
|
|
1434
|
+
let result200 = null;
|
|
1435
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
1436
|
+
result200 = PowerOnUtilizationDto.fromJS(resultData200);
|
|
1437
|
+
return result200;
|
|
1438
|
+
});
|
|
1439
|
+
}
|
|
1440
|
+
else if (status !== 200 && status !== 204) {
|
|
1441
|
+
return response.text().then((_responseText) => {
|
|
1442
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1443
|
+
});
|
|
1444
|
+
}
|
|
1445
|
+
return Promise.resolve(null);
|
|
1446
|
+
}
|
|
1447
|
+
getProgramTimeline(id, startTime, endTime) {
|
|
1448
|
+
let url_ = this.baseUrl + "/resourceutilization/{id}/program-timeline?";
|
|
1449
|
+
if (id === undefined || id === null)
|
|
1450
|
+
throw new globalThis.Error("The parameter 'id' must be defined.");
|
|
1451
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
1452
|
+
if (startTime === null)
|
|
1453
|
+
throw new globalThis.Error("The parameter 'startTime' cannot be null.");
|
|
1454
|
+
else if (startTime !== undefined)
|
|
1455
|
+
url_ += "startTime=" + encodeURIComponent(startTime ? "" + startTime.toISOString() : "") + "&";
|
|
1456
|
+
if (endTime === null)
|
|
1457
|
+
throw new globalThis.Error("The parameter 'endTime' cannot be null.");
|
|
1458
|
+
else if (endTime !== undefined)
|
|
1459
|
+
url_ += "endTime=" + encodeURIComponent(endTime ? "" + endTime.toISOString() : "") + "&";
|
|
1460
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1461
|
+
let options_ = {
|
|
1462
|
+
method: "GET",
|
|
1463
|
+
headers: {
|
|
1464
|
+
"Accept": "application/json"
|
|
1465
|
+
}
|
|
1466
|
+
};
|
|
1467
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
1468
|
+
return this.http.fetch(url_, transformedOptions_);
|
|
1469
|
+
}).then((_response) => {
|
|
1470
|
+
return this.processGetProgramTimeline(_response);
|
|
1471
|
+
});
|
|
1472
|
+
}
|
|
1473
|
+
processGetProgramTimeline(response) {
|
|
1474
|
+
const status = response.status;
|
|
1475
|
+
let _headers = {};
|
|
1476
|
+
if (response.headers && response.headers.forEach) {
|
|
1477
|
+
response.headers.forEach((v, k) => _headers[k] = v);
|
|
1478
|
+
}
|
|
1479
|
+
;
|
|
1480
|
+
if (status === 200) {
|
|
1481
|
+
return response.text().then((_responseText) => {
|
|
1482
|
+
let result200 = null;
|
|
1483
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
1484
|
+
if (Array.isArray(resultData200)) {
|
|
1485
|
+
result200 = [];
|
|
1486
|
+
for (let item of resultData200)
|
|
1487
|
+
result200.push(ProgramDatapoint.fromJS(item));
|
|
1488
|
+
}
|
|
1489
|
+
return result200;
|
|
1490
|
+
});
|
|
1491
|
+
}
|
|
1492
|
+
else if (status !== 200 && status !== 204) {
|
|
1493
|
+
return response.text().then((_responseText) => {
|
|
1494
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1495
|
+
});
|
|
1496
|
+
}
|
|
1497
|
+
return Promise.resolve(null);
|
|
1498
|
+
}
|
|
1499
|
+
}
|
|
1072
1500
|
export class MeClient extends AuthorizedApiBase {
|
|
1073
1501
|
constructor(configuration, baseUrl, http) {
|
|
1074
1502
|
super(configuration);
|
|
@@ -21584,6 +22012,48 @@ export class MeasurementFormsInstancesClient extends AuthorizedApiBase {
|
|
|
21584
22012
|
}
|
|
21585
22013
|
return Promise.resolve(null);
|
|
21586
22014
|
}
|
|
22015
|
+
completeMeasurementFormInstanceV2(id, tenantId) {
|
|
22016
|
+
let url_ = this.baseUrl + "/measurementforms/instances/{id}/complete-v2?";
|
|
22017
|
+
if (id === undefined || id === null)
|
|
22018
|
+
throw new globalThis.Error("The parameter 'id' must be defined.");
|
|
22019
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
22020
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
22021
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
22022
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
22023
|
+
let options_ = {
|
|
22024
|
+
method: "POST",
|
|
22025
|
+
headers: {
|
|
22026
|
+
"Accept": "application/json"
|
|
22027
|
+
}
|
|
22028
|
+
};
|
|
22029
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
22030
|
+
return this.http.fetch(url_, transformedOptions_);
|
|
22031
|
+
}).then((_response) => {
|
|
22032
|
+
return this.processCompleteMeasurementFormInstanceV2(_response);
|
|
22033
|
+
});
|
|
22034
|
+
}
|
|
22035
|
+
processCompleteMeasurementFormInstanceV2(response) {
|
|
22036
|
+
const status = response.status;
|
|
22037
|
+
let _headers = {};
|
|
22038
|
+
if (response.headers && response.headers.forEach) {
|
|
22039
|
+
response.headers.forEach((v, k) => _headers[k] = v);
|
|
22040
|
+
}
|
|
22041
|
+
;
|
|
22042
|
+
if (status === 200) {
|
|
22043
|
+
return response.text().then((_responseText) => {
|
|
22044
|
+
let result200 = null;
|
|
22045
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
22046
|
+
result200 = CompleteMeasurementFormInstanceResult.fromJS(resultData200);
|
|
22047
|
+
return result200;
|
|
22048
|
+
});
|
|
22049
|
+
}
|
|
22050
|
+
else if (status !== 200 && status !== 204) {
|
|
22051
|
+
return response.text().then((_responseText) => {
|
|
22052
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
22053
|
+
});
|
|
22054
|
+
}
|
|
22055
|
+
return Promise.resolve(null);
|
|
22056
|
+
}
|
|
21587
22057
|
getMeasurementFormInstanceSchema(id, schemaId, serialNumber, tenantId) {
|
|
21588
22058
|
let url_ = this.baseUrl + "/measurementforms/instances/{id}/schemas/{schemaId}?";
|
|
21589
22059
|
if (id === undefined || id === null)
|
|
@@ -25505,6 +25975,152 @@ export class NumericNullableValueWithTimestamp {
|
|
|
25505
25975
|
return data;
|
|
25506
25976
|
}
|
|
25507
25977
|
}
|
|
25978
|
+
export class ResourceUtilizationListDto {
|
|
25979
|
+
constructor(data) {
|
|
25980
|
+
if (data) {
|
|
25981
|
+
for (var property in data) {
|
|
25982
|
+
if (data.hasOwnProperty(property))
|
|
25983
|
+
this[property] = data[property];
|
|
25984
|
+
}
|
|
25985
|
+
}
|
|
25986
|
+
}
|
|
25987
|
+
init(_data) {
|
|
25988
|
+
if (_data) {
|
|
25989
|
+
if (Array.isArray(_data["resources"])) {
|
|
25990
|
+
this.resources = [];
|
|
25991
|
+
for (let item of _data["resources"])
|
|
25992
|
+
this.resources.push(ResourceUtilizationDto.fromJS(item));
|
|
25993
|
+
}
|
|
25994
|
+
}
|
|
25995
|
+
}
|
|
25996
|
+
static fromJS(data) {
|
|
25997
|
+
data = typeof data === 'object' ? data : {};
|
|
25998
|
+
let result = new ResourceUtilizationListDto();
|
|
25999
|
+
result.init(data);
|
|
26000
|
+
return result;
|
|
26001
|
+
}
|
|
26002
|
+
toJSON(data) {
|
|
26003
|
+
data = typeof data === 'object' ? data : {};
|
|
26004
|
+
if (Array.isArray(this.resources)) {
|
|
26005
|
+
data["resources"] = [];
|
|
26006
|
+
for (let item of this.resources)
|
|
26007
|
+
data["resources"].push(item ? item.toJSON() : undefined);
|
|
26008
|
+
}
|
|
26009
|
+
return data;
|
|
26010
|
+
}
|
|
26011
|
+
}
|
|
26012
|
+
export class ResourceUtilizationDto {
|
|
26013
|
+
constructor(data) {
|
|
26014
|
+
if (data) {
|
|
26015
|
+
for (var property in data) {
|
|
26016
|
+
if (data.hasOwnProperty(property))
|
|
26017
|
+
this[property] = data[property];
|
|
26018
|
+
}
|
|
26019
|
+
}
|
|
26020
|
+
}
|
|
26021
|
+
init(_data) {
|
|
26022
|
+
if (_data) {
|
|
26023
|
+
this.assetId = _data["assetId"];
|
|
26024
|
+
this.name = _data["name"];
|
|
26025
|
+
this.description = _data["description"];
|
|
26026
|
+
this.state = _data["state"];
|
|
26027
|
+
this.machineState = _data["machineState"];
|
|
26028
|
+
this.startTime = _data["startTime"] ? new Date(_data["startTime"].toString()) : undefined;
|
|
26029
|
+
this.workorder = _data["workorder"] ? UtilizationWorkorderDto.fromJS(_data["workorder"]) : undefined;
|
|
26030
|
+
this.powerOn = _data["powerOn"] ? PowerOnUtilizationDto.fromJS(_data["powerOn"]) : undefined;
|
|
26031
|
+
}
|
|
26032
|
+
}
|
|
26033
|
+
static fromJS(data) {
|
|
26034
|
+
data = typeof data === 'object' ? data : {};
|
|
26035
|
+
let result = new ResourceUtilizationDto();
|
|
26036
|
+
result.init(data);
|
|
26037
|
+
return result;
|
|
26038
|
+
}
|
|
26039
|
+
toJSON(data) {
|
|
26040
|
+
data = typeof data === 'object' ? data : {};
|
|
26041
|
+
data["assetId"] = this.assetId;
|
|
26042
|
+
data["name"] = this.name;
|
|
26043
|
+
data["description"] = this.description;
|
|
26044
|
+
data["state"] = this.state;
|
|
26045
|
+
data["machineState"] = this.machineState;
|
|
26046
|
+
data["startTime"] = this.startTime ? this.startTime.toISOString() : undefined;
|
|
26047
|
+
data["workorder"] = this.workorder ? this.workorder.toJSON() : undefined;
|
|
26048
|
+
data["powerOn"] = this.powerOn ? this.powerOn.toJSON() : undefined;
|
|
26049
|
+
return data;
|
|
26050
|
+
}
|
|
26051
|
+
}
|
|
26052
|
+
export class ResourceUtilizationDetailsDto {
|
|
26053
|
+
constructor(data) {
|
|
26054
|
+
if (data) {
|
|
26055
|
+
for (var property in data) {
|
|
26056
|
+
if (data.hasOwnProperty(property))
|
|
26057
|
+
this[property] = data[property];
|
|
26058
|
+
}
|
|
26059
|
+
}
|
|
26060
|
+
}
|
|
26061
|
+
init(_data) {
|
|
26062
|
+
if (_data) {
|
|
26063
|
+
this.resourceId = _data["resourceId"];
|
|
26064
|
+
this.resourceName = _data["resourceName"];
|
|
26065
|
+
this.machineStateText = _data["machineStateText"];
|
|
26066
|
+
this.machineState = _data["machineState"];
|
|
26067
|
+
this.startTime = _data["startTime"] ? new Date(_data["startTime"].toString()) : undefined;
|
|
26068
|
+
this.powerOnUtilization = _data["powerOnUtilization"];
|
|
26069
|
+
}
|
|
26070
|
+
}
|
|
26071
|
+
static fromJS(data) {
|
|
26072
|
+
data = typeof data === 'object' ? data : {};
|
|
26073
|
+
let result = new ResourceUtilizationDetailsDto();
|
|
26074
|
+
result.init(data);
|
|
26075
|
+
return result;
|
|
26076
|
+
}
|
|
26077
|
+
toJSON(data) {
|
|
26078
|
+
data = typeof data === 'object' ? data : {};
|
|
26079
|
+
data["resourceId"] = this.resourceId;
|
|
26080
|
+
data["resourceName"] = this.resourceName;
|
|
26081
|
+
data["machineStateText"] = this.machineStateText;
|
|
26082
|
+
data["machineState"] = this.machineState;
|
|
26083
|
+
data["startTime"] = this.startTime ? this.startTime.toISOString() : undefined;
|
|
26084
|
+
data["powerOnUtilization"] = this.powerOnUtilization;
|
|
26085
|
+
return data;
|
|
26086
|
+
}
|
|
26087
|
+
}
|
|
26088
|
+
export class ListResourceUptimesTodayRequest {
|
|
26089
|
+
constructor(data) {
|
|
26090
|
+
if (data) {
|
|
26091
|
+
for (var property in data) {
|
|
26092
|
+
if (data.hasOwnProperty(property))
|
|
26093
|
+
this[property] = data[property];
|
|
26094
|
+
}
|
|
26095
|
+
}
|
|
26096
|
+
}
|
|
26097
|
+
init(_data) {
|
|
26098
|
+
if (_data) {
|
|
26099
|
+
if (Array.isArray(_data["resourceExternalIds"])) {
|
|
26100
|
+
this.resourceExternalIds = [];
|
|
26101
|
+
for (let item of _data["resourceExternalIds"])
|
|
26102
|
+
this.resourceExternalIds.push(item);
|
|
26103
|
+
}
|
|
26104
|
+
this.utcOffset = _data["utcOffset"];
|
|
26105
|
+
}
|
|
26106
|
+
}
|
|
26107
|
+
static fromJS(data) {
|
|
26108
|
+
data = typeof data === 'object' ? data : {};
|
|
26109
|
+
let result = new ListResourceUptimesTodayRequest();
|
|
26110
|
+
result.init(data);
|
|
26111
|
+
return result;
|
|
26112
|
+
}
|
|
26113
|
+
toJSON(data) {
|
|
26114
|
+
data = typeof data === 'object' ? data : {};
|
|
26115
|
+
if (Array.isArray(this.resourceExternalIds)) {
|
|
26116
|
+
data["resourceExternalIds"] = [];
|
|
26117
|
+
for (let item of this.resourceExternalIds)
|
|
26118
|
+
data["resourceExternalIds"].push(item);
|
|
26119
|
+
}
|
|
26120
|
+
data["utcOffset"] = this.utcOffset;
|
|
26121
|
+
return data;
|
|
26122
|
+
}
|
|
26123
|
+
}
|
|
25508
26124
|
export class UserAppDto {
|
|
25509
26125
|
constructor(data) {
|
|
25510
26126
|
if (data) {
|
|
@@ -41633,6 +42249,7 @@ export class ProductionOrderDto {
|
|
|
41633
42249
|
}
|
|
41634
42250
|
this.startDate = _data["startDate"] ? new Date(_data["startDate"].toString()) : undefined;
|
|
41635
42251
|
this.endDate = _data["endDate"] ? new Date(_data["endDate"].toString()) : undefined;
|
|
42252
|
+
this.deliveryDate = _data["deliveryDate"] ? new Date(_data["deliveryDate"].toString()) : undefined;
|
|
41636
42253
|
this.bomPosition = _data["bomPosition"];
|
|
41637
42254
|
this.drawing = _data["drawing"] ? DrawingDto.fromJS(_data["drawing"]) : undefined;
|
|
41638
42255
|
this.orderReference = _data["orderReference"] ? OrderReferenceDto.fromJS(_data["orderReference"]) : undefined;
|
|
@@ -41672,6 +42289,7 @@ export class ProductionOrderDto {
|
|
|
41672
42289
|
}
|
|
41673
42290
|
data["startDate"] = this.startDate ? this.startDate.toISOString() : undefined;
|
|
41674
42291
|
data["endDate"] = this.endDate ? this.endDate.toISOString() : undefined;
|
|
42292
|
+
data["deliveryDate"] = this.deliveryDate ? this.deliveryDate.toISOString() : undefined;
|
|
41675
42293
|
data["bomPosition"] = this.bomPosition;
|
|
41676
42294
|
data["drawing"] = this.drawing ? this.drawing.toJSON() : undefined;
|
|
41677
42295
|
data["orderReference"] = this.orderReference ? this.orderReference.toJSON() : undefined;
|
|
@@ -46859,6 +47477,36 @@ export class MeasurementFormInstanceFeedbackDto {
|
|
|
46859
47477
|
return data;
|
|
46860
47478
|
}
|
|
46861
47479
|
}
|
|
47480
|
+
export class CompleteMeasurementFormInstanceResult {
|
|
47481
|
+
constructor(data) {
|
|
47482
|
+
if (data) {
|
|
47483
|
+
for (var property in data) {
|
|
47484
|
+
if (data.hasOwnProperty(property))
|
|
47485
|
+
this[property] = data[property];
|
|
47486
|
+
}
|
|
47487
|
+
}
|
|
47488
|
+
}
|
|
47489
|
+
init(_data) {
|
|
47490
|
+
if (_data) {
|
|
47491
|
+
this.hasWarning = _data["hasWarning"];
|
|
47492
|
+
this.warningMessage = _data["warningMessage"];
|
|
47493
|
+
this.result = _data["result"] ? MeasurementFormInstanceDto.fromJS(_data["result"]) : undefined;
|
|
47494
|
+
}
|
|
47495
|
+
}
|
|
47496
|
+
static fromJS(data) {
|
|
47497
|
+
data = typeof data === 'object' ? data : {};
|
|
47498
|
+
let result = new CompleteMeasurementFormInstanceResult();
|
|
47499
|
+
result.init(data);
|
|
47500
|
+
return result;
|
|
47501
|
+
}
|
|
47502
|
+
toJSON(data) {
|
|
47503
|
+
data = typeof data === 'object' ? data : {};
|
|
47504
|
+
data["hasWarning"] = this.hasWarning;
|
|
47505
|
+
data["warningMessage"] = this.warningMessage;
|
|
47506
|
+
data["result"] = this.result ? this.result.toJSON() : undefined;
|
|
47507
|
+
return data;
|
|
47508
|
+
}
|
|
47509
|
+
}
|
|
46862
47510
|
export class MeasurementFormInstanceSchemaDto {
|
|
46863
47511
|
constructor(data) {
|
|
46864
47512
|
if (data) {
|