@ricado/api-client 2.4.0 → 2.4.2
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/dist/ricado.api.client.js +1 -1
- package/lib/Controllers/Lab/Site/FruitProfileController.js +2 -1
- package/lib/Controllers/Lab/Site/ProbeCalibrationController.js +921 -0
- package/lib/Controllers/Lab/Site/SampleController.js +151 -47
- package/lib/Controllers/Lab/Site/SampleFailureReasonController.js +2 -1
- package/lib/Controllers/Lab/Site/index.js +3 -0
- package/lib/Models/Lab/Site/ProbeCalibrationModel.js +303 -0
- package/lib/Models/Lab/Site/SampleModel.js +46 -2
- package/lib/Models/Lab/Site/index.js +3 -0
- package/lib/PackageVersion.js +1 -1
- package/lib/index.d.ts +585 -19
- package/package.json +1 -1
- package/src/Controllers/Lab/Site/FruitProfileController.js +2 -1
- package/src/Controllers/Lab/Site/ProbeCalibrationController.js +1052 -0
- package/src/Controllers/Lab/Site/SampleController.js +157 -56
- package/src/Controllers/Lab/Site/SampleFailureReasonController.js +2 -1
- package/src/Controllers/Lab/Site/index.js +2 -0
- package/src/Models/Lab/Site/ProbeCalibrationModel.js +290 -0
- package/src/Models/Lab/Site/SampleModel.js +52 -2
- package/src/Models/Lab/Site/index.js +2 -0
- package/src/PackageVersion.js +1 -1
|
@@ -32,58 +32,48 @@ var SampleController = /*#__PURE__*/function () {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
_createClass(SampleController, null, [{
|
|
35
|
-
key: "
|
|
35
|
+
key: "getOne",
|
|
36
36
|
value:
|
|
37
37
|
/**
|
|
38
|
-
* Retrieve
|
|
39
|
-
*
|
|
40
|
-
* Retrieves Temperature Data for a Sample
|
|
38
|
+
* Retrieve a Sample [GET /lab/sites/{siteId}/samples/{id}]
|
|
41
39
|
*
|
|
42
40
|
* @static
|
|
43
41
|
* @public
|
|
44
42
|
* @param {number} siteId The Site ID
|
|
45
43
|
* @param {string} id The Sample ID
|
|
46
|
-
* @return {Promise<
|
|
44
|
+
* @return {Promise<SampleModel>}
|
|
47
45
|
*/
|
|
48
|
-
function
|
|
46
|
+
function getOne(siteId, id) {
|
|
49
47
|
return new Promise(function (resolve, reject) {
|
|
50
48
|
_RequestHelper.default.getRequest("/lab/sites/".concat(siteId, "/samples/").concat(id)).then(function (result) {
|
|
51
49
|
var resolveValue = function () {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
return result.map(function (resultItem) {
|
|
57
|
-
return function () {
|
|
58
|
-
var resultItemObject = {};
|
|
59
|
-
|
|
60
|
-
if (_typeof(resultItem) === 'object' && 'timestamp' in resultItem) {
|
|
61
|
-
resultItemObject.timestamp = function () {
|
|
62
|
-
if (typeof resultItem.timestamp !== 'string') {
|
|
63
|
-
return new Date(String(resultItem.timestamp));
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
return new Date(resultItem.timestamp);
|
|
67
|
-
}();
|
|
68
|
-
} else {
|
|
69
|
-
resultItemObject.timestamp = new Date();
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
if (_typeof(resultItem) === 'object' && 'temperature' in resultItem) {
|
|
73
|
-
resultItemObject.temperature = function () {
|
|
74
|
-
if (typeof resultItem.temperature !== 'number') {
|
|
75
|
-
return Number(resultItem.temperature);
|
|
76
|
-
}
|
|
50
|
+
return _SampleModel.default.fromJSON(result, siteId);
|
|
51
|
+
}();
|
|
77
52
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
53
|
+
resolve(resolveValue);
|
|
54
|
+
}).catch(function (error) {
|
|
55
|
+
return reject(error);
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Update a Sample [PATCH /lab/sites/{siteId}/samples/{id}]
|
|
61
|
+
*
|
|
62
|
+
* @static
|
|
63
|
+
* @public
|
|
64
|
+
* @param {number} siteId The Site ID
|
|
65
|
+
* @param {string} id The Sample ID
|
|
66
|
+
* @param {SampleController.UpdateData} updateData The Sample Update Data
|
|
67
|
+
* @return {Promise<SampleModel>}
|
|
68
|
+
*/
|
|
83
69
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
70
|
+
}, {
|
|
71
|
+
key: "update",
|
|
72
|
+
value: function update(siteId, id, updateData) {
|
|
73
|
+
return new Promise(function (resolve, reject) {
|
|
74
|
+
_RequestHelper.default.patchRequest("/lab/sites/".concat(siteId, "/samples/").concat(id), updateData).then(function (result) {
|
|
75
|
+
var resolveValue = function () {
|
|
76
|
+
return _SampleModel.default.fromJSON(result, siteId);
|
|
87
77
|
}();
|
|
88
78
|
|
|
89
79
|
resolve(resolveValue);
|
|
@@ -92,6 +82,27 @@ var SampleController = /*#__PURE__*/function () {
|
|
|
92
82
|
});
|
|
93
83
|
});
|
|
94
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* Delete a Sample [DELETE /lab/sites/{siteId}/samples/{id}]
|
|
87
|
+
*
|
|
88
|
+
* @static
|
|
89
|
+
* @public
|
|
90
|
+
* @param {number} siteId The Site ID
|
|
91
|
+
* @param {string} id The Sample ID
|
|
92
|
+
* @return {Promise<boolean>}
|
|
93
|
+
*/
|
|
94
|
+
|
|
95
|
+
}, {
|
|
96
|
+
key: "delete",
|
|
97
|
+
value: function _delete(siteId, id) {
|
|
98
|
+
return new Promise(function (resolve, reject) {
|
|
99
|
+
_RequestHelper.default.deleteRequest("/lab/sites/".concat(siteId, "/samples/").concat(id)).then(function (result) {
|
|
100
|
+
resolve(result !== null && result !== void 0 ? result : true);
|
|
101
|
+
}).catch(function (error) {
|
|
102
|
+
return reject(error);
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
}
|
|
95
106
|
/**
|
|
96
107
|
* Retrieve Comments [GET /lab/sites/{siteId}/samples/{id}/comments]
|
|
97
108
|
*
|
|
@@ -771,6 +782,67 @@ var SampleController = /*#__PURE__*/function () {
|
|
|
771
782
|
});
|
|
772
783
|
});
|
|
773
784
|
}
|
|
785
|
+
/**
|
|
786
|
+
* Retrieve Temperature Data [GET /lab/sites/{siteId}/samples/{id}/temperature-data]
|
|
787
|
+
*
|
|
788
|
+
* Retrieves Temperature Data for a Sample
|
|
789
|
+
*
|
|
790
|
+
* @static
|
|
791
|
+
* @public
|
|
792
|
+
* @param {number} siteId The Site ID
|
|
793
|
+
* @param {string} id The Sample ID
|
|
794
|
+
* @return {Promise<Array<SampleController.TemperatureDataItem>>}
|
|
795
|
+
*/
|
|
796
|
+
|
|
797
|
+
}, {
|
|
798
|
+
key: "getTemperatureData",
|
|
799
|
+
value: function getTemperatureData(siteId, id) {
|
|
800
|
+
return new Promise(function (resolve, reject) {
|
|
801
|
+
_RequestHelper.default.getRequest("/lab/sites/".concat(siteId, "/samples/").concat(id, "/temperature-data")).then(function (result) {
|
|
802
|
+
var resolveValue = function () {
|
|
803
|
+
if (Array.isArray(result) !== true) {
|
|
804
|
+
return [];
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
return result.map(function (resultItem) {
|
|
808
|
+
return function () {
|
|
809
|
+
var resultItemObject = {};
|
|
810
|
+
|
|
811
|
+
if (_typeof(resultItem) === 'object' && 'timestamp' in resultItem) {
|
|
812
|
+
resultItemObject.timestamp = function () {
|
|
813
|
+
if (typeof resultItem.timestamp !== 'string') {
|
|
814
|
+
return new Date(String(resultItem.timestamp));
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
return new Date(resultItem.timestamp);
|
|
818
|
+
}();
|
|
819
|
+
} else {
|
|
820
|
+
resultItemObject.timestamp = new Date();
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
if (_typeof(resultItem) === 'object' && 'temperature' in resultItem) {
|
|
824
|
+
resultItemObject.temperature = function () {
|
|
825
|
+
if (typeof resultItem.temperature !== 'number') {
|
|
826
|
+
return Number(resultItem.temperature);
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
return resultItem.temperature;
|
|
830
|
+
}();
|
|
831
|
+
} else {
|
|
832
|
+
resultItemObject.temperature = 0;
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
return resultItemObject;
|
|
836
|
+
}();
|
|
837
|
+
});
|
|
838
|
+
}();
|
|
839
|
+
|
|
840
|
+
resolve(resolveValue);
|
|
841
|
+
}).catch(function (error) {
|
|
842
|
+
return reject(error);
|
|
843
|
+
});
|
|
844
|
+
});
|
|
845
|
+
}
|
|
774
846
|
/**
|
|
775
847
|
* List all Samples [GET /lab/sites/{siteId}/samples]
|
|
776
848
|
*
|
|
@@ -843,8 +915,8 @@ var _default = SampleController;
|
|
|
843
915
|
* @property {string} [labId] The Lab ID this Sample is associated with
|
|
844
916
|
* @property {string} [sampleNumber] The Numeric Sample Number
|
|
845
917
|
* @property {string} [createdSource] The Source that Created this Sample
|
|
846
|
-
* @property {?string} [createdUserId] ID of the User who Created this Sample. Only applies if the `createdSource` is '
|
|
847
|
-
* @property {?string} [createdUserName] Name of the User who Created this Sample. Only applies if the `createdSource` is '
|
|
918
|
+
* @property {?string} [createdUserId] ID of the User who Created this Sample. Only applies if the `createdSource` is 'User'
|
|
919
|
+
* @property {?string} [createdUserName] Name of the User who Created this Sample. Only applies if the `createdSource` is 'User'
|
|
848
920
|
* @property {?string} [publishUserId] ID of the User who Published this Sample
|
|
849
921
|
* @property {?string} [publishUserName] Name of the User who Published this Sample
|
|
850
922
|
* @property {string} [fruitProfileId] The Fruit Profile for this Sample
|
|
@@ -857,10 +929,14 @@ var _default = SampleController;
|
|
|
857
929
|
* @property {Date} [createdTimestampEnd] Filter by the Timestamp when Samples were Created. Results Less than or Equal to Timestamp
|
|
858
930
|
* @property {Date} [scheduledTimestampBegin] Filter by the Timestamp when Samples were Scheduled to Begin. Results Greater than or Equal to Timestamp
|
|
859
931
|
* @property {Date} [scheduledTimestampEnd] Filter by the Timestamp when Samples were Scheduled to Begin. Results Less than or Equal to Timestamp
|
|
932
|
+
* @property {Date} [loadedTimestampBegin] Filter by the Timestamp when Samples were Loaded. Results Greater than or Equal to Timestamp
|
|
933
|
+
* @property {Date} [loadedTimestampEnd] Filter by the Timestamp when Samples were Loaded. Results Less than or Equal to Timestamp
|
|
860
934
|
* @property {Date} [startTimestampBegin] Filter by the Timestamp when Samples were Started. Results Greater than or Equal to Timestamp
|
|
861
935
|
* @property {Date} [startTimestampEnd] Filter by the Timestamp when Samples were Started. Results Less than or Equal to Timestamp
|
|
862
936
|
* @property {Date} [finishTimestampBegin] Filter by the Timestamp when Samples were Finished. Results Greater than or Equal to Timestamp
|
|
863
937
|
* @property {Date} [finishTimestampEnd] Filter by the Timestamp when Samples were Finished. Results Less than or Equal to Timestamp
|
|
938
|
+
* @property {Date} [unloadedTimestampBegin] Filter by the Timestamp when Samples were Unloaded. Results Greater than or Equal to Timestamp
|
|
939
|
+
* @property {Date} [unloadedTimestampEnd] Filter by the Timestamp when Samples were Unloaded. Results Less than or Equal to Timestamp
|
|
864
940
|
* @property {Date} [publishTimestampBegin] Filter by the Timestamp when Samples were Published. Results Greater than or Equal to Timestamp
|
|
865
941
|
* @property {Date} [publishTimestampEnd] Filter by the Timestamp when Samples were Published. Results Less than or Equal to Timestamp
|
|
866
942
|
* @property {Date} [updateTimestampBegin] Filter by the Timestamp when Samples were last Updated. Results Greater than or Equal to Timestamp
|
|
@@ -876,11 +952,13 @@ var _default = SampleController;
|
|
|
876
952
|
* @property {string} [sampleNumber] The Numeric Sample Number
|
|
877
953
|
* @property {Date} [createdTimestamp] When this Sample was Created
|
|
878
954
|
* @property {string} createdSource The Source that Created this Sample
|
|
879
|
-
* @property {?string} [createdUserId] ID of the User who Created this Sample. Only applies if the `createdSource` is '
|
|
880
|
-
* @property {?string} [createdUserName] Name of the User who Created this Sample. Only applies if the `createdSource` is '
|
|
955
|
+
* @property {?string} [createdUserId] ID of the User who Created this Sample. Only applies if the `createdSource` is 'User'
|
|
956
|
+
* @property {?string} [createdUserName] Name of the User who Created this Sample. Only applies if the `createdSource` is 'User'
|
|
881
957
|
* @property {?Date} [scheduledTimestamp] Optional Scheduled Timestamp when this Sample should Begin
|
|
958
|
+
* @property {?Date} [loadedTimestamp] When this Sample was Loaded into the Dehydrator
|
|
882
959
|
* @property {?Date} [startTimestamp] When this Sample was Started
|
|
883
960
|
* @property {?Date} [finishTimestamp] When this Sample was Finished
|
|
961
|
+
* @property {?Date} [unloadedTimestamp] When this Sample was Unloaded from the Dehydrator
|
|
884
962
|
* @property {?Date} [publishTimestamp] When this Sample was Published
|
|
885
963
|
* @property {?string} [publishUserId] ID of the User who Published this Sample
|
|
886
964
|
* @property {?string} [publishUserName] Name of the User who Published this Sample
|
|
@@ -894,11 +972,28 @@ var _default = SampleController;
|
|
|
894
972
|
*/
|
|
895
973
|
|
|
896
974
|
/**
|
|
897
|
-
*
|
|
975
|
+
* The Update Data for a Sample
|
|
898
976
|
*
|
|
899
|
-
* @typedef {Object} SampleController.
|
|
900
|
-
* @property {
|
|
901
|
-
* @property {
|
|
977
|
+
* @typedef {Object} SampleController.UpdateData
|
|
978
|
+
* @property {string} [labId] The Lab ID this Sample is associated with
|
|
979
|
+
* @property {Date} [createdTimestamp] When this Sample was Created
|
|
980
|
+
* @property {string} [createdSource] The Source that Created this Sample
|
|
981
|
+
* @property {?string} [createdUserId] ID of the User who Created this Sample. Only applies if the `createdSource` is 'User'
|
|
982
|
+
* @property {?string} [createdUserName] Name of the User who Created this Sample. Only applies if the `createdSource` is 'User'
|
|
983
|
+
* @property {?Date} [scheduledTimestamp] Optional Scheduled Timestamp when this Sample should Begin
|
|
984
|
+
* @property {?Date} [loadedTimestamp] When this Sample was Loaded into the Dehydrator
|
|
985
|
+
* @property {?Date} [startTimestamp] When this Sample was Started
|
|
986
|
+
* @property {?Date} [finishTimestamp] When this Sample was Finished
|
|
987
|
+
* @property {?Date} [unloadedTimestamp] When this Sample was Unloaded from the Dehydrator
|
|
988
|
+
* @property {?Date} [publishTimestamp] When this Sample was Published
|
|
989
|
+
* @property {?string} [publishUserId] ID of the User who Published this Sample
|
|
990
|
+
* @property {?string} [publishUserName] Name of the User who Published this Sample
|
|
991
|
+
* @property {string} [fruitProfileId] The Fruit Profile for this Sample
|
|
992
|
+
* @property {string} [rackPositionId] The Rack Position used for this Sample
|
|
993
|
+
* @property {string} [dehydratorId] The Dehydrator used for this Sample
|
|
994
|
+
* @property {?string} [outcome] The Outcome of this Sample
|
|
995
|
+
* @property {?string} [failureReasonId] A Sample Failure Reason ID if this Sample Failed
|
|
996
|
+
* @property {?string} [resultId] The Sample Result ID asociated with this Sample
|
|
902
997
|
* @memberof Controllers.Lab.Site
|
|
903
998
|
*/
|
|
904
999
|
|
|
@@ -924,4 +1019,13 @@ var _default = SampleController;
|
|
|
924
1019
|
* @memberof Controllers.Lab.Site
|
|
925
1020
|
*/
|
|
926
1021
|
|
|
1022
|
+
/**
|
|
1023
|
+
* A **TemperatureDataItem** Type
|
|
1024
|
+
*
|
|
1025
|
+
* @typedef {Object} SampleController.TemperatureDataItem
|
|
1026
|
+
* @property {Date} timestamp The Timestamp for the Temperature Value
|
|
1027
|
+
* @property {number} temperature The Temperature Value
|
|
1028
|
+
* @memberof Controllers.Lab.Site
|
|
1029
|
+
*/
|
|
1030
|
+
|
|
927
1031
|
exports.default = _default;
|
|
@@ -176,7 +176,7 @@ var _default = SampleFailureReasonController;
|
|
|
176
176
|
* The Create Data for a Sample Failure Reason
|
|
177
177
|
*
|
|
178
178
|
* @typedef {Object} SampleFailureReasonController.CreateData
|
|
179
|
-
* @property {string}
|
|
179
|
+
* @property {string} name The Sample Failure Reason Name
|
|
180
180
|
* @property {string} description The Sample Failure Reason Description
|
|
181
181
|
* @memberof Controllers.Lab.Site
|
|
182
182
|
*/
|
|
@@ -185,6 +185,7 @@ var _default = SampleFailureReasonController;
|
|
|
185
185
|
* The Update Data for a Sample Failure Reason
|
|
186
186
|
*
|
|
187
187
|
* @typedef {Object} SampleFailureReasonController.UpdateData
|
|
188
|
+
* @property {string} [name] The Sample Failure Reason Name
|
|
188
189
|
* @property {string} [description] The Sample Failure Reason Description
|
|
189
190
|
* @memberof Controllers.Lab.Site
|
|
190
191
|
*/
|
|
@@ -11,6 +11,8 @@ var _FruitProfileController = _interopRequireDefault(require("./FruitProfileCont
|
|
|
11
11
|
|
|
12
12
|
var _LabController = _interopRequireDefault(require("./LabController"));
|
|
13
13
|
|
|
14
|
+
var _ProbeCalibrationController = _interopRequireDefault(require("./ProbeCalibrationController"));
|
|
15
|
+
|
|
14
16
|
var _RackController = _interopRequireDefault(require("./RackController"));
|
|
15
17
|
|
|
16
18
|
var _RackPositionController = _interopRequireDefault(require("./RackPositionController"));
|
|
@@ -36,6 +38,7 @@ var Site = {
|
|
|
36
38
|
DehydratorController: _DehydratorController.default,
|
|
37
39
|
FruitProfileController: _FruitProfileController.default,
|
|
38
40
|
LabController: _LabController.default,
|
|
41
|
+
ProbeCalibrationController: _ProbeCalibrationController.default,
|
|
39
42
|
RackController: _RackController.default,
|
|
40
43
|
RackPositionController: _RackPositionController.default,
|
|
41
44
|
SampleController: _SampleController.default,
|
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _BaseModel2 = _interopRequireDefault(require("../../../Models/BaseModel"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
13
|
+
|
|
14
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
15
|
+
|
|
16
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
17
|
+
|
|
18
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
19
|
+
|
|
20
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
21
|
+
|
|
22
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
23
|
+
|
|
24
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
25
|
+
|
|
26
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
27
|
+
|
|
28
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
29
|
+
|
|
30
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
31
|
+
|
|
32
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Model Class for a Probe Calibration
|
|
36
|
+
*
|
|
37
|
+
* @class
|
|
38
|
+
* @hideconstructor
|
|
39
|
+
* @extends BaseModel
|
|
40
|
+
*/
|
|
41
|
+
var ProbeCalibrationModel = /*#__PURE__*/function (_BaseModel) {
|
|
42
|
+
_inherits(ProbeCalibrationModel, _BaseModel);
|
|
43
|
+
|
|
44
|
+
var _super = _createSuper(ProbeCalibrationModel);
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* ProbeCalibrationModel Constructor
|
|
48
|
+
*
|
|
49
|
+
* @protected
|
|
50
|
+
* @param {number} siteId The Site ID associated with this Probe Calibration
|
|
51
|
+
*/
|
|
52
|
+
function ProbeCalibrationModel(siteId) {
|
|
53
|
+
var _this;
|
|
54
|
+
|
|
55
|
+
_classCallCheck(this, ProbeCalibrationModel);
|
|
56
|
+
|
|
57
|
+
_this = _super.call(this);
|
|
58
|
+
/**
|
|
59
|
+
* The Probe Calibration ID
|
|
60
|
+
*
|
|
61
|
+
* @type {string}
|
|
62
|
+
* @public
|
|
63
|
+
*/
|
|
64
|
+
|
|
65
|
+
_this.id = "";
|
|
66
|
+
/**
|
|
67
|
+
* The Rack Position ID this Probe Calibration is associated with
|
|
68
|
+
*
|
|
69
|
+
* @type {string}
|
|
70
|
+
* @public
|
|
71
|
+
*/
|
|
72
|
+
|
|
73
|
+
_this.rackPositionId = "";
|
|
74
|
+
/**
|
|
75
|
+
* When this Probe Calibration was Created
|
|
76
|
+
*
|
|
77
|
+
* @type {Date}
|
|
78
|
+
* @public
|
|
79
|
+
*/
|
|
80
|
+
|
|
81
|
+
_this.createdTimestamp = new Date();
|
|
82
|
+
/**
|
|
83
|
+
* ID of the User who Completed this Probe Calibration
|
|
84
|
+
*
|
|
85
|
+
* @type {string}
|
|
86
|
+
* @public
|
|
87
|
+
*/
|
|
88
|
+
|
|
89
|
+
_this.userId = "";
|
|
90
|
+
/**
|
|
91
|
+
* Name of the User who Completed this Probe Calibration
|
|
92
|
+
*
|
|
93
|
+
* @type {string}
|
|
94
|
+
* @public
|
|
95
|
+
*/
|
|
96
|
+
|
|
97
|
+
_this.userName = "";
|
|
98
|
+
/**
|
|
99
|
+
* The Calibration Offset prior to this Probe Calibration being Created
|
|
100
|
+
*
|
|
101
|
+
* @type {number}
|
|
102
|
+
* @public
|
|
103
|
+
*/
|
|
104
|
+
|
|
105
|
+
_this.preCalibrationOffset = 0;
|
|
106
|
+
/**
|
|
107
|
+
* The Calibration Offset after this Probe Calibration was Created
|
|
108
|
+
*
|
|
109
|
+
* @type {number}
|
|
110
|
+
* @public
|
|
111
|
+
*/
|
|
112
|
+
|
|
113
|
+
_this.postCalibrationOffset = 0;
|
|
114
|
+
/**
|
|
115
|
+
* The Temperature Probe reading prior to this Probe Calibration being Created
|
|
116
|
+
*
|
|
117
|
+
* @type {number}
|
|
118
|
+
* @public
|
|
119
|
+
*/
|
|
120
|
+
|
|
121
|
+
_this.preCalibrationTemperature = 0;
|
|
122
|
+
/**
|
|
123
|
+
* The Temperature Probe reading after this Probe Calibration was Created
|
|
124
|
+
*
|
|
125
|
+
* @type {number}
|
|
126
|
+
* @public
|
|
127
|
+
*/
|
|
128
|
+
|
|
129
|
+
_this.postCalibrationTemperature = 0;
|
|
130
|
+
/**
|
|
131
|
+
* Whether the Probe Calibration has been deleted
|
|
132
|
+
*
|
|
133
|
+
* @type {boolean}
|
|
134
|
+
* @public
|
|
135
|
+
*/
|
|
136
|
+
|
|
137
|
+
_this.deleted = false;
|
|
138
|
+
/**
|
|
139
|
+
* When the Probe Calibration was last updated
|
|
140
|
+
*
|
|
141
|
+
* @type {Date}
|
|
142
|
+
* @public
|
|
143
|
+
*/
|
|
144
|
+
|
|
145
|
+
_this.updateTimestamp = new Date();
|
|
146
|
+
/**
|
|
147
|
+
* The Site ID associated with this Probe Calibration
|
|
148
|
+
*
|
|
149
|
+
* @type {number}
|
|
150
|
+
* @public
|
|
151
|
+
*/
|
|
152
|
+
|
|
153
|
+
_this.siteId = siteId;
|
|
154
|
+
return _this;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Create a new **ProbeCalibrationModel** from a JSON Object or JSON String
|
|
158
|
+
*
|
|
159
|
+
* @static
|
|
160
|
+
* @public
|
|
161
|
+
* @param {Object<string, any>|string} json A JSON Object or JSON String
|
|
162
|
+
* @param {number} siteId The Site ID associated with this Probe Calibration
|
|
163
|
+
* @return {ProbeCalibrationModel}
|
|
164
|
+
*/
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
_createClass(ProbeCalibrationModel, null, [{
|
|
168
|
+
key: "fromJSON",
|
|
169
|
+
value: function fromJSON(json, siteId) {
|
|
170
|
+
var model = new ProbeCalibrationModel(siteId);
|
|
171
|
+
/**
|
|
172
|
+
* The JSON Object
|
|
173
|
+
*
|
|
174
|
+
* @type {Object<string, any>}
|
|
175
|
+
*/
|
|
176
|
+
|
|
177
|
+
var jsonObject = {};
|
|
178
|
+
|
|
179
|
+
if (typeof json === 'string') {
|
|
180
|
+
jsonObject = JSON.parse(json);
|
|
181
|
+
} else if (_typeof(json) === 'object') {
|
|
182
|
+
jsonObject = json;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
if ('id' in jsonObject) {
|
|
186
|
+
model.id = function () {
|
|
187
|
+
if (typeof jsonObject['id'] !== 'string') {
|
|
188
|
+
return String(jsonObject['id']);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
return jsonObject['id'];
|
|
192
|
+
}();
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
if ('rackPositionId' in jsonObject) {
|
|
196
|
+
model.rackPositionId = function () {
|
|
197
|
+
if (typeof jsonObject['rackPositionId'] !== 'string') {
|
|
198
|
+
return String(jsonObject['rackPositionId']);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
return jsonObject['rackPositionId'];
|
|
202
|
+
}();
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
if ('createdTimestamp' in jsonObject) {
|
|
206
|
+
model.createdTimestamp = function () {
|
|
207
|
+
if (typeof jsonObject['createdTimestamp'] !== 'string') {
|
|
208
|
+
return new Date(String(jsonObject['createdTimestamp']));
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
return new Date(jsonObject['createdTimestamp']);
|
|
212
|
+
}();
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
if ('userId' in jsonObject) {
|
|
216
|
+
model.userId = function () {
|
|
217
|
+
if (typeof jsonObject['userId'] !== 'string') {
|
|
218
|
+
return String(jsonObject['userId']);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
return jsonObject['userId'];
|
|
222
|
+
}();
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
if ('userName' in jsonObject) {
|
|
226
|
+
model.userName = function () {
|
|
227
|
+
if (typeof jsonObject['userName'] !== 'string') {
|
|
228
|
+
return String(jsonObject['userName']);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
return jsonObject['userName'];
|
|
232
|
+
}();
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
if ('preCalibrationOffset' in jsonObject) {
|
|
236
|
+
model.preCalibrationOffset = function () {
|
|
237
|
+
if (typeof jsonObject['preCalibrationOffset'] !== 'number') {
|
|
238
|
+
return Number(jsonObject['preCalibrationOffset']);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
return jsonObject['preCalibrationOffset'];
|
|
242
|
+
}();
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
if ('postCalibrationOffset' in jsonObject) {
|
|
246
|
+
model.postCalibrationOffset = function () {
|
|
247
|
+
if (typeof jsonObject['postCalibrationOffset'] !== 'number') {
|
|
248
|
+
return Number(jsonObject['postCalibrationOffset']);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
return jsonObject['postCalibrationOffset'];
|
|
252
|
+
}();
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
if ('preCalibrationTemperature' in jsonObject) {
|
|
256
|
+
model.preCalibrationTemperature = function () {
|
|
257
|
+
if (typeof jsonObject['preCalibrationTemperature'] !== 'number') {
|
|
258
|
+
return Number(jsonObject['preCalibrationTemperature']);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
return jsonObject['preCalibrationTemperature'];
|
|
262
|
+
}();
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
if ('postCalibrationTemperature' in jsonObject) {
|
|
266
|
+
model.postCalibrationTemperature = function () {
|
|
267
|
+
if (typeof jsonObject['postCalibrationTemperature'] !== 'number') {
|
|
268
|
+
return Number(jsonObject['postCalibrationTemperature']);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
return jsonObject['postCalibrationTemperature'];
|
|
272
|
+
}();
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
if ('deleted' in jsonObject) {
|
|
276
|
+
model.deleted = function () {
|
|
277
|
+
if (typeof jsonObject['deleted'] !== 'boolean') {
|
|
278
|
+
return Boolean(jsonObject['deleted']);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
return jsonObject['deleted'];
|
|
282
|
+
}();
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
if ('updateTimestamp' in jsonObject) {
|
|
286
|
+
model.updateTimestamp = function () {
|
|
287
|
+
if (typeof jsonObject['updateTimestamp'] !== 'string') {
|
|
288
|
+
return new Date(String(jsonObject['updateTimestamp']));
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
return new Date(jsonObject['updateTimestamp']);
|
|
292
|
+
}();
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
return model;
|
|
296
|
+
}
|
|
297
|
+
}]);
|
|
298
|
+
|
|
299
|
+
return ProbeCalibrationModel;
|
|
300
|
+
}(_BaseModel2.default);
|
|
301
|
+
|
|
302
|
+
var _default = ProbeCalibrationModel;
|
|
303
|
+
exports.default = _default;
|