@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.
Files changed (59) 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 +927 -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/CompacSizerController.js +2 -2
  13. package/lib/Controllers/Packhouse/Site/MAFSizerController.js +2 -2
  14. package/lib/Controllers/Packhouse/Site/ShiftController.js +304 -0
  15. package/lib/Controllers/index.js +9 -6
  16. package/lib/Models/Lab/Site/DehydratorModel.js +250 -0
  17. package/lib/Models/Lab/Site/FruitProfileModel.js +303 -0
  18. package/lib/Models/Lab/Site/LabModel.js +365 -0
  19. package/lib/Models/Lab/Site/RackModel.js +358 -0
  20. package/lib/Models/Lab/Site/RackPositionModel.js +525 -0
  21. package/lib/Models/Lab/Site/SampleFailureReasonModel.js +195 -0
  22. package/lib/Models/Lab/Site/SampleModel.js +545 -0
  23. package/lib/Models/Lab/Site/SampleResultModel.js +545 -0
  24. package/lib/Models/Lab/Site/index.js +46 -0
  25. package/lib/Models/Lab/index.js +25 -0
  26. package/lib/Models/Packhouse/Site/CompacSizerModel.js +18 -1
  27. package/lib/Models/Packhouse/Site/MAFSizerModel.js +18 -1
  28. package/lib/Models/index.js +7 -4
  29. package/lib/PackageVersion.js +1 -1
  30. package/lib/index.d.ts +10491 -7674
  31. package/package.json +1 -1
  32. package/src/Controllers/Lab/Site/DehydratorController.js +175 -0
  33. package/src/Controllers/Lab/Site/FruitProfileController.js +181 -0
  34. package/src/Controllers/Lab/Site/LabController.js +199 -0
  35. package/src/Controllers/Lab/Site/RackController.js +199 -0
  36. package/src/Controllers/Lab/Site/RackPositionController.js +184 -0
  37. package/src/Controllers/Lab/Site/SampleController.js +1067 -0
  38. package/src/Controllers/Lab/Site/SampleFailureReasonController.js +169 -0
  39. package/src/Controllers/Lab/Site/SampleResultController.js +1036 -0
  40. package/src/Controllers/Lab/Site/index.js +30 -0
  41. package/src/Controllers/Lab/index.js +16 -0
  42. package/src/Controllers/Packhouse/Site/CompacSizerController.js +2 -2
  43. package/src/Controllers/Packhouse/Site/MAFSizerController.js +2 -2
  44. package/src/Controllers/Packhouse/Site/ShiftController.js +367 -0
  45. package/src/Controllers/index.js +2 -0
  46. package/src/Models/Lab/Site/DehydratorModel.js +234 -0
  47. package/src/Models/Lab/Site/FruitProfileModel.js +290 -0
  48. package/src/Models/Lab/Site/LabModel.js +372 -0
  49. package/src/Models/Lab/Site/RackModel.js +358 -0
  50. package/src/Models/Lab/Site/RackPositionModel.js +600 -0
  51. package/src/Models/Lab/Site/SampleFailureReasonModel.js +170 -0
  52. package/src/Models/Lab/Site/SampleModel.js +565 -0
  53. package/src/Models/Lab/Site/SampleResultModel.js +565 -0
  54. package/src/Models/Lab/Site/index.js +30 -0
  55. package/src/Models/Lab/index.js +16 -0
  56. package/src/Models/Packhouse/Site/CompacSizerModel.js +24 -1
  57. package/src/Models/Packhouse/Site/MAFSizerModel.js +24 -1
  58. package/src/Models/index.js +2 -0
  59. package/src/PackageVersion.js +1 -1
@@ -0,0 +1,222 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _RequestHelper = _interopRequireDefault(require("../../../RequestHelper"));
9
+
10
+ var _RackModel = _interopRequireDefault(require("../../../Models/Lab/Site/RackModel"));
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: 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
+ /**
21
+ * Controller Class for Racks
22
+ *
23
+ * @class
24
+ */
25
+ var RackController = /*#__PURE__*/function () {
26
+ function RackController() {
27
+ _classCallCheck(this, RackController);
28
+ }
29
+
30
+ _createClass(RackController, null, [{
31
+ key: "getOne",
32
+ value:
33
+ /**
34
+ * Retrieve a Rack [GET /lab/sites/{siteId}/racks/{id}]
35
+ *
36
+ * @static
37
+ * @public
38
+ * @param {number} siteId The Site ID
39
+ * @param {string} id The Rack ID
40
+ * @return {Promise<RackModel>}
41
+ */
42
+ function getOne(siteId, id) {
43
+ return new Promise(function (resolve, reject) {
44
+ _RequestHelper.default.getRequest("/lab/sites/".concat(siteId, "/racks/").concat(id)).then(function (result) {
45
+ var resolveValue = function () {
46
+ return _RackModel.default.fromJSON(result, siteId);
47
+ }();
48
+
49
+ resolve(resolveValue);
50
+ }).catch(function (error) {
51
+ return reject(error);
52
+ });
53
+ });
54
+ }
55
+ /**
56
+ * Update a Rack [PATCH /lab/sites/{siteId}/racks/{id}]
57
+ *
58
+ * @static
59
+ * @public
60
+ * @param {number} siteId The Site ID
61
+ * @param {string} id The Rack ID
62
+ * @param {RackController.UpdateData} updateData The Rack Update Data
63
+ * @return {Promise<RackModel>}
64
+ */
65
+
66
+ }, {
67
+ key: "update",
68
+ value: function update(siteId, id, updateData) {
69
+ return new Promise(function (resolve, reject) {
70
+ _RequestHelper.default.patchRequest("/lab/sites/".concat(siteId, "/racks/").concat(id), updateData).then(function (result) {
71
+ var resolveValue = function () {
72
+ return _RackModel.default.fromJSON(result, siteId);
73
+ }();
74
+
75
+ resolve(resolveValue);
76
+ }).catch(function (error) {
77
+ return reject(error);
78
+ });
79
+ });
80
+ }
81
+ /**
82
+ * Delete a Rack [DELETE /lab/sites/{siteId}/racks/{id}]
83
+ *
84
+ * @static
85
+ * @public
86
+ * @param {number} siteId The Site ID
87
+ * @param {string} id The Rack ID
88
+ * @return {Promise<boolean>}
89
+ */
90
+
91
+ }, {
92
+ key: "delete",
93
+ value: function _delete(siteId, id) {
94
+ return new Promise(function (resolve, reject) {
95
+ _RequestHelper.default.deleteRequest("/lab/sites/".concat(siteId, "/racks/").concat(id)).then(function (result) {
96
+ resolve(result !== null && result !== void 0 ? result : true);
97
+ }).catch(function (error) {
98
+ return reject(error);
99
+ });
100
+ });
101
+ }
102
+ /**
103
+ * List all Racks [GET /lab/sites/{siteId}/racks]
104
+ *
105
+ * @static
106
+ * @public
107
+ * @param {number} siteId The Site ID
108
+ * @param {RackController.GetAllQueryParameters} [queryParameters] The Optional Query Parameters
109
+ * @return {Promise<RackModel[]>}
110
+ */
111
+
112
+ }, {
113
+ key: "getAll",
114
+ value: function getAll(siteId) {
115
+ var queryParameters = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
116
+ return new Promise(function (resolve, reject) {
117
+ _RequestHelper.default.getRequest("/lab/sites/".concat(siteId, "/racks"), queryParameters).then(function (result) {
118
+ var resolveValue = function () {
119
+ if (Array.isArray(result) !== true) {
120
+ return [];
121
+ }
122
+
123
+ return result.map(function (resultItem) {
124
+ return function () {
125
+ return _RackModel.default.fromJSON(resultItem, siteId);
126
+ }();
127
+ });
128
+ }();
129
+
130
+ resolve(resolveValue);
131
+ }).catch(function (error) {
132
+ return reject(error);
133
+ });
134
+ });
135
+ }
136
+ /**
137
+ * Create a Rack [POST /lab/sites/{siteId}/racks]
138
+ *
139
+ * @static
140
+ * @public
141
+ * @param {number} siteId The Site ID
142
+ * @param {RackController.CreateData} createData The Rack Create Data
143
+ * @return {Promise<RackModel>}
144
+ */
145
+
146
+ }, {
147
+ key: "create",
148
+ value: function create(siteId, createData) {
149
+ return new Promise(function (resolve, reject) {
150
+ _RequestHelper.default.postRequest("/lab/sites/".concat(siteId, "/racks"), createData).then(function (result) {
151
+ var resolveValue = function () {
152
+ return _RackModel.default.fromJSON(result, siteId);
153
+ }();
154
+
155
+ resolve(resolveValue);
156
+ }).catch(function (error) {
157
+ return reject(error);
158
+ });
159
+ });
160
+ }
161
+ }]);
162
+
163
+ return RackController;
164
+ }();
165
+
166
+ var _default = RackController;
167
+ /**
168
+ * The Optional Query Parameters for the getAll Function
169
+ *
170
+ * @typedef {Object} RackController.GetAllQueryParameters
171
+ * @property {?number} [rtuId] The RTU this Rack belongs to
172
+ * @property {string} [name] The Name of this Rack
173
+ * @property {string} [labId] The Lab that owns this Rack
174
+ * @memberof Controllers.Lab.Site
175
+ */
176
+
177
+ /**
178
+ * The Create Data for a Rack
179
+ *
180
+ * @typedef {Object} RackController.CreateData
181
+ * @property {?number} [rtuId] The RTU this Rack belongs to
182
+ * @property {string} name The Name of this Rack
183
+ * @property {{disabled: number}} points The Points used by this Rack
184
+ * @property {string} labId The Lab that owns this Rack
185
+ * @property {Array<RackController.VerticalLevel>} [verticalLevels] The Vertical Levels Defined for this Rack
186
+ * @property {boolean} [invertVerticalLevels] Whether the Vertical Levels for this Rack should be Inverted. By Default, Vertical Levels go from the Lowest Level upwards
187
+ * @property {Array<RackController.HorizontalPosition>} [horizontalPositions] The Horizontal Positions defined for this Rack
188
+ * @property {boolean} [invertHorizontalPositions] Whether the Horizontal Positions for this Rack should be Inverted. By Default, Horizontal Positions go from Left to Right
189
+ * @memberof Controllers.Lab.Site
190
+ */
191
+
192
+ /**
193
+ * The Update Data for a Rack
194
+ *
195
+ * @typedef {Object} RackController.UpdateData
196
+ * @property {string} [name] The Name of this Rack
197
+ * @property {{disabled: number}} [points] The Points used by this Rack
198
+ * @property {string} [labId] The Lab that owns this Rack
199
+ * @property {Array<RackController.VerticalLevel>} [verticalLevels] The Vertical Levels Defined for this Rack
200
+ * @property {boolean} [invertVerticalLevels] Whether the Vertical Levels for this Rack should be Inverted. By Default, Vertical Levels go from the Lowest Level upwards
201
+ * @property {Array<RackController.HorizontalPosition>} [horizontalPositions] The Horizontal Positions defined for this Rack
202
+ * @property {boolean} [invertHorizontalPositions] Whether the Horizontal Positions for this Rack should be Inverted. By Default, Horizontal Positions go from Left to Right
203
+ * @memberof Controllers.Lab.Site
204
+ */
205
+
206
+ /**
207
+ * A **VerticalLevel** Type
208
+ *
209
+ * @typedef {Object} RackController.VerticalLevel
210
+ * @property {string} name A Name for this Vertical Level
211
+ * @memberof Controllers.Lab.Site
212
+ */
213
+
214
+ /**
215
+ * A **HorizontalPosition** Type
216
+ *
217
+ * @typedef {Object} RackController.HorizontalPosition
218
+ * @property {string} name A Name for this Horizontal Position
219
+ * @memberof Controllers.Lab.Site
220
+ */
221
+
222
+ exports.default = _default;
@@ -0,0 +1,207 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _RequestHelper = _interopRequireDefault(require("../../../RequestHelper"));
9
+
10
+ var _RackPositionModel = _interopRequireDefault(require("../../../Models/Lab/Site/RackPositionModel"));
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: 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
+ /**
21
+ * Controller Class for Rack Positions
22
+ *
23
+ * @class
24
+ */
25
+ var RackPositionController = /*#__PURE__*/function () {
26
+ function RackPositionController() {
27
+ _classCallCheck(this, RackPositionController);
28
+ }
29
+
30
+ _createClass(RackPositionController, null, [{
31
+ key: "getOne",
32
+ value:
33
+ /**
34
+ * Retrieve a Rack Position [GET /lab/sites/{siteId}/rack-positions/{id}]
35
+ *
36
+ * @static
37
+ * @public
38
+ * @param {number} siteId The Site ID
39
+ * @param {string} id The Rack Position ID
40
+ * @return {Promise<RackPositionModel>}
41
+ */
42
+ function getOne(siteId, id) {
43
+ return new Promise(function (resolve, reject) {
44
+ _RequestHelper.default.getRequest("/lab/sites/".concat(siteId, "/rack-positions/").concat(id)).then(function (result) {
45
+ var resolveValue = function () {
46
+ return _RackPositionModel.default.fromJSON(result, siteId);
47
+ }();
48
+
49
+ resolve(resolveValue);
50
+ }).catch(function (error) {
51
+ return reject(error);
52
+ });
53
+ });
54
+ }
55
+ /**
56
+ * Update a Rack Position [PATCH /lab/sites/{siteId}/rack-positions/{id}]
57
+ *
58
+ * @static
59
+ * @public
60
+ * @param {number} siteId The Site ID
61
+ * @param {string} id The Rack Position ID
62
+ * @param {RackPositionController.UpdateData} updateData The Rack Position Update Data
63
+ * @return {Promise<RackPositionModel>}
64
+ */
65
+
66
+ }, {
67
+ key: "update",
68
+ value: function update(siteId, id, updateData) {
69
+ return new Promise(function (resolve, reject) {
70
+ _RequestHelper.default.patchRequest("/lab/sites/".concat(siteId, "/rack-positions/").concat(id), updateData).then(function (result) {
71
+ var resolveValue = function () {
72
+ return _RackPositionModel.default.fromJSON(result, siteId);
73
+ }();
74
+
75
+ resolve(resolveValue);
76
+ }).catch(function (error) {
77
+ return reject(error);
78
+ });
79
+ });
80
+ }
81
+ /**
82
+ * Delete a Rack Position [DELETE /lab/sites/{siteId}/rack-positions/{id}]
83
+ *
84
+ * @static
85
+ * @public
86
+ * @param {number} siteId The Site ID
87
+ * @param {string} id The Rack Position ID
88
+ * @return {Promise<boolean>}
89
+ */
90
+
91
+ }, {
92
+ key: "delete",
93
+ value: function _delete(siteId, id) {
94
+ return new Promise(function (resolve, reject) {
95
+ _RequestHelper.default.deleteRequest("/lab/sites/".concat(siteId, "/rack-positions/").concat(id)).then(function (result) {
96
+ resolve(result !== null && result !== void 0 ? result : true);
97
+ }).catch(function (error) {
98
+ return reject(error);
99
+ });
100
+ });
101
+ }
102
+ /**
103
+ * List all Rack Positions [GET /lab/sites/{siteId}/rack-positions]
104
+ *
105
+ * @static
106
+ * @public
107
+ * @param {number} siteId The Site ID
108
+ * @param {RackPositionController.GetAllQueryParameters} [queryParameters] The Optional Query Parameters
109
+ * @return {Promise<RackPositionModel[]>}
110
+ */
111
+
112
+ }, {
113
+ key: "getAll",
114
+ value: function getAll(siteId) {
115
+ var queryParameters = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
116
+ return new Promise(function (resolve, reject) {
117
+ _RequestHelper.default.getRequest("/lab/sites/".concat(siteId, "/rack-positions"), queryParameters).then(function (result) {
118
+ var resolveValue = function () {
119
+ if (Array.isArray(result) !== true) {
120
+ return [];
121
+ }
122
+
123
+ return result.map(function (resultItem) {
124
+ return function () {
125
+ return _RackPositionModel.default.fromJSON(resultItem, siteId);
126
+ }();
127
+ });
128
+ }();
129
+
130
+ resolve(resolveValue);
131
+ }).catch(function (error) {
132
+ return reject(error);
133
+ });
134
+ });
135
+ }
136
+ /**
137
+ * Create a Rack Position [POST /lab/sites/{siteId}/rack-positions]
138
+ *
139
+ * @static
140
+ * @public
141
+ * @param {number} siteId The Site ID
142
+ * @param {RackPositionController.CreateData} createData The Rack Position Create Data
143
+ * @return {Promise<RackPositionModel>}
144
+ */
145
+
146
+ }, {
147
+ key: "create",
148
+ value: function create(siteId, createData) {
149
+ return new Promise(function (resolve, reject) {
150
+ _RequestHelper.default.postRequest("/lab/sites/".concat(siteId, "/rack-positions"), createData).then(function (result) {
151
+ var resolveValue = function () {
152
+ return _RackPositionModel.default.fromJSON(result, siteId);
153
+ }();
154
+
155
+ resolve(resolveValue);
156
+ }).catch(function (error) {
157
+ return reject(error);
158
+ });
159
+ });
160
+ }
161
+ }]);
162
+
163
+ return RackPositionController;
164
+ }();
165
+
166
+ var _default = RackPositionController;
167
+ /**
168
+ * The Optional Query Parameters for the getAll Function
169
+ *
170
+ * @typedef {Object} RackPositionController.GetAllQueryParameters
171
+ * @property {?number} [rtuId] The RTU this Rack Position belongs to
172
+ * @property {string} [name] The Name of this Rack Position
173
+ * @property {string} [labId] The Lab that owns this Rack Position
174
+ * @property {string} [rackId] The Rack associated with this Rack Position
175
+ * @property {number} [verticalLevelIndex] The Index of the Vertical Level in the Rack where this Position resides
176
+ * @property {number} [horizontalPositionIndex] The Index of the Horizontal Position in the Rack where this Position resides
177
+ * @memberof Controllers.Lab.Site
178
+ */
179
+
180
+ /**
181
+ * The Create Data for a Rack Position
182
+ *
183
+ * @typedef {Object} RackPositionController.CreateData
184
+ * @property {?number} [rtuId] The RTU this Rack Position belongs to
185
+ * @property {string} name The Name of this Rack Position
186
+ * @property {{pushButton: number, indicatorLight: number, temperature: number, calibrationOffset: number, disabled: number, currentSampleId: number, currentSampleStatus: number, nextSampleId: number, startCurrentSampleRequest: number, finishCurrentSampleRequest: number, currentSampleTotalDuration: number, currentSampleWarmUpDuration: number, currentSampleWarmUpCompleted: number, currentSampleBelowTargetDuration: number, currentSampleAboveTargetDuration: number, currentSampleWithinTargetDuration: number, currentSampleSuccessCriteriaMet: number, currentSampleFailureCriteriaMet: number}} points The Points used by this Rack Position
187
+ * @property {string} labId The Lab that owns this Rack Position
188
+ * @property {string} rackId The Rack associated with this Rack Position
189
+ * @property {number} verticalLevelIndex The Index of the Vertical Level in the Rack where this Position resides
190
+ * @property {number} horizontalPositionIndex The Index of the Horizontal Position in the Rack where this Position resides
191
+ * @memberof Controllers.Lab.Site
192
+ */
193
+
194
+ /**
195
+ * The Update Data for a Rack Position
196
+ *
197
+ * @typedef {Object} RackPositionController.UpdateData
198
+ * @property {string} [name] The Name of this Rack Position
199
+ * @property {{pushButton: number, indicatorLight: number, temperature: number, calibrationOffset: number, disabled: number, currentSampleId: number, currentSampleStatus: number, nextSampleId: number, startCurrentSampleRequest: number, finishCurrentSampleRequest: number, currentSampleTotalDuration: number, currentSampleWarmUpDuration: number, currentSampleWarmUpCompleted: number, currentSampleBelowTargetDuration: number, currentSampleAboveTargetDuration: number, currentSampleWithinTargetDuration: number, currentSampleSuccessCriteriaMet: number, currentSampleFailureCriteriaMet: number}} [points] The Points used by this Rack Position
200
+ * @property {string} [labId] The Lab that owns this Rack Position
201
+ * @property {string} [rackId] The Rack associated with this Rack Position
202
+ * @property {number} [verticalLevelIndex] The Index of the Vertical Level in the Rack where this Position resides
203
+ * @property {number} [horizontalPositionIndex] The Index of the Horizontal Position in the Rack where this Position resides
204
+ * @memberof Controllers.Lab.Site
205
+ */
206
+
207
+ exports.default = _default;