@ricado/api-client 2.3.28 → 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/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/index.js +7 -4
- package/lib/PackageVersion.js +1 -1
- package/lib/index.d.ts +10348 -7537
- 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/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/index.js +2 -0
- package/src/PackageVersion.js +1 -1
|
@@ -0,0 +1,358 @@
|
|
|
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 Rack
|
|
36
|
+
*
|
|
37
|
+
* @class
|
|
38
|
+
* @hideconstructor
|
|
39
|
+
* @extends BaseModel
|
|
40
|
+
*/
|
|
41
|
+
var RackModel = /*#__PURE__*/function (_BaseModel) {
|
|
42
|
+
_inherits(RackModel, _BaseModel);
|
|
43
|
+
|
|
44
|
+
var _super = _createSuper(RackModel);
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* RackModel Constructor
|
|
48
|
+
*
|
|
49
|
+
* @protected
|
|
50
|
+
* @param {number} siteId The Site ID associated with this Rack
|
|
51
|
+
*/
|
|
52
|
+
function RackModel(siteId) {
|
|
53
|
+
var _this;
|
|
54
|
+
|
|
55
|
+
_classCallCheck(this, RackModel);
|
|
56
|
+
|
|
57
|
+
_this = _super.call(this);
|
|
58
|
+
/**
|
|
59
|
+
* The Rack ID
|
|
60
|
+
*
|
|
61
|
+
* @type {string}
|
|
62
|
+
* @public
|
|
63
|
+
*/
|
|
64
|
+
|
|
65
|
+
_this.id = "";
|
|
66
|
+
/**
|
|
67
|
+
* The RTU this Rack belongs to
|
|
68
|
+
*
|
|
69
|
+
* @type {?number}
|
|
70
|
+
* @public
|
|
71
|
+
*/
|
|
72
|
+
|
|
73
|
+
_this.rtuId = null;
|
|
74
|
+
/**
|
|
75
|
+
* The Name of this Rack
|
|
76
|
+
*
|
|
77
|
+
* @type {string}
|
|
78
|
+
* @public
|
|
79
|
+
*/
|
|
80
|
+
|
|
81
|
+
_this.name = "";
|
|
82
|
+
/**
|
|
83
|
+
* The Points used by this Rack
|
|
84
|
+
*
|
|
85
|
+
* @type {{disabled: number}}
|
|
86
|
+
* @public
|
|
87
|
+
*/
|
|
88
|
+
|
|
89
|
+
_this.points = function () {
|
|
90
|
+
var pointsDefaultValue = {};
|
|
91
|
+
pointsDefaultValue.disabled = 0;
|
|
92
|
+
return pointsDefaultValue;
|
|
93
|
+
}();
|
|
94
|
+
/**
|
|
95
|
+
* The Lab that owns this Rack
|
|
96
|
+
*
|
|
97
|
+
* @type {string}
|
|
98
|
+
* @public
|
|
99
|
+
*/
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
_this.labId = "";
|
|
103
|
+
/**
|
|
104
|
+
* The Vertical Levels Defined for this Rack
|
|
105
|
+
*
|
|
106
|
+
* @type {Array<{name: string}>}
|
|
107
|
+
* @public
|
|
108
|
+
*/
|
|
109
|
+
|
|
110
|
+
_this.verticalLevels = [];
|
|
111
|
+
/**
|
|
112
|
+
* Whether the Vertical Levels for this Rack should be Inverted. By Default, Vertical Levels go from the Lowest Level upwards
|
|
113
|
+
*
|
|
114
|
+
* @type {boolean}
|
|
115
|
+
* @public
|
|
116
|
+
*/
|
|
117
|
+
|
|
118
|
+
_this.invertVerticalLevels = false;
|
|
119
|
+
/**
|
|
120
|
+
* The Horizontal Positions defined for this Rack
|
|
121
|
+
*
|
|
122
|
+
* @type {Array<{name: string}>}
|
|
123
|
+
* @public
|
|
124
|
+
*/
|
|
125
|
+
|
|
126
|
+
_this.horizontalPositions = [];
|
|
127
|
+
/**
|
|
128
|
+
* Whether the Horizontal Positions for this Rack should be Inverted. By Default, Horizontal Positions go from Left to Right
|
|
129
|
+
*
|
|
130
|
+
* @type {boolean}
|
|
131
|
+
* @public
|
|
132
|
+
*/
|
|
133
|
+
|
|
134
|
+
_this.invertHorizontalPositions = false;
|
|
135
|
+
/**
|
|
136
|
+
* Whether the Rack has been deleted
|
|
137
|
+
*
|
|
138
|
+
* @type {boolean}
|
|
139
|
+
* @public
|
|
140
|
+
*/
|
|
141
|
+
|
|
142
|
+
_this.deleted = false;
|
|
143
|
+
/**
|
|
144
|
+
* When the Rack was last updated
|
|
145
|
+
*
|
|
146
|
+
* @type {Date}
|
|
147
|
+
* @public
|
|
148
|
+
*/
|
|
149
|
+
|
|
150
|
+
_this.updateTimestamp = new Date();
|
|
151
|
+
/**
|
|
152
|
+
* The Site ID associated with this Rack
|
|
153
|
+
*
|
|
154
|
+
* @type {number}
|
|
155
|
+
* @public
|
|
156
|
+
*/
|
|
157
|
+
|
|
158
|
+
_this.siteId = siteId;
|
|
159
|
+
return _this;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Create a new **RackModel** from a JSON Object or JSON String
|
|
163
|
+
*
|
|
164
|
+
* @static
|
|
165
|
+
* @public
|
|
166
|
+
* @param {Object<string, any>|string} json A JSON Object or JSON String
|
|
167
|
+
* @param {number} siteId The Site ID associated with this Rack
|
|
168
|
+
* @return {RackModel}
|
|
169
|
+
*/
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
_createClass(RackModel, null, [{
|
|
173
|
+
key: "fromJSON",
|
|
174
|
+
value: function fromJSON(json, siteId) {
|
|
175
|
+
var model = new RackModel(siteId);
|
|
176
|
+
/**
|
|
177
|
+
* The JSON Object
|
|
178
|
+
*
|
|
179
|
+
* @type {Object<string, any>}
|
|
180
|
+
*/
|
|
181
|
+
|
|
182
|
+
var jsonObject = {};
|
|
183
|
+
|
|
184
|
+
if (typeof json === 'string') {
|
|
185
|
+
jsonObject = JSON.parse(json);
|
|
186
|
+
} else if (_typeof(json) === 'object') {
|
|
187
|
+
jsonObject = json;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
if ('id' in jsonObject) {
|
|
191
|
+
model.id = function () {
|
|
192
|
+
if (typeof jsonObject['id'] !== 'string') {
|
|
193
|
+
return String(jsonObject['id']);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
return jsonObject['id'];
|
|
197
|
+
}();
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
if ('rtuId' in jsonObject) {
|
|
201
|
+
model.rtuId = function () {
|
|
202
|
+
if (jsonObject['rtuId'] === null) {
|
|
203
|
+
return null;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
if (typeof jsonObject['rtuId'] !== 'number') {
|
|
207
|
+
return Number.isInteger(Number(jsonObject['rtuId'])) ? Number(jsonObject['rtuId']) : Math.floor(Number(jsonObject['rtuId']));
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
return Number.isInteger(jsonObject['rtuId']) ? jsonObject['rtuId'] : Math.floor(jsonObject['rtuId']);
|
|
211
|
+
}();
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
if ('name' in jsonObject) {
|
|
215
|
+
model.name = function () {
|
|
216
|
+
if (typeof jsonObject['name'] !== 'string') {
|
|
217
|
+
return String(jsonObject['name']);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
return jsonObject['name'];
|
|
221
|
+
}();
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
if ('points' in jsonObject) {
|
|
225
|
+
model.points = function () {
|
|
226
|
+
var pointsObject = {};
|
|
227
|
+
|
|
228
|
+
if (_typeof(jsonObject['points']) === 'object' && 'disabled' in jsonObject['points']) {
|
|
229
|
+
pointsObject.disabled = function () {
|
|
230
|
+
if (typeof jsonObject['points'].disabled !== 'number') {
|
|
231
|
+
return Number.isInteger(Number(jsonObject['points'].disabled)) ? Number(jsonObject['points'].disabled) : Math.floor(Number(jsonObject['points'].disabled));
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
return Number.isInteger(jsonObject['points'].disabled) ? jsonObject['points'].disabled : Math.floor(jsonObject['points'].disabled);
|
|
235
|
+
}();
|
|
236
|
+
} else {
|
|
237
|
+
pointsObject.disabled = 0;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
return pointsObject;
|
|
241
|
+
}();
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
if ('labId' in jsonObject) {
|
|
245
|
+
model.labId = function () {
|
|
246
|
+
if (typeof jsonObject['labId'] !== 'string') {
|
|
247
|
+
return String(jsonObject['labId']);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
return jsonObject['labId'];
|
|
251
|
+
}();
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
if ('verticalLevels' in jsonObject) {
|
|
255
|
+
model.verticalLevels = function () {
|
|
256
|
+
if (Array.isArray(jsonObject['verticalLevels']) !== true) {
|
|
257
|
+
return [];
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
return jsonObject['verticalLevels'].map(function (verticalLevelsItem) {
|
|
261
|
+
return function () {
|
|
262
|
+
var verticalLevelsItemObject = {};
|
|
263
|
+
|
|
264
|
+
if (_typeof(verticalLevelsItem) === 'object' && 'name' in verticalLevelsItem) {
|
|
265
|
+
verticalLevelsItemObject.name = function () {
|
|
266
|
+
if (typeof verticalLevelsItem.name !== 'string') {
|
|
267
|
+
return String(verticalLevelsItem.name);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
return verticalLevelsItem.name;
|
|
271
|
+
}();
|
|
272
|
+
} else {
|
|
273
|
+
verticalLevelsItemObject.name = "";
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
return verticalLevelsItemObject;
|
|
277
|
+
}();
|
|
278
|
+
});
|
|
279
|
+
}();
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
if ('invertVerticalLevels' in jsonObject) {
|
|
283
|
+
model.invertVerticalLevels = function () {
|
|
284
|
+
if (typeof jsonObject['invertVerticalLevels'] !== 'boolean') {
|
|
285
|
+
return Boolean(jsonObject['invertVerticalLevels']);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
return jsonObject['invertVerticalLevels'];
|
|
289
|
+
}();
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
if ('horizontalPositions' in jsonObject) {
|
|
293
|
+
model.horizontalPositions = function () {
|
|
294
|
+
if (Array.isArray(jsonObject['horizontalPositions']) !== true) {
|
|
295
|
+
return [];
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
return jsonObject['horizontalPositions'].map(function (horizontalPositionsItem) {
|
|
299
|
+
return function () {
|
|
300
|
+
var horizontalPositionsItemObject = {};
|
|
301
|
+
|
|
302
|
+
if (_typeof(horizontalPositionsItem) === 'object' && 'name' in horizontalPositionsItem) {
|
|
303
|
+
horizontalPositionsItemObject.name = function () {
|
|
304
|
+
if (typeof horizontalPositionsItem.name !== 'string') {
|
|
305
|
+
return String(horizontalPositionsItem.name);
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
return horizontalPositionsItem.name;
|
|
309
|
+
}();
|
|
310
|
+
} else {
|
|
311
|
+
horizontalPositionsItemObject.name = "";
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
return horizontalPositionsItemObject;
|
|
315
|
+
}();
|
|
316
|
+
});
|
|
317
|
+
}();
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
if ('invertHorizontalPositions' in jsonObject) {
|
|
321
|
+
model.invertHorizontalPositions = function () {
|
|
322
|
+
if (typeof jsonObject['invertHorizontalPositions'] !== 'boolean') {
|
|
323
|
+
return Boolean(jsonObject['invertHorizontalPositions']);
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
return jsonObject['invertHorizontalPositions'];
|
|
327
|
+
}();
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
if ('deleted' in jsonObject) {
|
|
331
|
+
model.deleted = function () {
|
|
332
|
+
if (typeof jsonObject['deleted'] !== 'boolean') {
|
|
333
|
+
return Boolean(jsonObject['deleted']);
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
return jsonObject['deleted'];
|
|
337
|
+
}();
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
if ('updateTimestamp' in jsonObject) {
|
|
341
|
+
model.updateTimestamp = function () {
|
|
342
|
+
if (typeof jsonObject['updateTimestamp'] !== 'string') {
|
|
343
|
+
return new Date(String(jsonObject['updateTimestamp']));
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
return new Date(jsonObject['updateTimestamp']);
|
|
347
|
+
}();
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
return model;
|
|
351
|
+
}
|
|
352
|
+
}]);
|
|
353
|
+
|
|
354
|
+
return RackModel;
|
|
355
|
+
}(_BaseModel2.default);
|
|
356
|
+
|
|
357
|
+
var _default = RackModel;
|
|
358
|
+
exports.default = _default;
|