@ricado/api-client 2.3.27 → 2.4.0
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/DehydratorController.js +198 -0
- package/lib/Controllers/Lab/Site/FruitProfileController.js +204 -0
- package/lib/Controllers/Lab/Site/LabController.js +222 -0
- package/lib/Controllers/Lab/Site/RackController.js +222 -0
- package/lib/Controllers/Lab/Site/RackPositionController.js +207 -0
- package/lib/Controllers/Lab/Site/SampleController.js +927 -0
- package/lib/Controllers/Lab/Site/SampleFailureReasonController.js +192 -0
- package/lib/Controllers/Lab/Site/SampleResultController.js +905 -0
- package/lib/Controllers/Lab/Site/index.js +46 -0
- package/lib/Controllers/Lab/index.js +25 -0
- package/lib/Controllers/Packhouse/Site/CompacSizerController.js +2 -2
- package/lib/Controllers/Packhouse/Site/MAFSizerController.js +2 -2
- package/lib/Controllers/Packhouse/Site/ShiftController.js +304 -0
- package/lib/Controllers/index.js +9 -6
- package/lib/Models/Lab/Site/DehydratorModel.js +250 -0
- package/lib/Models/Lab/Site/FruitProfileModel.js +303 -0
- package/lib/Models/Lab/Site/LabModel.js +365 -0
- package/lib/Models/Lab/Site/RackModel.js +358 -0
- package/lib/Models/Lab/Site/RackPositionModel.js +525 -0
- package/lib/Models/Lab/Site/SampleFailureReasonModel.js +195 -0
- package/lib/Models/Lab/Site/SampleModel.js +545 -0
- package/lib/Models/Lab/Site/SampleResultModel.js +545 -0
- package/lib/Models/Lab/Site/index.js +46 -0
- package/lib/Models/Lab/index.js +25 -0
- package/lib/Models/Packhouse/Site/CompacSizerModel.js +18 -1
- package/lib/Models/Packhouse/Site/MAFSizerModel.js +18 -1
- package/lib/Models/index.js +7 -4
- package/lib/PackageVersion.js +1 -1
- package/lib/index.d.ts +10491 -7674
- package/package.json +1 -1
- package/src/Controllers/Lab/Site/DehydratorController.js +175 -0
- package/src/Controllers/Lab/Site/FruitProfileController.js +181 -0
- package/src/Controllers/Lab/Site/LabController.js +199 -0
- package/src/Controllers/Lab/Site/RackController.js +199 -0
- package/src/Controllers/Lab/Site/RackPositionController.js +184 -0
- package/src/Controllers/Lab/Site/SampleController.js +1067 -0
- package/src/Controllers/Lab/Site/SampleFailureReasonController.js +169 -0
- package/src/Controllers/Lab/Site/SampleResultController.js +1036 -0
- package/src/Controllers/Lab/Site/index.js +30 -0
- package/src/Controllers/Lab/index.js +16 -0
- package/src/Controllers/Packhouse/Site/CompacSizerController.js +2 -2
- package/src/Controllers/Packhouse/Site/MAFSizerController.js +2 -2
- package/src/Controllers/Packhouse/Site/ShiftController.js +367 -0
- package/src/Controllers/index.js +2 -0
- package/src/Models/Lab/Site/DehydratorModel.js +234 -0
- package/src/Models/Lab/Site/FruitProfileModel.js +290 -0
- package/src/Models/Lab/Site/LabModel.js +372 -0
- package/src/Models/Lab/Site/RackModel.js +358 -0
- package/src/Models/Lab/Site/RackPositionModel.js +600 -0
- package/src/Models/Lab/Site/SampleFailureReasonModel.js +170 -0
- package/src/Models/Lab/Site/SampleModel.js +565 -0
- package/src/Models/Lab/Site/SampleResultModel.js +565 -0
- package/src/Models/Lab/Site/index.js +30 -0
- package/src/Models/Lab/index.js +16 -0
- package/src/Models/Packhouse/Site/CompacSizerModel.js +24 -1
- package/src/Models/Packhouse/Site/MAFSizerModel.js +24 -1
- package/src/Models/index.js +2 -0
- package/src/PackageVersion.js +1 -1
|
@@ -0,0 +1,250 @@
|
|
|
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 Dehydrator
|
|
36
|
+
*
|
|
37
|
+
* @class
|
|
38
|
+
* @hideconstructor
|
|
39
|
+
* @extends BaseModel
|
|
40
|
+
*/
|
|
41
|
+
var DehydratorModel = /*#__PURE__*/function (_BaseModel) {
|
|
42
|
+
_inherits(DehydratorModel, _BaseModel);
|
|
43
|
+
|
|
44
|
+
var _super = _createSuper(DehydratorModel);
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* DehydratorModel Constructor
|
|
48
|
+
*
|
|
49
|
+
* @protected
|
|
50
|
+
* @param {number} siteId The Site ID associated with this Dehydrator
|
|
51
|
+
*/
|
|
52
|
+
function DehydratorModel(siteId) {
|
|
53
|
+
var _this;
|
|
54
|
+
|
|
55
|
+
_classCallCheck(this, DehydratorModel);
|
|
56
|
+
|
|
57
|
+
_this = _super.call(this);
|
|
58
|
+
/**
|
|
59
|
+
* The Dehydrator ID
|
|
60
|
+
*
|
|
61
|
+
* @type {string}
|
|
62
|
+
* @public
|
|
63
|
+
*/
|
|
64
|
+
|
|
65
|
+
_this.id = "";
|
|
66
|
+
/**
|
|
67
|
+
* The RTU this Dehydrator belongs to
|
|
68
|
+
*
|
|
69
|
+
* @type {?number}
|
|
70
|
+
* @public
|
|
71
|
+
*/
|
|
72
|
+
|
|
73
|
+
_this.rtuId = null;
|
|
74
|
+
/**
|
|
75
|
+
* The Name of this Dehydrator
|
|
76
|
+
*
|
|
77
|
+
* @type {string}
|
|
78
|
+
* @public
|
|
79
|
+
*/
|
|
80
|
+
|
|
81
|
+
_this.name = "";
|
|
82
|
+
/**
|
|
83
|
+
* The Points used by this Dehydrator
|
|
84
|
+
*
|
|
85
|
+
* @type {{rackPositionId: number}}
|
|
86
|
+
* @public
|
|
87
|
+
*/
|
|
88
|
+
|
|
89
|
+
_this.points = function () {
|
|
90
|
+
var pointsDefaultValue = {};
|
|
91
|
+
pointsDefaultValue.rackPositionId = 0;
|
|
92
|
+
return pointsDefaultValue;
|
|
93
|
+
}();
|
|
94
|
+
/**
|
|
95
|
+
* The Lab that owns this Dehydrator
|
|
96
|
+
*
|
|
97
|
+
* @type {string}
|
|
98
|
+
* @public
|
|
99
|
+
*/
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
_this.labId = "";
|
|
103
|
+
/**
|
|
104
|
+
* Whether the Dehydrator has been deleted
|
|
105
|
+
*
|
|
106
|
+
* @type {boolean}
|
|
107
|
+
* @public
|
|
108
|
+
*/
|
|
109
|
+
|
|
110
|
+
_this.deleted = false;
|
|
111
|
+
/**
|
|
112
|
+
* When the Dehydrator was last updated
|
|
113
|
+
*
|
|
114
|
+
* @type {Date}
|
|
115
|
+
* @public
|
|
116
|
+
*/
|
|
117
|
+
|
|
118
|
+
_this.updateTimestamp = new Date();
|
|
119
|
+
/**
|
|
120
|
+
* The Site ID associated with this Dehydrator
|
|
121
|
+
*
|
|
122
|
+
* @type {number}
|
|
123
|
+
* @public
|
|
124
|
+
*/
|
|
125
|
+
|
|
126
|
+
_this.siteId = siteId;
|
|
127
|
+
return _this;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Create a new **DehydratorModel** from a JSON Object or JSON String
|
|
131
|
+
*
|
|
132
|
+
* @static
|
|
133
|
+
* @public
|
|
134
|
+
* @param {Object<string, any>|string} json A JSON Object or JSON String
|
|
135
|
+
* @param {number} siteId The Site ID associated with this Dehydrator
|
|
136
|
+
* @return {DehydratorModel}
|
|
137
|
+
*/
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
_createClass(DehydratorModel, null, [{
|
|
141
|
+
key: "fromJSON",
|
|
142
|
+
value: function fromJSON(json, siteId) {
|
|
143
|
+
var model = new DehydratorModel(siteId);
|
|
144
|
+
/**
|
|
145
|
+
* The JSON Object
|
|
146
|
+
*
|
|
147
|
+
* @type {Object<string, any>}
|
|
148
|
+
*/
|
|
149
|
+
|
|
150
|
+
var jsonObject = {};
|
|
151
|
+
|
|
152
|
+
if (typeof json === 'string') {
|
|
153
|
+
jsonObject = JSON.parse(json);
|
|
154
|
+
} else if (_typeof(json) === 'object') {
|
|
155
|
+
jsonObject = json;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
if ('id' in jsonObject) {
|
|
159
|
+
model.id = function () {
|
|
160
|
+
if (typeof jsonObject['id'] !== 'string') {
|
|
161
|
+
return String(jsonObject['id']);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return jsonObject['id'];
|
|
165
|
+
}();
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
if ('rtuId' in jsonObject) {
|
|
169
|
+
model.rtuId = function () {
|
|
170
|
+
if (jsonObject['rtuId'] === null) {
|
|
171
|
+
return null;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
if (typeof jsonObject['rtuId'] !== 'number') {
|
|
175
|
+
return Number.isInteger(Number(jsonObject['rtuId'])) ? Number(jsonObject['rtuId']) : Math.floor(Number(jsonObject['rtuId']));
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
return Number.isInteger(jsonObject['rtuId']) ? jsonObject['rtuId'] : Math.floor(jsonObject['rtuId']);
|
|
179
|
+
}();
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
if ('name' in jsonObject) {
|
|
183
|
+
model.name = function () {
|
|
184
|
+
if (typeof jsonObject['name'] !== 'string') {
|
|
185
|
+
return String(jsonObject['name']);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
return jsonObject['name'];
|
|
189
|
+
}();
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
if ('points' in jsonObject) {
|
|
193
|
+
model.points = function () {
|
|
194
|
+
var pointsObject = {};
|
|
195
|
+
|
|
196
|
+
if (_typeof(jsonObject['points']) === 'object' && 'rackPositionId' in jsonObject['points']) {
|
|
197
|
+
pointsObject.rackPositionId = function () {
|
|
198
|
+
if (typeof jsonObject['points'].rackPositionId !== 'number') {
|
|
199
|
+
return Number.isInteger(Number(jsonObject['points'].rackPositionId)) ? Number(jsonObject['points'].rackPositionId) : Math.floor(Number(jsonObject['points'].rackPositionId));
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
return Number.isInteger(jsonObject['points'].rackPositionId) ? jsonObject['points'].rackPositionId : Math.floor(jsonObject['points'].rackPositionId);
|
|
203
|
+
}();
|
|
204
|
+
} else {
|
|
205
|
+
pointsObject.rackPositionId = 0;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
return pointsObject;
|
|
209
|
+
}();
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
if ('labId' in jsonObject) {
|
|
213
|
+
model.labId = function () {
|
|
214
|
+
if (typeof jsonObject['labId'] !== 'string') {
|
|
215
|
+
return String(jsonObject['labId']);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
return jsonObject['labId'];
|
|
219
|
+
}();
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
if ('deleted' in jsonObject) {
|
|
223
|
+
model.deleted = function () {
|
|
224
|
+
if (typeof jsonObject['deleted'] !== 'boolean') {
|
|
225
|
+
return Boolean(jsonObject['deleted']);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
return jsonObject['deleted'];
|
|
229
|
+
}();
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
if ('updateTimestamp' in jsonObject) {
|
|
233
|
+
model.updateTimestamp = function () {
|
|
234
|
+
if (typeof jsonObject['updateTimestamp'] !== 'string') {
|
|
235
|
+
return new Date(String(jsonObject['updateTimestamp']));
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
return new Date(jsonObject['updateTimestamp']);
|
|
239
|
+
}();
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
return model;
|
|
243
|
+
}
|
|
244
|
+
}]);
|
|
245
|
+
|
|
246
|
+
return DehydratorModel;
|
|
247
|
+
}(_BaseModel2.default);
|
|
248
|
+
|
|
249
|
+
var _default = DehydratorModel;
|
|
250
|
+
exports.default = _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 Fruit Profile
|
|
36
|
+
*
|
|
37
|
+
* @class
|
|
38
|
+
* @hideconstructor
|
|
39
|
+
* @extends BaseModel
|
|
40
|
+
*/
|
|
41
|
+
var FruitProfileModel = /*#__PURE__*/function (_BaseModel) {
|
|
42
|
+
_inherits(FruitProfileModel, _BaseModel);
|
|
43
|
+
|
|
44
|
+
var _super = _createSuper(FruitProfileModel);
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* FruitProfileModel Constructor
|
|
48
|
+
*
|
|
49
|
+
* @protected
|
|
50
|
+
* @param {number} siteId The Site ID associated with this Fruit Profile
|
|
51
|
+
*/
|
|
52
|
+
function FruitProfileModel(siteId) {
|
|
53
|
+
var _this;
|
|
54
|
+
|
|
55
|
+
_classCallCheck(this, FruitProfileModel);
|
|
56
|
+
|
|
57
|
+
_this = _super.call(this);
|
|
58
|
+
/**
|
|
59
|
+
* The Fruit Profile ID
|
|
60
|
+
*
|
|
61
|
+
* @type {string}
|
|
62
|
+
* @public
|
|
63
|
+
*/
|
|
64
|
+
|
|
65
|
+
_this.id = "";
|
|
66
|
+
/**
|
|
67
|
+
* The Fruit Profile Name
|
|
68
|
+
*
|
|
69
|
+
* @type {string}
|
|
70
|
+
* @public
|
|
71
|
+
*/
|
|
72
|
+
|
|
73
|
+
_this.name = "";
|
|
74
|
+
/**
|
|
75
|
+
* The Fruit Profile Description
|
|
76
|
+
*
|
|
77
|
+
* @type {string}
|
|
78
|
+
* @public
|
|
79
|
+
*/
|
|
80
|
+
|
|
81
|
+
_this.description = "";
|
|
82
|
+
/**
|
|
83
|
+
* The Fruit Profile Image Source
|
|
84
|
+
*
|
|
85
|
+
* @type {string}
|
|
86
|
+
* @public
|
|
87
|
+
*/
|
|
88
|
+
|
|
89
|
+
_this.image = "";
|
|
90
|
+
/**
|
|
91
|
+
* The Typical Warm Up Duration (in seconds) for a Sample to reach the Minimum Target Temperature
|
|
92
|
+
*
|
|
93
|
+
* @type {number}
|
|
94
|
+
* @public
|
|
95
|
+
*/
|
|
96
|
+
|
|
97
|
+
_this.nominalWarmUpDuration = 0;
|
|
98
|
+
/**
|
|
99
|
+
* The Minimum Duration (in seconds) that a Sample should be within the Min and Max Target Temperatures be Successful
|
|
100
|
+
*
|
|
101
|
+
* @type {number}
|
|
102
|
+
* @public
|
|
103
|
+
*/
|
|
104
|
+
|
|
105
|
+
_this.minimumWithinTargetDuration = 0;
|
|
106
|
+
/**
|
|
107
|
+
* The Maximum Duration (in seconds) that a Sample should be Dehydrated for before it Fails
|
|
108
|
+
*
|
|
109
|
+
* @type {number}
|
|
110
|
+
* @public
|
|
111
|
+
*/
|
|
112
|
+
|
|
113
|
+
_this.maximumTotalDuration = 0;
|
|
114
|
+
/**
|
|
115
|
+
* The Minimum Target Temperature for a Sample to be Successful
|
|
116
|
+
*
|
|
117
|
+
* @type {number}
|
|
118
|
+
* @public
|
|
119
|
+
*/
|
|
120
|
+
|
|
121
|
+
_this.minimumTargetTemperature = 0;
|
|
122
|
+
/**
|
|
123
|
+
* The Maximum Target Temperature for a Sample to be Successful
|
|
124
|
+
*
|
|
125
|
+
* @type {number}
|
|
126
|
+
* @public
|
|
127
|
+
*/
|
|
128
|
+
|
|
129
|
+
_this.maximumTargetTemperature = 0;
|
|
130
|
+
/**
|
|
131
|
+
* Whether the Fruit Profile has been deleted
|
|
132
|
+
*
|
|
133
|
+
* @type {boolean}
|
|
134
|
+
* @public
|
|
135
|
+
*/
|
|
136
|
+
|
|
137
|
+
_this.deleted = false;
|
|
138
|
+
/**
|
|
139
|
+
* When the Fruit Profile was last updated
|
|
140
|
+
*
|
|
141
|
+
* @type {Date}
|
|
142
|
+
* @public
|
|
143
|
+
*/
|
|
144
|
+
|
|
145
|
+
_this.updateTimestamp = new Date();
|
|
146
|
+
/**
|
|
147
|
+
* The Site ID associated with this Fruit Profile
|
|
148
|
+
*
|
|
149
|
+
* @type {number}
|
|
150
|
+
* @public
|
|
151
|
+
*/
|
|
152
|
+
|
|
153
|
+
_this.siteId = siteId;
|
|
154
|
+
return _this;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Create a new **FruitProfileModel** 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 Fruit Profile
|
|
163
|
+
* @return {FruitProfileModel}
|
|
164
|
+
*/
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
_createClass(FruitProfileModel, null, [{
|
|
168
|
+
key: "fromJSON",
|
|
169
|
+
value: function fromJSON(json, siteId) {
|
|
170
|
+
var model = new FruitProfileModel(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 ('name' in jsonObject) {
|
|
196
|
+
model.name = function () {
|
|
197
|
+
if (typeof jsonObject['name'] !== 'string') {
|
|
198
|
+
return String(jsonObject['name']);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
return jsonObject['name'];
|
|
202
|
+
}();
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
if ('description' in jsonObject) {
|
|
206
|
+
model.description = function () {
|
|
207
|
+
if (typeof jsonObject['description'] !== 'string') {
|
|
208
|
+
return String(jsonObject['description']);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
return jsonObject['description'];
|
|
212
|
+
}();
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
if ('image' in jsonObject) {
|
|
216
|
+
model.image = function () {
|
|
217
|
+
if (typeof jsonObject['image'] !== 'string') {
|
|
218
|
+
return String(jsonObject['image']);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
return jsonObject['image'];
|
|
222
|
+
}();
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
if ('nominalWarmUpDuration' in jsonObject) {
|
|
226
|
+
model.nominalWarmUpDuration = function () {
|
|
227
|
+
if (typeof jsonObject['nominalWarmUpDuration'] !== 'number') {
|
|
228
|
+
return Number.isInteger(Number(jsonObject['nominalWarmUpDuration'])) ? Number(jsonObject['nominalWarmUpDuration']) : Math.floor(Number(jsonObject['nominalWarmUpDuration']));
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
return Number.isInteger(jsonObject['nominalWarmUpDuration']) ? jsonObject['nominalWarmUpDuration'] : Math.floor(jsonObject['nominalWarmUpDuration']);
|
|
232
|
+
}();
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
if ('minimumWithinTargetDuration' in jsonObject) {
|
|
236
|
+
model.minimumWithinTargetDuration = function () {
|
|
237
|
+
if (typeof jsonObject['minimumWithinTargetDuration'] !== 'number') {
|
|
238
|
+
return Number.isInteger(Number(jsonObject['minimumWithinTargetDuration'])) ? Number(jsonObject['minimumWithinTargetDuration']) : Math.floor(Number(jsonObject['minimumWithinTargetDuration']));
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
return Number.isInteger(jsonObject['minimumWithinTargetDuration']) ? jsonObject['minimumWithinTargetDuration'] : Math.floor(jsonObject['minimumWithinTargetDuration']);
|
|
242
|
+
}();
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
if ('maximumTotalDuration' in jsonObject) {
|
|
246
|
+
model.maximumTotalDuration = function () {
|
|
247
|
+
if (typeof jsonObject['maximumTotalDuration'] !== 'number') {
|
|
248
|
+
return Number.isInteger(Number(jsonObject['maximumTotalDuration'])) ? Number(jsonObject['maximumTotalDuration']) : Math.floor(Number(jsonObject['maximumTotalDuration']));
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
return Number.isInteger(jsonObject['maximumTotalDuration']) ? jsonObject['maximumTotalDuration'] : Math.floor(jsonObject['maximumTotalDuration']);
|
|
252
|
+
}();
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
if ('minimumTargetTemperature' in jsonObject) {
|
|
256
|
+
model.minimumTargetTemperature = function () {
|
|
257
|
+
if (typeof jsonObject['minimumTargetTemperature'] !== 'number') {
|
|
258
|
+
return Number(jsonObject['minimumTargetTemperature']);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
return jsonObject['minimumTargetTemperature'];
|
|
262
|
+
}();
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
if ('maximumTargetTemperature' in jsonObject) {
|
|
266
|
+
model.maximumTargetTemperature = function () {
|
|
267
|
+
if (typeof jsonObject['maximumTargetTemperature'] !== 'number') {
|
|
268
|
+
return Number(jsonObject['maximumTargetTemperature']);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
return jsonObject['maximumTargetTemperature'];
|
|
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 FruitProfileModel;
|
|
300
|
+
}(_BaseModel2.default);
|
|
301
|
+
|
|
302
|
+
var _default = FruitProfileModel;
|
|
303
|
+
exports.default = _default;
|