@ignos/api-client 20250226.0.11262 → 20250227.0.11278-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 +15 -0
- package/lib/ignosportal-api.js +77 -0
- package/package.json +1 -1
- package/src/ignosportal-api.ts +90 -0
package/lib/ignosportal-api.d.ts
CHANGED
|
@@ -809,6 +809,7 @@ export declare class KpiAdminClient extends AuthorizedApiBase implements IKpiAdm
|
|
|
809
809
|
export interface IKpiClient {
|
|
810
810
|
getMachineKpi(machineExternalId: string | undefined, previousPeriodStartDate: Date | undefined, startDate: Date | undefined, endDate: Date | undefined, utcOffset: number | undefined): Promise<MachineKpiDto>;
|
|
811
811
|
getMachineDailyUptime(machineExternalId: string | undefined, date: Date | undefined, utcOffset: number | undefined): Promise<MachineDailyUptimeDto>;
|
|
812
|
+
getUptimeNormalTrend(assetId: number | null | undefined, assetExternalId: string | null | undefined, date: Date | null | undefined, utcOffset: number | null | undefined): Promise<UptimeTrendDataPointDto[]>;
|
|
812
813
|
}
|
|
813
814
|
export declare class KpiClient extends AuthorizedApiBase implements IKpiClient {
|
|
814
815
|
private http;
|
|
@@ -821,6 +822,8 @@ export declare class KpiClient extends AuthorizedApiBase implements IKpiClient {
|
|
|
821
822
|
protected processGetMachineKpi(response: Response): Promise<MachineKpiDto>;
|
|
822
823
|
getMachineDailyUptime(machineExternalId: string | undefined, date: Date | undefined, utcOffset: number | undefined): Promise<MachineDailyUptimeDto>;
|
|
823
824
|
protected processGetMachineDailyUptime(response: Response): Promise<MachineDailyUptimeDto>;
|
|
825
|
+
getUptimeNormalTrend(assetId: number | null | undefined, assetExternalId: string | null | undefined, date: Date | null | undefined, utcOffset: number | null | undefined): Promise<UptimeTrendDataPointDto[]>;
|
|
826
|
+
protected processGetUptimeNormalTrend(response: Response): Promise<UptimeTrendDataPointDto[]>;
|
|
824
827
|
}
|
|
825
828
|
export interface IMachinesClient {
|
|
826
829
|
listMachines(onlyConnectedMachines: boolean | undefined): Promise<MachineDto[]>;
|
|
@@ -5723,6 +5726,18 @@ export interface IMachineDailyUptimePointDto {
|
|
|
5723
5726
|
date?: Date;
|
|
5724
5727
|
uptime?: number;
|
|
5725
5728
|
}
|
|
5729
|
+
export declare class UptimeTrendDataPointDto implements IUptimeTrendDataPointDto {
|
|
5730
|
+
timestamp: Date;
|
|
5731
|
+
uptime: number;
|
|
5732
|
+
constructor(data?: IUptimeTrendDataPointDto);
|
|
5733
|
+
init(_data?: any): void;
|
|
5734
|
+
static fromJS(data: any): UptimeTrendDataPointDto;
|
|
5735
|
+
toJSON(data?: any): any;
|
|
5736
|
+
}
|
|
5737
|
+
export interface IUptimeTrendDataPointDto {
|
|
5738
|
+
timestamp: Date;
|
|
5739
|
+
uptime: number;
|
|
5740
|
+
}
|
|
5726
5741
|
export declare class MachineDto implements IMachineDto {
|
|
5727
5742
|
id: number;
|
|
5728
5743
|
externalId: string;
|
package/lib/ignosportal-api.js
CHANGED
|
@@ -6223,6 +6223,55 @@ export class KpiClient extends AuthorizedApiBase {
|
|
|
6223
6223
|
}
|
|
6224
6224
|
return Promise.resolve(null);
|
|
6225
6225
|
}
|
|
6226
|
+
getUptimeNormalTrend(assetId, assetExternalId, date, utcOffset) {
|
|
6227
|
+
let url_ = this.baseUrl + "/kpi/normal-day-trendline?";
|
|
6228
|
+
if (assetId !== undefined && assetId !== null)
|
|
6229
|
+
url_ += "assetId=" + encodeURIComponent("" + assetId) + "&";
|
|
6230
|
+
if (assetExternalId !== undefined && assetExternalId !== null)
|
|
6231
|
+
url_ += "assetExternalId=" + encodeURIComponent("" + assetExternalId) + "&";
|
|
6232
|
+
if (date !== undefined && date !== null)
|
|
6233
|
+
url_ += "date=" + encodeURIComponent(date ? "" + date.toISOString() : "") + "&";
|
|
6234
|
+
if (utcOffset !== undefined && utcOffset !== null)
|
|
6235
|
+
url_ += "utcOffset=" + encodeURIComponent("" + utcOffset) + "&";
|
|
6236
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
6237
|
+
let options_ = {
|
|
6238
|
+
method: "GET",
|
|
6239
|
+
headers: {
|
|
6240
|
+
"Accept": "application/json"
|
|
6241
|
+
}
|
|
6242
|
+
};
|
|
6243
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
6244
|
+
return this.http.fetch(url_, transformedOptions_);
|
|
6245
|
+
}).then((_response) => {
|
|
6246
|
+
return this.processGetUptimeNormalTrend(_response);
|
|
6247
|
+
});
|
|
6248
|
+
}
|
|
6249
|
+
processGetUptimeNormalTrend(response) {
|
|
6250
|
+
const status = response.status;
|
|
6251
|
+
let _headers = {};
|
|
6252
|
+
if (response.headers && response.headers.forEach) {
|
|
6253
|
+
response.headers.forEach((v, k) => _headers[k] = v);
|
|
6254
|
+
}
|
|
6255
|
+
;
|
|
6256
|
+
if (status === 200) {
|
|
6257
|
+
return response.text().then((_responseText) => {
|
|
6258
|
+
let result200 = null;
|
|
6259
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
6260
|
+
if (Array.isArray(resultData200)) {
|
|
6261
|
+
result200 = [];
|
|
6262
|
+
for (let item of resultData200)
|
|
6263
|
+
result200.push(UptimeTrendDataPointDto.fromJS(item));
|
|
6264
|
+
}
|
|
6265
|
+
return result200;
|
|
6266
|
+
});
|
|
6267
|
+
}
|
|
6268
|
+
else if (status !== 200 && status !== 204) {
|
|
6269
|
+
return response.text().then((_responseText) => {
|
|
6270
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
6271
|
+
});
|
|
6272
|
+
}
|
|
6273
|
+
return Promise.resolve(null);
|
|
6274
|
+
}
|
|
6226
6275
|
}
|
|
6227
6276
|
export class MachinesClient extends AuthorizedApiBase {
|
|
6228
6277
|
constructor(configuration, baseUrl, http) {
|
|
@@ -27622,6 +27671,34 @@ export class MachineDailyUptimePointDto {
|
|
|
27622
27671
|
return data;
|
|
27623
27672
|
}
|
|
27624
27673
|
}
|
|
27674
|
+
export class UptimeTrendDataPointDto {
|
|
27675
|
+
constructor(data) {
|
|
27676
|
+
if (data) {
|
|
27677
|
+
for (var property in data) {
|
|
27678
|
+
if (data.hasOwnProperty(property))
|
|
27679
|
+
this[property] = data[property];
|
|
27680
|
+
}
|
|
27681
|
+
}
|
|
27682
|
+
}
|
|
27683
|
+
init(_data) {
|
|
27684
|
+
if (_data) {
|
|
27685
|
+
this.timestamp = _data["timestamp"] ? new Date(_data["timestamp"].toString()) : undefined;
|
|
27686
|
+
this.uptime = _data["uptime"];
|
|
27687
|
+
}
|
|
27688
|
+
}
|
|
27689
|
+
static fromJS(data) {
|
|
27690
|
+
data = typeof data === 'object' ? data : {};
|
|
27691
|
+
let result = new UptimeTrendDataPointDto();
|
|
27692
|
+
result.init(data);
|
|
27693
|
+
return result;
|
|
27694
|
+
}
|
|
27695
|
+
toJSON(data) {
|
|
27696
|
+
data = typeof data === 'object' ? data : {};
|
|
27697
|
+
data["timestamp"] = this.timestamp ? this.timestamp.toISOString() : undefined;
|
|
27698
|
+
data["uptime"] = this.uptime;
|
|
27699
|
+
return data;
|
|
27700
|
+
}
|
|
27701
|
+
}
|
|
27625
27702
|
export class MachineDto {
|
|
27626
27703
|
constructor(data) {
|
|
27627
27704
|
if (data) {
|
package/package.json
CHANGED
package/src/ignosportal-api.ts
CHANGED
|
@@ -6563,6 +6563,8 @@ export interface IKpiClient {
|
|
|
6563
6563
|
getMachineKpi(machineExternalId: string | undefined, previousPeriodStartDate: Date | undefined, startDate: Date | undefined, endDate: Date | undefined, utcOffset: number | undefined): Promise<MachineKpiDto>;
|
|
6564
6564
|
|
|
6565
6565
|
getMachineDailyUptime(machineExternalId: string | undefined, date: Date | undefined, utcOffset: number | undefined): Promise<MachineDailyUptimeDto>;
|
|
6566
|
+
|
|
6567
|
+
getUptimeNormalTrend(assetId: number | null | undefined, assetExternalId: string | null | undefined, date: Date | null | undefined, utcOffset: number | null | undefined): Promise<UptimeTrendDataPointDto[]>;
|
|
6566
6568
|
}
|
|
6567
6569
|
|
|
6568
6570
|
export class KpiClient extends AuthorizedApiBase implements IKpiClient {
|
|
@@ -6679,6 +6681,54 @@ export class KpiClient extends AuthorizedApiBase implements IKpiClient {
|
|
|
6679
6681
|
}
|
|
6680
6682
|
return Promise.resolve<MachineDailyUptimeDto>(null as any);
|
|
6681
6683
|
}
|
|
6684
|
+
|
|
6685
|
+
getUptimeNormalTrend(assetId: number | null | undefined, assetExternalId: string | null | undefined, date: Date | null | undefined, utcOffset: number | null | undefined): Promise<UptimeTrendDataPointDto[]> {
|
|
6686
|
+
let url_ = this.baseUrl + "/kpi/normal-day-trendline?";
|
|
6687
|
+
if (assetId !== undefined && assetId !== null)
|
|
6688
|
+
url_ += "assetId=" + encodeURIComponent("" + assetId) + "&";
|
|
6689
|
+
if (assetExternalId !== undefined && assetExternalId !== null)
|
|
6690
|
+
url_ += "assetExternalId=" + encodeURIComponent("" + assetExternalId) + "&";
|
|
6691
|
+
if (date !== undefined && date !== null)
|
|
6692
|
+
url_ += "date=" + encodeURIComponent(date ? "" + date.toISOString() : "") + "&";
|
|
6693
|
+
if (utcOffset !== undefined && utcOffset !== null)
|
|
6694
|
+
url_ += "utcOffset=" + encodeURIComponent("" + utcOffset) + "&";
|
|
6695
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
6696
|
+
|
|
6697
|
+
let options_: RequestInit = {
|
|
6698
|
+
method: "GET",
|
|
6699
|
+
headers: {
|
|
6700
|
+
"Accept": "application/json"
|
|
6701
|
+
}
|
|
6702
|
+
};
|
|
6703
|
+
|
|
6704
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
6705
|
+
return this.http.fetch(url_, transformedOptions_);
|
|
6706
|
+
}).then((_response: Response) => {
|
|
6707
|
+
return this.processGetUptimeNormalTrend(_response);
|
|
6708
|
+
});
|
|
6709
|
+
}
|
|
6710
|
+
|
|
6711
|
+
protected processGetUptimeNormalTrend(response: Response): Promise<UptimeTrendDataPointDto[]> {
|
|
6712
|
+
const status = response.status;
|
|
6713
|
+
let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
|
|
6714
|
+
if (status === 200) {
|
|
6715
|
+
return response.text().then((_responseText) => {
|
|
6716
|
+
let result200: any = null;
|
|
6717
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
6718
|
+
if (Array.isArray(resultData200)) {
|
|
6719
|
+
result200 = [] as any;
|
|
6720
|
+
for (let item of resultData200)
|
|
6721
|
+
result200!.push(UptimeTrendDataPointDto.fromJS(item));
|
|
6722
|
+
}
|
|
6723
|
+
return result200;
|
|
6724
|
+
});
|
|
6725
|
+
} else if (status !== 200 && status !== 204) {
|
|
6726
|
+
return response.text().then((_responseText) => {
|
|
6727
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
6728
|
+
});
|
|
6729
|
+
}
|
|
6730
|
+
return Promise.resolve<UptimeTrendDataPointDto[]>(null as any);
|
|
6731
|
+
}
|
|
6682
6732
|
}
|
|
6683
6733
|
|
|
6684
6734
|
export interface IMachinesClient {
|
|
@@ -32247,6 +32297,46 @@ export interface IMachineDailyUptimePointDto {
|
|
|
32247
32297
|
uptime?: number;
|
|
32248
32298
|
}
|
|
32249
32299
|
|
|
32300
|
+
export class UptimeTrendDataPointDto implements IUptimeTrendDataPointDto {
|
|
32301
|
+
timestamp!: Date;
|
|
32302
|
+
uptime!: number;
|
|
32303
|
+
|
|
32304
|
+
constructor(data?: IUptimeTrendDataPointDto) {
|
|
32305
|
+
if (data) {
|
|
32306
|
+
for (var property in data) {
|
|
32307
|
+
if (data.hasOwnProperty(property))
|
|
32308
|
+
(<any>this)[property] = (<any>data)[property];
|
|
32309
|
+
}
|
|
32310
|
+
}
|
|
32311
|
+
}
|
|
32312
|
+
|
|
32313
|
+
init(_data?: any) {
|
|
32314
|
+
if (_data) {
|
|
32315
|
+
this.timestamp = _data["timestamp"] ? new Date(_data["timestamp"].toString()) : <any>undefined;
|
|
32316
|
+
this.uptime = _data["uptime"];
|
|
32317
|
+
}
|
|
32318
|
+
}
|
|
32319
|
+
|
|
32320
|
+
static fromJS(data: any): UptimeTrendDataPointDto {
|
|
32321
|
+
data = typeof data === 'object' ? data : {};
|
|
32322
|
+
let result = new UptimeTrendDataPointDto();
|
|
32323
|
+
result.init(data);
|
|
32324
|
+
return result;
|
|
32325
|
+
}
|
|
32326
|
+
|
|
32327
|
+
toJSON(data?: any) {
|
|
32328
|
+
data = typeof data === 'object' ? data : {};
|
|
32329
|
+
data["timestamp"] = this.timestamp ? this.timestamp.toISOString() : <any>undefined;
|
|
32330
|
+
data["uptime"] = this.uptime;
|
|
32331
|
+
return data;
|
|
32332
|
+
}
|
|
32333
|
+
}
|
|
32334
|
+
|
|
32335
|
+
export interface IUptimeTrendDataPointDto {
|
|
32336
|
+
timestamp: Date;
|
|
32337
|
+
uptime: number;
|
|
32338
|
+
}
|
|
32339
|
+
|
|
32250
32340
|
export class MachineDto implements IMachineDto {
|
|
32251
32341
|
id!: number;
|
|
32252
32342
|
externalId!: string;
|