@ricado/api-client 2.3.28 → 2.4.1

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.
Files changed (51) hide show
  1. package/dist/ricado.api.client.js +1 -1
  2. package/lib/Controllers/Lab/Site/DehydratorController.js +198 -0
  3. package/lib/Controllers/Lab/Site/FruitProfileController.js +204 -0
  4. package/lib/Controllers/Lab/Site/LabController.js +222 -0
  5. package/lib/Controllers/Lab/Site/RackController.js +222 -0
  6. package/lib/Controllers/Lab/Site/RackPositionController.js +207 -0
  7. package/lib/Controllers/Lab/Site/SampleController.js +1023 -0
  8. package/lib/Controllers/Lab/Site/SampleFailureReasonController.js +192 -0
  9. package/lib/Controllers/Lab/Site/SampleResultController.js +905 -0
  10. package/lib/Controllers/Lab/Site/index.js +46 -0
  11. package/lib/Controllers/Lab/index.js +25 -0
  12. package/lib/Controllers/Packhouse/Site/ShiftController.js +304 -0
  13. package/lib/Controllers/index.js +9 -6
  14. package/lib/Models/Lab/Site/DehydratorModel.js +250 -0
  15. package/lib/Models/Lab/Site/FruitProfileModel.js +303 -0
  16. package/lib/Models/Lab/Site/LabModel.js +365 -0
  17. package/lib/Models/Lab/Site/RackModel.js +358 -0
  18. package/lib/Models/Lab/Site/RackPositionModel.js +525 -0
  19. package/lib/Models/Lab/Site/SampleFailureReasonModel.js +195 -0
  20. package/lib/Models/Lab/Site/SampleModel.js +545 -0
  21. package/lib/Models/Lab/Site/SampleResultModel.js +545 -0
  22. package/lib/Models/Lab/Site/index.js +46 -0
  23. package/lib/Models/Lab/index.js +25 -0
  24. package/lib/Models/index.js +7 -4
  25. package/lib/PackageVersion.js +1 -1
  26. package/lib/index.d.ts +10441 -7526
  27. package/package.json +1 -1
  28. package/src/Controllers/Lab/Site/DehydratorController.js +175 -0
  29. package/src/Controllers/Lab/Site/FruitProfileController.js +181 -0
  30. package/src/Controllers/Lab/Site/LabController.js +199 -0
  31. package/src/Controllers/Lab/Site/RackController.js +199 -0
  32. package/src/Controllers/Lab/Site/RackPositionController.js +184 -0
  33. package/src/Controllers/Lab/Site/SampleController.js +1160 -0
  34. package/src/Controllers/Lab/Site/SampleFailureReasonController.js +169 -0
  35. package/src/Controllers/Lab/Site/SampleResultController.js +1036 -0
  36. package/src/Controllers/Lab/Site/index.js +30 -0
  37. package/src/Controllers/Lab/index.js +16 -0
  38. package/src/Controllers/Packhouse/Site/ShiftController.js +367 -0
  39. package/src/Controllers/index.js +2 -0
  40. package/src/Models/Lab/Site/DehydratorModel.js +234 -0
  41. package/src/Models/Lab/Site/FruitProfileModel.js +290 -0
  42. package/src/Models/Lab/Site/LabModel.js +372 -0
  43. package/src/Models/Lab/Site/RackModel.js +358 -0
  44. package/src/Models/Lab/Site/RackPositionModel.js +600 -0
  45. package/src/Models/Lab/Site/SampleFailureReasonModel.js +170 -0
  46. package/src/Models/Lab/Site/SampleModel.js +565 -0
  47. package/src/Models/Lab/Site/SampleResultModel.js +565 -0
  48. package/src/Models/Lab/Site/index.js +30 -0
  49. package/src/Models/Lab/index.js +16 -0
  50. package/src/Models/index.js +2 -0
  51. package/src/PackageVersion.js +1 -1
@@ -0,0 +1,290 @@
1
+ /**
2
+ * File Auto-Generated by the RICADO Gen 4 PHP API Project
3
+ *
4
+ * Do Not Edit this File Manually!
5
+ */
6
+
7
+ import BaseModel from '../../../Models/BaseModel';
8
+
9
+ /**
10
+ * Model Class for a Fruit Profile
11
+ *
12
+ * @class
13
+ * @hideconstructor
14
+ * @extends BaseModel
15
+ */
16
+ class FruitProfileModel extends BaseModel
17
+ {
18
+ /**
19
+ * FruitProfileModel Constructor
20
+ *
21
+ * @protected
22
+ * @param {number} siteId The Site ID associated with this Fruit Profile
23
+ */
24
+ constructor(siteId)
25
+ {
26
+ super();
27
+
28
+ /**
29
+ * The Fruit Profile ID
30
+ *
31
+ * @type {string}
32
+ * @public
33
+ */
34
+ this.id = "";
35
+
36
+ /**
37
+ * The Fruit Profile Name
38
+ *
39
+ * @type {string}
40
+ * @public
41
+ */
42
+ this.name = "";
43
+
44
+ /**
45
+ * The Fruit Profile Description
46
+ *
47
+ * @type {string}
48
+ * @public
49
+ */
50
+ this.description = "";
51
+
52
+ /**
53
+ * The Fruit Profile Image Source
54
+ *
55
+ * @type {string}
56
+ * @public
57
+ */
58
+ this.image = "";
59
+
60
+ /**
61
+ * The Typical Warm Up Duration (in seconds) for a Sample to reach the Minimum Target Temperature
62
+ *
63
+ * @type {number}
64
+ * @public
65
+ */
66
+ this.nominalWarmUpDuration = 0;
67
+
68
+ /**
69
+ * The Minimum Duration (in seconds) that a Sample should be within the Min and Max Target Temperatures be Successful
70
+ *
71
+ * @type {number}
72
+ * @public
73
+ */
74
+ this.minimumWithinTargetDuration = 0;
75
+
76
+ /**
77
+ * The Maximum Duration (in seconds) that a Sample should be Dehydrated for before it Fails
78
+ *
79
+ * @type {number}
80
+ * @public
81
+ */
82
+ this.maximumTotalDuration = 0;
83
+
84
+ /**
85
+ * The Minimum Target Temperature for a Sample to be Successful
86
+ *
87
+ * @type {number}
88
+ * @public
89
+ */
90
+ this.minimumTargetTemperature = 0;
91
+
92
+ /**
93
+ * The Maximum Target Temperature for a Sample to be Successful
94
+ *
95
+ * @type {number}
96
+ * @public
97
+ */
98
+ this.maximumTargetTemperature = 0;
99
+
100
+ /**
101
+ * Whether the Fruit Profile has been deleted
102
+ *
103
+ * @type {boolean}
104
+ * @public
105
+ */
106
+ this.deleted = false;
107
+
108
+ /**
109
+ * When the Fruit Profile was last updated
110
+ *
111
+ * @type {Date}
112
+ * @public
113
+ */
114
+ this.updateTimestamp = new Date();
115
+
116
+ /**
117
+ * The Site ID associated with this Fruit Profile
118
+ *
119
+ * @type {number}
120
+ * @public
121
+ */
122
+ this.siteId = siteId;
123
+ }
124
+
125
+ /**
126
+ * Create a new **FruitProfileModel** from a JSON Object or JSON String
127
+ *
128
+ * @static
129
+ * @public
130
+ * @param {Object<string, any>|string} json A JSON Object or JSON String
131
+ * @param {number} siteId The Site ID associated with this Fruit Profile
132
+ * @return {FruitProfileModel}
133
+ */
134
+ static fromJSON(json, siteId)
135
+ {
136
+ let model = new FruitProfileModel(siteId);
137
+
138
+ /**
139
+ * The JSON Object
140
+ *
141
+ * @type {Object<string, any>}
142
+ */
143
+ let jsonObject = {};
144
+
145
+ if(typeof json === 'string')
146
+ {
147
+ jsonObject = JSON.parse(json);
148
+ }
149
+ else if(typeof json === 'object')
150
+ {
151
+ jsonObject = json;
152
+ }
153
+
154
+ if('id' in jsonObject)
155
+ {
156
+ model.id = (function(){
157
+ if(typeof jsonObject['id'] !== 'string')
158
+ {
159
+ return String(jsonObject['id']);
160
+ }
161
+
162
+ return jsonObject['id'];
163
+ }());
164
+ }
165
+
166
+ if('name' in jsonObject)
167
+ {
168
+ model.name = (function(){
169
+ if(typeof jsonObject['name'] !== 'string')
170
+ {
171
+ return String(jsonObject['name']);
172
+ }
173
+
174
+ return jsonObject['name'];
175
+ }());
176
+ }
177
+
178
+ if('description' in jsonObject)
179
+ {
180
+ model.description = (function(){
181
+ if(typeof jsonObject['description'] !== 'string')
182
+ {
183
+ return String(jsonObject['description']);
184
+ }
185
+
186
+ return jsonObject['description'];
187
+ }());
188
+ }
189
+
190
+ if('image' in jsonObject)
191
+ {
192
+ model.image = (function(){
193
+ if(typeof jsonObject['image'] !== 'string')
194
+ {
195
+ return String(jsonObject['image']);
196
+ }
197
+
198
+ return jsonObject['image'];
199
+ }());
200
+ }
201
+
202
+ if('nominalWarmUpDuration' in jsonObject)
203
+ {
204
+ model.nominalWarmUpDuration = (function(){
205
+ if(typeof jsonObject['nominalWarmUpDuration'] !== 'number')
206
+ {
207
+ return Number.isInteger(Number(jsonObject['nominalWarmUpDuration'])) ? Number(jsonObject['nominalWarmUpDuration']) : Math.floor(Number(jsonObject['nominalWarmUpDuration']));
208
+ }
209
+
210
+ return Number.isInteger(jsonObject['nominalWarmUpDuration']) ? jsonObject['nominalWarmUpDuration'] : Math.floor(jsonObject['nominalWarmUpDuration']);
211
+ }());
212
+ }
213
+
214
+ if('minimumWithinTargetDuration' in jsonObject)
215
+ {
216
+ model.minimumWithinTargetDuration = (function(){
217
+ if(typeof jsonObject['minimumWithinTargetDuration'] !== 'number')
218
+ {
219
+ return Number.isInteger(Number(jsonObject['minimumWithinTargetDuration'])) ? Number(jsonObject['minimumWithinTargetDuration']) : Math.floor(Number(jsonObject['minimumWithinTargetDuration']));
220
+ }
221
+
222
+ return Number.isInteger(jsonObject['minimumWithinTargetDuration']) ? jsonObject['minimumWithinTargetDuration'] : Math.floor(jsonObject['minimumWithinTargetDuration']);
223
+ }());
224
+ }
225
+
226
+ if('maximumTotalDuration' in jsonObject)
227
+ {
228
+ model.maximumTotalDuration = (function(){
229
+ if(typeof jsonObject['maximumTotalDuration'] !== 'number')
230
+ {
231
+ return Number.isInteger(Number(jsonObject['maximumTotalDuration'])) ? Number(jsonObject['maximumTotalDuration']) : Math.floor(Number(jsonObject['maximumTotalDuration']));
232
+ }
233
+
234
+ return Number.isInteger(jsonObject['maximumTotalDuration']) ? jsonObject['maximumTotalDuration'] : Math.floor(jsonObject['maximumTotalDuration']);
235
+ }());
236
+ }
237
+
238
+ if('minimumTargetTemperature' in jsonObject)
239
+ {
240
+ model.minimumTargetTemperature = (function(){
241
+ if(typeof jsonObject['minimumTargetTemperature'] !== 'number')
242
+ {
243
+ return Number(jsonObject['minimumTargetTemperature']);
244
+ }
245
+
246
+ return jsonObject['minimumTargetTemperature'];
247
+ }());
248
+ }
249
+
250
+ if('maximumTargetTemperature' in jsonObject)
251
+ {
252
+ model.maximumTargetTemperature = (function(){
253
+ if(typeof jsonObject['maximumTargetTemperature'] !== 'number')
254
+ {
255
+ return Number(jsonObject['maximumTargetTemperature']);
256
+ }
257
+
258
+ return jsonObject['maximumTargetTemperature'];
259
+ }());
260
+ }
261
+
262
+ if('deleted' in jsonObject)
263
+ {
264
+ model.deleted = (function(){
265
+ if(typeof jsonObject['deleted'] !== 'boolean')
266
+ {
267
+ return Boolean(jsonObject['deleted']);
268
+ }
269
+
270
+ return jsonObject['deleted'];
271
+ }());
272
+ }
273
+
274
+ if('updateTimestamp' in jsonObject)
275
+ {
276
+ model.updateTimestamp = (function(){
277
+ if(typeof jsonObject['updateTimestamp'] !== 'string')
278
+ {
279
+ return new Date(String(jsonObject['updateTimestamp']));
280
+ }
281
+
282
+ return new Date(jsonObject['updateTimestamp']);
283
+ }());
284
+ }
285
+
286
+ return model;
287
+ }
288
+ }
289
+
290
+ export default FruitProfileModel;
@@ -0,0 +1,372 @@
1
+ /**
2
+ * File Auto-Generated by the RICADO Gen 4 PHP API Project
3
+ *
4
+ * Do Not Edit this File Manually!
5
+ */
6
+
7
+ import BaseModel from '../../../Models/BaseModel';
8
+
9
+ /**
10
+ * Model Class for a Lab
11
+ *
12
+ * @class
13
+ * @hideconstructor
14
+ * @extends BaseModel
15
+ */
16
+ class LabModel extends BaseModel
17
+ {
18
+ /**
19
+ * LabModel Constructor
20
+ *
21
+ * @protected
22
+ * @param {number} siteId The Site ID associated with this Lab
23
+ */
24
+ constructor(siteId)
25
+ {
26
+ super();
27
+
28
+ /**
29
+ * The Lab ID
30
+ *
31
+ * @type {string}
32
+ * @public
33
+ */
34
+ this.id = "";
35
+
36
+ /**
37
+ * The RTU this Lab belongs to
38
+ *
39
+ * @type {?number}
40
+ * @public
41
+ */
42
+ this.rtuId = null;
43
+
44
+ /**
45
+ * The Lab Name
46
+ *
47
+ * @type {string}
48
+ * @public
49
+ */
50
+ this.name = "";
51
+
52
+ /**
53
+ * A Short Name for the Lab Name. Typically used in Reports and Tables showing multiple Labs
54
+ *
55
+ * @type {string}
56
+ * @public
57
+ */
58
+ this.shortName = "";
59
+
60
+ /**
61
+ * The Points used by this Lab
62
+ *
63
+ * @type {Object}
64
+ * @public
65
+ */
66
+ this.points = {}
67
+
68
+ /**
69
+ * The Rack Objects that belong to this Lab
70
+ *
71
+ * @type {Array<{id: string, displayOrder: number}>}
72
+ * @public
73
+ */
74
+ this.racks = [];
75
+
76
+ /**
77
+ * The Alarm Groups that are used by this Lab
78
+ *
79
+ * @type {string[]}
80
+ * @public
81
+ */
82
+ this.alarmGroups = [];
83
+
84
+ /**
85
+ * The Inspect Integration Configuration for this Lab
86
+ *
87
+ * @type {?{points: Object, enabled: boolean, apiBaseUrl: string}}
88
+ * @public
89
+ */
90
+ this.inspectIntegration = null;
91
+
92
+ /**
93
+ * Whether the Lab has been deleted
94
+ *
95
+ * @type {boolean}
96
+ * @public
97
+ */
98
+ this.deleted = false;
99
+
100
+ /**
101
+ * When the Lab was last updated
102
+ *
103
+ * @type {Date}
104
+ * @public
105
+ */
106
+ this.updateTimestamp = new Date();
107
+
108
+ /**
109
+ * The Site ID associated with this Lab
110
+ *
111
+ * @type {number}
112
+ * @public
113
+ */
114
+ this.siteId = siteId;
115
+ }
116
+
117
+ /**
118
+ * Create a new **LabModel** from a JSON Object or JSON String
119
+ *
120
+ * @static
121
+ * @public
122
+ * @param {Object<string, any>|string} json A JSON Object or JSON String
123
+ * @param {number} siteId The Site ID associated with this Lab
124
+ * @return {LabModel}
125
+ */
126
+ static fromJSON(json, siteId)
127
+ {
128
+ let model = new LabModel(siteId);
129
+
130
+ /**
131
+ * The JSON Object
132
+ *
133
+ * @type {Object<string, any>}
134
+ */
135
+ let jsonObject = {};
136
+
137
+ if(typeof json === 'string')
138
+ {
139
+ jsonObject = JSON.parse(json);
140
+ }
141
+ else if(typeof json === 'object')
142
+ {
143
+ jsonObject = json;
144
+ }
145
+
146
+ if('id' in jsonObject)
147
+ {
148
+ model.id = (function(){
149
+ if(typeof jsonObject['id'] !== 'string')
150
+ {
151
+ return String(jsonObject['id']);
152
+ }
153
+
154
+ return jsonObject['id'];
155
+ }());
156
+ }
157
+
158
+ if('rtuId' in jsonObject)
159
+ {
160
+ model.rtuId = (function(){
161
+ if(jsonObject['rtuId'] === null)
162
+ {
163
+ return null;
164
+ }
165
+
166
+ if(typeof jsonObject['rtuId'] !== 'number')
167
+ {
168
+ return Number.isInteger(Number(jsonObject['rtuId'])) ? Number(jsonObject['rtuId']) : Math.floor(Number(jsonObject['rtuId']));
169
+ }
170
+
171
+ return Number.isInteger(jsonObject['rtuId']) ? jsonObject['rtuId'] : Math.floor(jsonObject['rtuId']);
172
+ }());
173
+ }
174
+
175
+ if('name' in jsonObject)
176
+ {
177
+ model.name = (function(){
178
+ if(typeof jsonObject['name'] !== 'string')
179
+ {
180
+ return String(jsonObject['name']);
181
+ }
182
+
183
+ return jsonObject['name'];
184
+ }());
185
+ }
186
+
187
+ if('shortName' in jsonObject)
188
+ {
189
+ model.shortName = (function(){
190
+ if(typeof jsonObject['shortName'] !== 'string')
191
+ {
192
+ return String(jsonObject['shortName']);
193
+ }
194
+
195
+ return jsonObject['shortName'];
196
+ }());
197
+ }
198
+
199
+ if('points' in jsonObject)
200
+ {
201
+ model.points = (function(){
202
+ if(typeof jsonObject['points'] !== 'object')
203
+ {
204
+ return Object(jsonObject['points']);
205
+ }
206
+
207
+ return jsonObject['points'];
208
+ }());
209
+ }
210
+
211
+ if('racks' in jsonObject)
212
+ {
213
+ model.racks = (function(){
214
+ if(Array.isArray(jsonObject['racks']) !== true)
215
+ {
216
+ return [];
217
+ }
218
+
219
+ return jsonObject['racks'].map((racksItem) => {
220
+ return (function(){
221
+ let racksItemObject = {};
222
+
223
+ if(typeof racksItem === 'object' && 'id' in racksItem)
224
+ {
225
+ racksItemObject.id = (function(){
226
+ if(typeof racksItem.id !== 'string')
227
+ {
228
+ return String(racksItem.id);
229
+ }
230
+
231
+ return racksItem.id;
232
+ }());
233
+ }
234
+ else
235
+ {
236
+ racksItemObject.id = "";
237
+ }
238
+
239
+ if(typeof racksItem === 'object' && 'displayOrder' in racksItem)
240
+ {
241
+ racksItemObject.displayOrder = (function(){
242
+ if(typeof racksItem.displayOrder !== 'number')
243
+ {
244
+ return Number.isInteger(Number(racksItem.displayOrder)) ? Number(racksItem.displayOrder) : Math.floor(Number(racksItem.displayOrder));
245
+ }
246
+
247
+ return Number.isInteger(racksItem.displayOrder) ? racksItem.displayOrder : Math.floor(racksItem.displayOrder);
248
+ }());
249
+ }
250
+ else
251
+ {
252
+ racksItemObject.displayOrder = 0;
253
+ }
254
+
255
+ return racksItemObject;
256
+ }());
257
+ });
258
+ }());
259
+ }
260
+
261
+ if('alarmGroups' in jsonObject)
262
+ {
263
+ model.alarmGroups = (function(){
264
+ if(Array.isArray(jsonObject['alarmGroups']) !== true)
265
+ {
266
+ return [];
267
+ }
268
+
269
+ return jsonObject['alarmGroups'].map((alarmGroupsItem) => {
270
+ return (function(){
271
+ if(typeof alarmGroupsItem !== 'string')
272
+ {
273
+ return String(alarmGroupsItem);
274
+ }
275
+
276
+ return alarmGroupsItem;
277
+ }());
278
+ });
279
+ }());
280
+ }
281
+
282
+ if('inspectIntegration' in jsonObject)
283
+ {
284
+ model.inspectIntegration = (function(){
285
+ if(jsonObject['inspectIntegration'] === null)
286
+ {
287
+ return null;
288
+ }
289
+
290
+ let inspectIntegrationObject = {};
291
+
292
+ if(typeof jsonObject['inspectIntegration'] === 'object' && 'points' in jsonObject['inspectIntegration'])
293
+ {
294
+ inspectIntegrationObject.points = (function(){
295
+ if(typeof jsonObject['inspectIntegration'].points !== 'object')
296
+ {
297
+ return Object(jsonObject['inspectIntegration'].points);
298
+ }
299
+
300
+ return jsonObject['inspectIntegration'].points;
301
+ }());
302
+ }
303
+ else
304
+ {
305
+ inspectIntegrationObject.points = {}
306
+ }
307
+
308
+ if(typeof jsonObject['inspectIntegration'] === 'object' && 'enabled' in jsonObject['inspectIntegration'])
309
+ {
310
+ inspectIntegrationObject.enabled = (function(){
311
+ if(typeof jsonObject['inspectIntegration'].enabled !== 'boolean')
312
+ {
313
+ return Boolean(jsonObject['inspectIntegration'].enabled);
314
+ }
315
+
316
+ return jsonObject['inspectIntegration'].enabled;
317
+ }());
318
+ }
319
+ else
320
+ {
321
+ inspectIntegrationObject.enabled = false;
322
+ }
323
+
324
+ if(typeof jsonObject['inspectIntegration'] === 'object' && 'apiBaseUrl' in jsonObject['inspectIntegration'])
325
+ {
326
+ inspectIntegrationObject.apiBaseUrl = (function(){
327
+ if(typeof jsonObject['inspectIntegration'].apiBaseUrl !== 'string')
328
+ {
329
+ return String(jsonObject['inspectIntegration'].apiBaseUrl);
330
+ }
331
+
332
+ return jsonObject['inspectIntegration'].apiBaseUrl;
333
+ }());
334
+ }
335
+ else
336
+ {
337
+ inspectIntegrationObject.apiBaseUrl = "";
338
+ }
339
+
340
+ return inspectIntegrationObject;
341
+ }());
342
+ }
343
+
344
+ if('deleted' in jsonObject)
345
+ {
346
+ model.deleted = (function(){
347
+ if(typeof jsonObject['deleted'] !== 'boolean')
348
+ {
349
+ return Boolean(jsonObject['deleted']);
350
+ }
351
+
352
+ return jsonObject['deleted'];
353
+ }());
354
+ }
355
+
356
+ if('updateTimestamp' in jsonObject)
357
+ {
358
+ model.updateTimestamp = (function(){
359
+ if(typeof jsonObject['updateTimestamp'] !== 'string')
360
+ {
361
+ return new Date(String(jsonObject['updateTimestamp']));
362
+ }
363
+
364
+ return new Date(jsonObject['updateTimestamp']);
365
+ }());
366
+ }
367
+
368
+ return model;
369
+ }
370
+ }
371
+
372
+ export default LabModel;