@ignos/api-client 20250130.0.11051 → 20250203.0.11064

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.
@@ -808,6 +808,7 @@ export declare class KpiAdminClient extends AuthorizedApiBase implements IKpiAdm
808
808
  }
809
809
  export interface IKpiClient {
810
810
  getMachineKpi(machineExternalId: string | undefined, startDate: Date | undefined, endDate: Date | undefined): Promise<MachineKpiDto[]>;
811
+ getMachineDailyUptime(machineExternalId: string | undefined, date: Date | undefined): Promise<MachineDailyUptimeDto>;
811
812
  }
812
813
  export declare class KpiClient extends AuthorizedApiBase implements IKpiClient {
813
814
  private http;
@@ -818,6 +819,8 @@ export declare class KpiClient extends AuthorizedApiBase implements IKpiClient {
818
819
  });
819
820
  getMachineKpi(machineExternalId: string | undefined, startDate: Date | undefined, endDate: Date | undefined): Promise<MachineKpiDto[]>;
820
821
  protected processGetMachineKpi(response: Response): Promise<MachineKpiDto[]>;
822
+ getMachineDailyUptime(machineExternalId: string | undefined, date: Date | undefined): Promise<MachineDailyUptimeDto>;
823
+ protected processGetMachineDailyUptime(response: Response): Promise<MachineDailyUptimeDto>;
821
824
  }
822
825
  export interface IMachinesClient {
823
826
  listMachines(onlyConnectedMachines: boolean | undefined): Promise<MachineDto[]>;
@@ -5616,8 +5619,8 @@ export interface IUpdateCalenderCapacity {
5616
5619
  }
5617
5620
  export declare class MachineKpiDto implements IMachineKpiDto {
5618
5621
  date?: Date;
5619
- hoursCapacity?: number;
5620
5622
  uptime?: number;
5623
+ capacity?: number;
5621
5624
  utilizationGoal?: number;
5622
5625
  constructor(data?: IMachineKpiDto);
5623
5626
  init(_data?: any): void;
@@ -5626,10 +5629,36 @@ export declare class MachineKpiDto implements IMachineKpiDto {
5626
5629
  }
5627
5630
  export interface IMachineKpiDto {
5628
5631
  date?: Date;
5629
- hoursCapacity?: number;
5630
5632
  uptime?: number;
5633
+ capacity?: number;
5631
5634
  utilizationGoal?: number;
5632
5635
  }
5636
+ export declare class MachineDailyUptimeDto implements IMachineDailyUptimeDto {
5637
+ date?: Date;
5638
+ historicUptimeDataPoints?: MachineDailyUptimePointDto[] | null;
5639
+ todayUptimeDataPoints?: MachineDailyUptimePointDto[] | null;
5640
+ constructor(data?: IMachineDailyUptimeDto);
5641
+ init(_data?: any): void;
5642
+ static fromJS(data: any): MachineDailyUptimeDto;
5643
+ toJSON(data?: any): any;
5644
+ }
5645
+ export interface IMachineDailyUptimeDto {
5646
+ date?: Date;
5647
+ historicUptimeDataPoints?: MachineDailyUptimePointDto[] | null;
5648
+ todayUptimeDataPoints?: MachineDailyUptimePointDto[] | null;
5649
+ }
5650
+ export declare class MachineDailyUptimePointDto implements IMachineDailyUptimePointDto {
5651
+ date?: Date;
5652
+ uptime?: number;
5653
+ constructor(data?: IMachineDailyUptimePointDto);
5654
+ init(_data?: any): void;
5655
+ static fromJS(data: any): MachineDailyUptimePointDto;
5656
+ toJSON(data?: any): any;
5657
+ }
5658
+ export interface IMachineDailyUptimePointDto {
5659
+ date?: Date;
5660
+ uptime?: number;
5661
+ }
5633
5662
  export declare class MachineDto implements IMachineDto {
5634
5663
  id: number;
5635
5664
  externalId: string;
@@ -6170,6 +6170,51 @@ export class KpiClient extends AuthorizedApiBase {
6170
6170
  }
6171
6171
  return Promise.resolve(null);
6172
6172
  }
6173
+ getMachineDailyUptime(machineExternalId, date) {
6174
+ let url_ = this.baseUrl + "/kpi/daily-uptime?";
6175
+ if (machineExternalId === null)
6176
+ throw new Error("The parameter 'machineExternalId' cannot be null.");
6177
+ else if (machineExternalId !== undefined)
6178
+ url_ += "machineExternalId=" + encodeURIComponent("" + machineExternalId) + "&";
6179
+ if (date === null)
6180
+ throw new Error("The parameter 'date' cannot be null.");
6181
+ else if (date !== undefined)
6182
+ url_ += "date=" + encodeURIComponent(date ? "" + date.toISOString() : "") + "&";
6183
+ url_ = url_.replace(/[?&]$/, "");
6184
+ let options_ = {
6185
+ method: "GET",
6186
+ headers: {
6187
+ "Accept": "application/json"
6188
+ }
6189
+ };
6190
+ return this.transformOptions(options_).then(transformedOptions_ => {
6191
+ return this.http.fetch(url_, transformedOptions_);
6192
+ }).then((_response) => {
6193
+ return this.processGetMachineDailyUptime(_response);
6194
+ });
6195
+ }
6196
+ processGetMachineDailyUptime(response) {
6197
+ const status = response.status;
6198
+ let _headers = {};
6199
+ if (response.headers && response.headers.forEach) {
6200
+ response.headers.forEach((v, k) => _headers[k] = v);
6201
+ }
6202
+ ;
6203
+ if (status === 200) {
6204
+ return response.text().then((_responseText) => {
6205
+ let result200 = null;
6206
+ let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
6207
+ result200 = MachineDailyUptimeDto.fromJS(resultData200);
6208
+ return result200;
6209
+ });
6210
+ }
6211
+ else if (status !== 200 && status !== 204) {
6212
+ return response.text().then((_responseText) => {
6213
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
6214
+ });
6215
+ }
6216
+ return Promise.resolve(null);
6217
+ }
6173
6218
  }
6174
6219
  export class MachinesClient extends AuthorizedApiBase {
6175
6220
  constructor(configuration, baseUrl, http) {
@@ -27313,8 +27358,8 @@ export class MachineKpiDto {
27313
27358
  init(_data) {
27314
27359
  if (_data) {
27315
27360
  this.date = _data["date"] ? new Date(_data["date"].toString()) : undefined;
27316
- this.hoursCapacity = _data["hoursCapacity"];
27317
27361
  this.uptime = _data["uptime"];
27362
+ this.capacity = _data["capacity"];
27318
27363
  this.utilizationGoal = _data["utilizationGoal"];
27319
27364
  }
27320
27365
  }
@@ -27327,12 +27372,86 @@ export class MachineKpiDto {
27327
27372
  toJSON(data) {
27328
27373
  data = typeof data === 'object' ? data : {};
27329
27374
  data["date"] = this.date ? this.date.toISOString() : undefined;
27330
- data["hoursCapacity"] = this.hoursCapacity;
27331
27375
  data["uptime"] = this.uptime;
27376
+ data["capacity"] = this.capacity;
27332
27377
  data["utilizationGoal"] = this.utilizationGoal;
27333
27378
  return data;
27334
27379
  }
27335
27380
  }
27381
+ export class MachineDailyUptimeDto {
27382
+ constructor(data) {
27383
+ if (data) {
27384
+ for (var property in data) {
27385
+ if (data.hasOwnProperty(property))
27386
+ this[property] = data[property];
27387
+ }
27388
+ }
27389
+ }
27390
+ init(_data) {
27391
+ if (_data) {
27392
+ this.date = _data["date"] ? new Date(_data["date"].toString()) : undefined;
27393
+ if (Array.isArray(_data["historicUptimeDataPoints"])) {
27394
+ this.historicUptimeDataPoints = [];
27395
+ for (let item of _data["historicUptimeDataPoints"])
27396
+ this.historicUptimeDataPoints.push(MachineDailyUptimePointDto.fromJS(item));
27397
+ }
27398
+ if (Array.isArray(_data["todayUptimeDataPoints"])) {
27399
+ this.todayUptimeDataPoints = [];
27400
+ for (let item of _data["todayUptimeDataPoints"])
27401
+ this.todayUptimeDataPoints.push(MachineDailyUptimePointDto.fromJS(item));
27402
+ }
27403
+ }
27404
+ }
27405
+ static fromJS(data) {
27406
+ data = typeof data === 'object' ? data : {};
27407
+ let result = new MachineDailyUptimeDto();
27408
+ result.init(data);
27409
+ return result;
27410
+ }
27411
+ toJSON(data) {
27412
+ data = typeof data === 'object' ? data : {};
27413
+ data["date"] = this.date ? this.date.toISOString() : undefined;
27414
+ if (Array.isArray(this.historicUptimeDataPoints)) {
27415
+ data["historicUptimeDataPoints"] = [];
27416
+ for (let item of this.historicUptimeDataPoints)
27417
+ data["historicUptimeDataPoints"].push(item.toJSON());
27418
+ }
27419
+ if (Array.isArray(this.todayUptimeDataPoints)) {
27420
+ data["todayUptimeDataPoints"] = [];
27421
+ for (let item of this.todayUptimeDataPoints)
27422
+ data["todayUptimeDataPoints"].push(item.toJSON());
27423
+ }
27424
+ return data;
27425
+ }
27426
+ }
27427
+ export class MachineDailyUptimePointDto {
27428
+ constructor(data) {
27429
+ if (data) {
27430
+ for (var property in data) {
27431
+ if (data.hasOwnProperty(property))
27432
+ this[property] = data[property];
27433
+ }
27434
+ }
27435
+ }
27436
+ init(_data) {
27437
+ if (_data) {
27438
+ this.date = _data["date"] ? new Date(_data["date"].toString()) : undefined;
27439
+ this.uptime = _data["uptime"];
27440
+ }
27441
+ }
27442
+ static fromJS(data) {
27443
+ data = typeof data === 'object' ? data : {};
27444
+ let result = new MachineDailyUptimePointDto();
27445
+ result.init(data);
27446
+ return result;
27447
+ }
27448
+ toJSON(data) {
27449
+ data = typeof data === 'object' ? data : {};
27450
+ data["date"] = this.date ? this.date.toISOString() : undefined;
27451
+ data["uptime"] = this.uptime;
27452
+ return data;
27453
+ }
27454
+ }
27336
27455
  export class MachineDto {
27337
27456
  constructor(data) {
27338
27457
  if (data) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ignos/api-client",
3
- "version": "20250130.0.11051",
3
+ "version": "20250203.0.11064",
4
4
  "description": "IGNOS API Client",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -6561,6 +6561,8 @@ export class KpiAdminClient extends AuthorizedApiBase implements IKpiAdminClient
6561
6561
  export interface IKpiClient {
6562
6562
 
6563
6563
  getMachineKpi(machineExternalId: string | undefined, startDate: Date | undefined, endDate: Date | undefined): Promise<MachineKpiDto[]>;
6564
+
6565
+ getMachineDailyUptime(machineExternalId: string | undefined, date: Date | undefined): Promise<MachineDailyUptimeDto>;
6564
6566
  }
6565
6567
 
6566
6568
  export class KpiClient extends AuthorizedApiBase implements IKpiClient {
@@ -6625,6 +6627,50 @@ export class KpiClient extends AuthorizedApiBase implements IKpiClient {
6625
6627
  }
6626
6628
  return Promise.resolve<MachineKpiDto[]>(null as any);
6627
6629
  }
6630
+
6631
+ getMachineDailyUptime(machineExternalId: string | undefined, date: Date | undefined): Promise<MachineDailyUptimeDto> {
6632
+ let url_ = this.baseUrl + "/kpi/daily-uptime?";
6633
+ if (machineExternalId === null)
6634
+ throw new Error("The parameter 'machineExternalId' cannot be null.");
6635
+ else if (machineExternalId !== undefined)
6636
+ url_ += "machineExternalId=" + encodeURIComponent("" + machineExternalId) + "&";
6637
+ if (date === null)
6638
+ throw new Error("The parameter 'date' cannot be null.");
6639
+ else if (date !== undefined)
6640
+ url_ += "date=" + encodeURIComponent(date ? "" + date.toISOString() : "") + "&";
6641
+ url_ = url_.replace(/[?&]$/, "");
6642
+
6643
+ let options_: RequestInit = {
6644
+ method: "GET",
6645
+ headers: {
6646
+ "Accept": "application/json"
6647
+ }
6648
+ };
6649
+
6650
+ return this.transformOptions(options_).then(transformedOptions_ => {
6651
+ return this.http.fetch(url_, transformedOptions_);
6652
+ }).then((_response: Response) => {
6653
+ return this.processGetMachineDailyUptime(_response);
6654
+ });
6655
+ }
6656
+
6657
+ protected processGetMachineDailyUptime(response: Response): Promise<MachineDailyUptimeDto> {
6658
+ const status = response.status;
6659
+ let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
6660
+ if (status === 200) {
6661
+ return response.text().then((_responseText) => {
6662
+ let result200: any = null;
6663
+ let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
6664
+ result200 = MachineDailyUptimeDto.fromJS(resultData200);
6665
+ return result200;
6666
+ });
6667
+ } else if (status !== 200 && status !== 204) {
6668
+ return response.text().then((_responseText) => {
6669
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
6670
+ });
6671
+ }
6672
+ return Promise.resolve<MachineDailyUptimeDto>(null as any);
6673
+ }
6628
6674
  }
6629
6675
 
6630
6676
  export interface IMachinesClient {
@@ -31822,8 +31868,8 @@ export interface IUpdateCalenderCapacity {
31822
31868
 
31823
31869
  export class MachineKpiDto implements IMachineKpiDto {
31824
31870
  date?: Date;
31825
- hoursCapacity?: number;
31826
31871
  uptime?: number;
31872
+ capacity?: number;
31827
31873
  utilizationGoal?: number;
31828
31874
 
31829
31875
  constructor(data?: IMachineKpiDto) {
@@ -31838,8 +31884,8 @@ export class MachineKpiDto implements IMachineKpiDto {
31838
31884
  init(_data?: any) {
31839
31885
  if (_data) {
31840
31886
  this.date = _data["date"] ? new Date(_data["date"].toString()) : <any>undefined;
31841
- this.hoursCapacity = _data["hoursCapacity"];
31842
31887
  this.uptime = _data["uptime"];
31888
+ this.capacity = _data["capacity"];
31843
31889
  this.utilizationGoal = _data["utilizationGoal"];
31844
31890
  }
31845
31891
  }
@@ -31854,8 +31900,8 @@ export class MachineKpiDto implements IMachineKpiDto {
31854
31900
  toJSON(data?: any) {
31855
31901
  data = typeof data === 'object' ? data : {};
31856
31902
  data["date"] = this.date ? this.date.toISOString() : <any>undefined;
31857
- data["hoursCapacity"] = this.hoursCapacity;
31858
31903
  data["uptime"] = this.uptime;
31904
+ data["capacity"] = this.capacity;
31859
31905
  data["utilizationGoal"] = this.utilizationGoal;
31860
31906
  return data;
31861
31907
  }
@@ -31863,11 +31909,111 @@ export class MachineKpiDto implements IMachineKpiDto {
31863
31909
 
31864
31910
  export interface IMachineKpiDto {
31865
31911
  date?: Date;
31866
- hoursCapacity?: number;
31867
31912
  uptime?: number;
31913
+ capacity?: number;
31868
31914
  utilizationGoal?: number;
31869
31915
  }
31870
31916
 
31917
+ export class MachineDailyUptimeDto implements IMachineDailyUptimeDto {
31918
+ date?: Date;
31919
+ historicUptimeDataPoints?: MachineDailyUptimePointDto[] | null;
31920
+ todayUptimeDataPoints?: MachineDailyUptimePointDto[] | null;
31921
+
31922
+ constructor(data?: IMachineDailyUptimeDto) {
31923
+ if (data) {
31924
+ for (var property in data) {
31925
+ if (data.hasOwnProperty(property))
31926
+ (<any>this)[property] = (<any>data)[property];
31927
+ }
31928
+ }
31929
+ }
31930
+
31931
+ init(_data?: any) {
31932
+ if (_data) {
31933
+ this.date = _data["date"] ? new Date(_data["date"].toString()) : <any>undefined;
31934
+ if (Array.isArray(_data["historicUptimeDataPoints"])) {
31935
+ this.historicUptimeDataPoints = [] as any;
31936
+ for (let item of _data["historicUptimeDataPoints"])
31937
+ this.historicUptimeDataPoints!.push(MachineDailyUptimePointDto.fromJS(item));
31938
+ }
31939
+ if (Array.isArray(_data["todayUptimeDataPoints"])) {
31940
+ this.todayUptimeDataPoints = [] as any;
31941
+ for (let item of _data["todayUptimeDataPoints"])
31942
+ this.todayUptimeDataPoints!.push(MachineDailyUptimePointDto.fromJS(item));
31943
+ }
31944
+ }
31945
+ }
31946
+
31947
+ static fromJS(data: any): MachineDailyUptimeDto {
31948
+ data = typeof data === 'object' ? data : {};
31949
+ let result = new MachineDailyUptimeDto();
31950
+ result.init(data);
31951
+ return result;
31952
+ }
31953
+
31954
+ toJSON(data?: any) {
31955
+ data = typeof data === 'object' ? data : {};
31956
+ data["date"] = this.date ? this.date.toISOString() : <any>undefined;
31957
+ if (Array.isArray(this.historicUptimeDataPoints)) {
31958
+ data["historicUptimeDataPoints"] = [];
31959
+ for (let item of this.historicUptimeDataPoints)
31960
+ data["historicUptimeDataPoints"].push(item.toJSON());
31961
+ }
31962
+ if (Array.isArray(this.todayUptimeDataPoints)) {
31963
+ data["todayUptimeDataPoints"] = [];
31964
+ for (let item of this.todayUptimeDataPoints)
31965
+ data["todayUptimeDataPoints"].push(item.toJSON());
31966
+ }
31967
+ return data;
31968
+ }
31969
+ }
31970
+
31971
+ export interface IMachineDailyUptimeDto {
31972
+ date?: Date;
31973
+ historicUptimeDataPoints?: MachineDailyUptimePointDto[] | null;
31974
+ todayUptimeDataPoints?: MachineDailyUptimePointDto[] | null;
31975
+ }
31976
+
31977
+ export class MachineDailyUptimePointDto implements IMachineDailyUptimePointDto {
31978
+ date?: Date;
31979
+ uptime?: number;
31980
+
31981
+ constructor(data?: IMachineDailyUptimePointDto) {
31982
+ if (data) {
31983
+ for (var property in data) {
31984
+ if (data.hasOwnProperty(property))
31985
+ (<any>this)[property] = (<any>data)[property];
31986
+ }
31987
+ }
31988
+ }
31989
+
31990
+ init(_data?: any) {
31991
+ if (_data) {
31992
+ this.date = _data["date"] ? new Date(_data["date"].toString()) : <any>undefined;
31993
+ this.uptime = _data["uptime"];
31994
+ }
31995
+ }
31996
+
31997
+ static fromJS(data: any): MachineDailyUptimePointDto {
31998
+ data = typeof data === 'object' ? data : {};
31999
+ let result = new MachineDailyUptimePointDto();
32000
+ result.init(data);
32001
+ return result;
32002
+ }
32003
+
32004
+ toJSON(data?: any) {
32005
+ data = typeof data === 'object' ? data : {};
32006
+ data["date"] = this.date ? this.date.toISOString() : <any>undefined;
32007
+ data["uptime"] = this.uptime;
32008
+ return data;
32009
+ }
32010
+ }
32011
+
32012
+ export interface IMachineDailyUptimePointDto {
32013
+ date?: Date;
32014
+ uptime?: number;
32015
+ }
32016
+
31871
32017
  export class MachineDto implements IMachineDto {
31872
32018
  id!: number;
31873
32019
  externalId!: string;