@ignos/api-client 20250805.0.12279-alpha → 20250806.0.12288

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.
@@ -6909,6 +6909,54 @@ export class MachinesClient extends AuthorizedApiBase {
6909
6909
  }
6910
6910
  return Promise.resolve(null);
6911
6911
  }
6912
+ getWorkOrderTimeline(id, startTime, endTime) {
6913
+ let url_ = this.baseUrl + "/machines/{id}/workorder/timeline?";
6914
+ if (id === undefined || id === null)
6915
+ throw new Error("The parameter 'id' must be defined.");
6916
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
6917
+ if (startTime !== undefined && startTime !== null)
6918
+ url_ += "startTime=" + encodeURIComponent(startTime ? "" + startTime.toISOString() : "") + "&";
6919
+ if (endTime !== undefined && endTime !== null)
6920
+ url_ += "endTime=" + encodeURIComponent(endTime ? "" + endTime.toISOString() : "") + "&";
6921
+ url_ = url_.replace(/[?&]$/, "");
6922
+ let options_ = {
6923
+ method: "GET",
6924
+ headers: {
6925
+ "Accept": "application/json"
6926
+ }
6927
+ };
6928
+ return this.transformOptions(options_).then(transformedOptions_ => {
6929
+ return this.http.fetch(url_, transformedOptions_);
6930
+ }).then((_response) => {
6931
+ return this.processGetWorkOrderTimeline(_response);
6932
+ });
6933
+ }
6934
+ processGetWorkOrderTimeline(response) {
6935
+ const status = response.status;
6936
+ let _headers = {};
6937
+ if (response.headers && response.headers.forEach) {
6938
+ response.headers.forEach((v, k) => _headers[k] = v);
6939
+ }
6940
+ ;
6941
+ if (status === 200) {
6942
+ return response.text().then((_responseText) => {
6943
+ let result200 = null;
6944
+ let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
6945
+ if (Array.isArray(resultData200)) {
6946
+ result200 = [];
6947
+ for (let item of resultData200)
6948
+ result200.push(WorkOrderDatapoint.fromJS(item));
6949
+ }
6950
+ return result200;
6951
+ });
6952
+ }
6953
+ else if (status !== 200 && status !== 204) {
6954
+ return response.text().then((_responseText) => {
6955
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
6956
+ });
6957
+ }
6958
+ return Promise.resolve(null);
6959
+ }
6912
6960
  getMachineUtilizationSummary() {
6913
6961
  let url_ = this.baseUrl + "/machines/utilization/summary";
6914
6962
  url_ = url_.replace(/[?&]$/, "");
@@ -22722,277 +22770,6 @@ export class WorkordersClient extends AuthorizedApiBase {
22722
22770
  }
22723
22771
  return Promise.resolve(null);
22724
22772
  }
22725
- getDiscussionMessages(id) {
22726
- let url_ = this.baseUrl + "/erp/workorders/{id}/discussion";
22727
- if (id === undefined || id === null)
22728
- throw new Error("The parameter 'id' must be defined.");
22729
- url_ = url_.replace("{id}", encodeURIComponent("" + id));
22730
- url_ = url_.replace(/[?&]$/, "");
22731
- let options_ = {
22732
- method: "GET",
22733
- headers: {
22734
- "Accept": "application/json"
22735
- }
22736
- };
22737
- return this.transformOptions(options_).then(transformedOptions_ => {
22738
- return this.http.fetch(url_, transformedOptions_);
22739
- }).then((_response) => {
22740
- return this.processGetDiscussionMessages(_response);
22741
- });
22742
- }
22743
- processGetDiscussionMessages(response) {
22744
- const status = response.status;
22745
- let _headers = {};
22746
- if (response.headers && response.headers.forEach) {
22747
- response.headers.forEach((v, k) => _headers[k] = v);
22748
- }
22749
- ;
22750
- if (status === 200) {
22751
- return response.text().then((_responseText) => {
22752
- let result200 = null;
22753
- let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
22754
- if (Array.isArray(resultData200)) {
22755
- result200 = [];
22756
- for (let item of resultData200)
22757
- result200.push(WorkorderDiscussionMessageDto.fromJS(item));
22758
- }
22759
- return result200;
22760
- });
22761
- }
22762
- else if (status !== 200 && status !== 204) {
22763
- return response.text().then((_responseText) => {
22764
- return throwException("An unexpected server error occurred.", status, _responseText, _headers);
22765
- });
22766
- }
22767
- return Promise.resolve(null);
22768
- }
22769
- addDiscussionMessage(id, request) {
22770
- let url_ = this.baseUrl + "/erp/workorders/{id}/discussion";
22771
- if (id === undefined || id === null)
22772
- throw new Error("The parameter 'id' must be defined.");
22773
- url_ = url_.replace("{id}", encodeURIComponent("" + id));
22774
- url_ = url_.replace(/[?&]$/, "");
22775
- const content_ = JSON.stringify(request);
22776
- let options_ = {
22777
- body: content_,
22778
- method: "POST",
22779
- headers: {
22780
- "Content-Type": "application/json",
22781
- "Accept": "application/json"
22782
- }
22783
- };
22784
- return this.transformOptions(options_).then(transformedOptions_ => {
22785
- return this.http.fetch(url_, transformedOptions_);
22786
- }).then((_response) => {
22787
- return this.processAddDiscussionMessage(_response);
22788
- });
22789
- }
22790
- processAddDiscussionMessage(response) {
22791
- const status = response.status;
22792
- let _headers = {};
22793
- if (response.headers && response.headers.forEach) {
22794
- response.headers.forEach((v, k) => _headers[k] = v);
22795
- }
22796
- ;
22797
- if (status === 201) {
22798
- return response.text().then((_responseText) => {
22799
- let result201 = null;
22800
- let resultData201 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
22801
- result201 = WorkorderDiscussionMessageDto.fromJS(resultData201);
22802
- return result201;
22803
- });
22804
- }
22805
- else if (status !== 200 && status !== 204) {
22806
- return response.text().then((_responseText) => {
22807
- return throwException("An unexpected server error occurred.", status, _responseText, _headers);
22808
- });
22809
- }
22810
- return Promise.resolve(null);
22811
- }
22812
- updateMessage(id, messageId, content) {
22813
- let url_ = this.baseUrl + "/erp/workorders/{id}/discussion/{messageId}";
22814
- if (id === undefined || id === null)
22815
- throw new Error("The parameter 'id' must be defined.");
22816
- url_ = url_.replace("{id}", encodeURIComponent("" + id));
22817
- if (messageId === undefined || messageId === null)
22818
- throw new Error("The parameter 'messageId' must be defined.");
22819
- url_ = url_.replace("{messageId}", encodeURIComponent("" + messageId));
22820
- url_ = url_.replace(/[?&]$/, "");
22821
- const content_ = JSON.stringify(content);
22822
- let options_ = {
22823
- body: content_,
22824
- method: "PUT",
22825
- headers: {
22826
- "Content-Type": "application/json",
22827
- "Accept": "application/octet-stream"
22828
- }
22829
- };
22830
- return this.transformOptions(options_).then(transformedOptions_ => {
22831
- return this.http.fetch(url_, transformedOptions_);
22832
- }).then((_response) => {
22833
- return this.processUpdateMessage(_response);
22834
- });
22835
- }
22836
- processUpdateMessage(response) {
22837
- const status = response.status;
22838
- let _headers = {};
22839
- if (response.headers && response.headers.forEach) {
22840
- response.headers.forEach((v, k) => _headers[k] = v);
22841
- }
22842
- ;
22843
- if (status === 200 || status === 206) {
22844
- const contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined;
22845
- let fileNameMatch = contentDisposition ? /filename\*=(?:(\\?['"])(.*?)\1|(?:[^\s]+'.*?')?([^;\n]*))/g.exec(contentDisposition) : undefined;
22846
- let fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[3] || fileNameMatch[2] : undefined;
22847
- if (fileName) {
22848
- fileName = decodeURIComponent(fileName);
22849
- }
22850
- else {
22851
- fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
22852
- fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
22853
- }
22854
- return response.blob().then(blob => { return { fileName: fileName, data: blob, status: status, headers: _headers }; });
22855
- }
22856
- else if (status !== 200 && status !== 204) {
22857
- return response.text().then((_responseText) => {
22858
- return throwException("An unexpected server error occurred.", status, _responseText, _headers);
22859
- });
22860
- }
22861
- return Promise.resolve(null);
22862
- }
22863
- deleteMessage(id, messageId) {
22864
- let url_ = this.baseUrl + "/erp/workorders/{id}/discussion/{messageId}";
22865
- if (id === undefined || id === null)
22866
- throw new Error("The parameter 'id' must be defined.");
22867
- url_ = url_.replace("{id}", encodeURIComponent("" + id));
22868
- if (messageId === undefined || messageId === null)
22869
- throw new Error("The parameter 'messageId' must be defined.");
22870
- url_ = url_.replace("{messageId}", encodeURIComponent("" + messageId));
22871
- url_ = url_.replace(/[?&]$/, "");
22872
- let options_ = {
22873
- method: "DELETE",
22874
- headers: {
22875
- "Accept": "application/octet-stream"
22876
- }
22877
- };
22878
- return this.transformOptions(options_).then(transformedOptions_ => {
22879
- return this.http.fetch(url_, transformedOptions_);
22880
- }).then((_response) => {
22881
- return this.processDeleteMessage(_response);
22882
- });
22883
- }
22884
- processDeleteMessage(response) {
22885
- const status = response.status;
22886
- let _headers = {};
22887
- if (response.headers && response.headers.forEach) {
22888
- response.headers.forEach((v, k) => _headers[k] = v);
22889
- }
22890
- ;
22891
- if (status === 200 || status === 206) {
22892
- const contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined;
22893
- let fileNameMatch = contentDisposition ? /filename\*=(?:(\\?['"])(.*?)\1|(?:[^\s]+'.*?')?([^;\n]*))/g.exec(contentDisposition) : undefined;
22894
- let fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[3] || fileNameMatch[2] : undefined;
22895
- if (fileName) {
22896
- fileName = decodeURIComponent(fileName);
22897
- }
22898
- else {
22899
- fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
22900
- fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
22901
- }
22902
- return response.blob().then(blob => { return { fileName: fileName, data: blob, status: status, headers: _headers }; });
22903
- }
22904
- else if (status !== 200 && status !== 204) {
22905
- return response.text().then((_responseText) => {
22906
- return throwException("An unexpected server error occurred.", status, _responseText, _headers);
22907
- });
22908
- }
22909
- return Promise.resolve(null);
22910
- }
22911
- getLastRead(id, operationId, resourceId, userUpn) {
22912
- let url_ = this.baseUrl + "/erp/workorders/{id}/discussion/last-read?";
22913
- if (id === undefined || id === null)
22914
- throw new Error("The parameter 'id' must be defined.");
22915
- url_ = url_.replace("{id}", encodeURIComponent("" + id));
22916
- if (operationId !== undefined && operationId !== null)
22917
- url_ += "operationId=" + encodeURIComponent("" + operationId) + "&";
22918
- if (resourceId !== undefined && resourceId !== null)
22919
- url_ += "resourceId=" + encodeURIComponent("" + resourceId) + "&";
22920
- if (userUpn !== undefined && userUpn !== null)
22921
- url_ += "userUpn=" + encodeURIComponent("" + userUpn) + "&";
22922
- url_ = url_.replace(/[?&]$/, "");
22923
- let options_ = {
22924
- method: "GET",
22925
- headers: {
22926
- "Accept": "application/json"
22927
- }
22928
- };
22929
- return this.transformOptions(options_).then(transformedOptions_ => {
22930
- return this.http.fetch(url_, transformedOptions_);
22931
- }).then((_response) => {
22932
- return this.processGetLastRead(_response);
22933
- });
22934
- }
22935
- processGetLastRead(response) {
22936
- const status = response.status;
22937
- let _headers = {};
22938
- if (response.headers && response.headers.forEach) {
22939
- response.headers.forEach((v, k) => _headers[k] = v);
22940
- }
22941
- ;
22942
- if (status === 200) {
22943
- return response.text().then((_responseText) => {
22944
- let result200 = null;
22945
- let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
22946
- result200 = WorkorderDiscussionReadStatusDto.fromJS(resultData200);
22947
- return result200;
22948
- });
22949
- }
22950
- else if (status !== 200 && status !== 204) {
22951
- return response.text().then((_responseText) => {
22952
- return throwException("An unexpected server error occurred.", status, _responseText, _headers);
22953
- });
22954
- }
22955
- return Promise.resolve(null);
22956
- }
22957
- setLastRead(id, request) {
22958
- let url_ = this.baseUrl + "/erp/workorders/{id}/discussion/last-read";
22959
- if (id === undefined || id === null)
22960
- throw new Error("The parameter 'id' must be defined.");
22961
- url_ = url_.replace("{id}", encodeURIComponent("" + id));
22962
- url_ = url_.replace(/[?&]$/, "");
22963
- const content_ = JSON.stringify(request);
22964
- let options_ = {
22965
- body: content_,
22966
- method: "POST",
22967
- headers: {
22968
- "Content-Type": "application/json",
22969
- }
22970
- };
22971
- return this.transformOptions(options_).then(transformedOptions_ => {
22972
- return this.http.fetch(url_, transformedOptions_);
22973
- }).then((_response) => {
22974
- return this.processSetLastRead(_response);
22975
- });
22976
- }
22977
- processSetLastRead(response) {
22978
- const status = response.status;
22979
- let _headers = {};
22980
- if (response.headers && response.headers.forEach) {
22981
- response.headers.forEach((v, k) => _headers[k] = v);
22982
- }
22983
- ;
22984
- if (status === 204) {
22985
- return response.text().then((_responseText) => {
22986
- return;
22987
- });
22988
- }
22989
- else if (status !== 200 && status !== 204) {
22990
- return response.text().then((_responseText) => {
22991
- return throwException("An unexpected server error occurred.", status, _responseText, _headers);
22992
- });
22993
- }
22994
- return Promise.resolve(null);
22995
- }
22996
22773
  }
22997
22774
  export class AzureRegionDto {
22998
22775
  constructor(data) {
@@ -30620,6 +30397,56 @@ export class WorkOrderProjectDto {
30620
30397
  return data;
30621
30398
  }
30622
30399
  }
30400
+ export class WorkOrderDatapoint {
30401
+ constructor(data) {
30402
+ if (data) {
30403
+ for (var property in data) {
30404
+ if (data.hasOwnProperty(property))
30405
+ this[property] = data[property];
30406
+ }
30407
+ }
30408
+ }
30409
+ init(_data) {
30410
+ if (_data) {
30411
+ this.workOrder = _data["workOrder"];
30412
+ this.id = _data["id"];
30413
+ this.externalId = _data["externalId"];
30414
+ this.subType = _data["subType"];
30415
+ this.startTime = _data["startTime"];
30416
+ this.endTime = _data["endTime"];
30417
+ if (_data["metaData"]) {
30418
+ this.metaData = {};
30419
+ for (let key in _data["metaData"]) {
30420
+ if (_data["metaData"].hasOwnProperty(key))
30421
+ this.metaData[key] = _data["metaData"][key];
30422
+ }
30423
+ }
30424
+ }
30425
+ }
30426
+ static fromJS(data) {
30427
+ data = typeof data === 'object' ? data : {};
30428
+ let result = new WorkOrderDatapoint();
30429
+ result.init(data);
30430
+ return result;
30431
+ }
30432
+ toJSON(data) {
30433
+ data = typeof data === 'object' ? data : {};
30434
+ data["workOrder"] = this.workOrder;
30435
+ data["id"] = this.id;
30436
+ data["externalId"] = this.externalId;
30437
+ data["subType"] = this.subType;
30438
+ data["startTime"] = this.startTime;
30439
+ data["endTime"] = this.endTime;
30440
+ if (this.metaData) {
30441
+ data["metaData"] = {};
30442
+ for (let key in this.metaData) {
30443
+ if (this.metaData.hasOwnProperty(key))
30444
+ data["metaData"][key] = this.metaData[key];
30445
+ }
30446
+ }
30447
+ return data;
30448
+ }
30449
+ }
30623
30450
  export class UtilizationSummaryDto {
30624
30451
  constructor(data) {
30625
30452
  if (data) {
@@ -46868,154 +46695,6 @@ export class CreateWorkOrderMapping {
46868
46695
  return data;
46869
46696
  }
46870
46697
  }
46871
- export class WorkorderDiscussionMessageDto {
46872
- constructor(data) {
46873
- if (data) {
46874
- for (var property in data) {
46875
- if (data.hasOwnProperty(property))
46876
- this[property] = data[property];
46877
- }
46878
- }
46879
- }
46880
- init(_data) {
46881
- if (_data) {
46882
- this.id = _data["id"];
46883
- this.workorderId = _data["workorderId"];
46884
- this.companyId = _data["companyId"];
46885
- this.content = _data["content"];
46886
- this.senderUpn = _data["senderUpn"];
46887
- this.senderName = _data["senderName"];
46888
- this.operationId = _data["operationId"];
46889
- this.operationName = _data["operationName"];
46890
- this.resourceId = _data["resourceId"];
46891
- this.created = _data["created"] ? new Date(_data["created"].toString()) : undefined;
46892
- }
46893
- }
46894
- static fromJS(data) {
46895
- data = typeof data === 'object' ? data : {};
46896
- let result = new WorkorderDiscussionMessageDto();
46897
- result.init(data);
46898
- return result;
46899
- }
46900
- toJSON(data) {
46901
- data = typeof data === 'object' ? data : {};
46902
- data["id"] = this.id;
46903
- data["workorderId"] = this.workorderId;
46904
- data["companyId"] = this.companyId;
46905
- data["content"] = this.content;
46906
- data["senderUpn"] = this.senderUpn;
46907
- data["senderName"] = this.senderName;
46908
- data["operationId"] = this.operationId;
46909
- data["operationName"] = this.operationName;
46910
- data["resourceId"] = this.resourceId;
46911
- data["created"] = this.created ? this.created.toISOString() : undefined;
46912
- return data;
46913
- }
46914
- }
46915
- export class AddDiscussionMessageRequest {
46916
- constructor(data) {
46917
- if (data) {
46918
- for (var property in data) {
46919
- if (data.hasOwnProperty(property))
46920
- this[property] = data[property];
46921
- }
46922
- }
46923
- }
46924
- init(_data) {
46925
- if (_data) {
46926
- this.companyId = _data["companyId"];
46927
- this.message = _data["message"];
46928
- this.senderUpn = _data["senderUpn"];
46929
- this.senderName = _data["senderName"];
46930
- this.operationId = _data["operationId"];
46931
- this.operationName = _data["operationName"];
46932
- this.resourceId = _data["resourceId"];
46933
- }
46934
- }
46935
- static fromJS(data) {
46936
- data = typeof data === 'object' ? data : {};
46937
- let result = new AddDiscussionMessageRequest();
46938
- result.init(data);
46939
- return result;
46940
- }
46941
- toJSON(data) {
46942
- data = typeof data === 'object' ? data : {};
46943
- data["companyId"] = this.companyId;
46944
- data["message"] = this.message;
46945
- data["senderUpn"] = this.senderUpn;
46946
- data["senderName"] = this.senderName;
46947
- data["operationId"] = this.operationId;
46948
- data["operationName"] = this.operationName;
46949
- data["resourceId"] = this.resourceId;
46950
- return data;
46951
- }
46952
- }
46953
- export class WorkorderDiscussionReadStatusDto {
46954
- constructor(data) {
46955
- if (data) {
46956
- for (var property in data) {
46957
- if (data.hasOwnProperty(property))
46958
- this[property] = data[property];
46959
- }
46960
- }
46961
- }
46962
- init(_data) {
46963
- if (_data) {
46964
- this.workorderId = _data["workorderId"];
46965
- this.operationId = _data["operationId"];
46966
- this.resourceId = _data["resourceId"];
46967
- this.userUpn = _data["userUpn"];
46968
- this.lastRead = _data["lastRead"] ? new Date(_data["lastRead"].toString()) : undefined;
46969
- }
46970
- }
46971
- static fromJS(data) {
46972
- data = typeof data === 'object' ? data : {};
46973
- let result = new WorkorderDiscussionReadStatusDto();
46974
- result.init(data);
46975
- return result;
46976
- }
46977
- toJSON(data) {
46978
- data = typeof data === 'object' ? data : {};
46979
- data["workorderId"] = this.workorderId;
46980
- data["operationId"] = this.operationId;
46981
- data["resourceId"] = this.resourceId;
46982
- data["userUpn"] = this.userUpn;
46983
- data["lastRead"] = this.lastRead ? this.lastRead.toISOString() : undefined;
46984
- return data;
46985
- }
46986
- }
46987
- export class SetDiscussionLastRead {
46988
- constructor(data) {
46989
- if (data) {
46990
- for (var property in data) {
46991
- if (data.hasOwnProperty(property))
46992
- this[property] = data[property];
46993
- }
46994
- }
46995
- }
46996
- init(_data) {
46997
- if (_data) {
46998
- this.workorderId = _data["workorderId"];
46999
- this.operationId = _data["operationId"];
47000
- this.resourceId = _data["resourceId"];
47001
- this.userUpn = _data["userUpn"];
47002
- }
47003
- }
47004
- static fromJS(data) {
47005
- data = typeof data === 'object' ? data : {};
47006
- let result = new SetDiscussionLastRead();
47007
- result.init(data);
47008
- return result;
47009
- }
47010
- toJSON(data) {
47011
- data = typeof data === 'object' ? data : {};
47012
- data["workorderId"] = this.workorderId;
47013
- data["operationId"] = this.operationId;
47014
- data["resourceId"] = this.resourceId;
47015
- data["userUpn"] = this.userUpn;
47016
- return data;
47017
- }
47018
- }
47019
46698
  function formatDate(d) {
47020
46699
  return d.getFullYear() + '-' +
47021
46700
  (d.getMonth() < 9 ? ('0' + (d.getMonth() + 1)) : (d.getMonth() + 1)) + '-' +
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ignos/api-client",
3
- "version": "20250805.0.12279-alpha",
3
+ "version": "20250806.0.12288",
4
4
  "description": "IGNOS API Client",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",