@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,198 @@
|
|
|
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 _DehydratorModel = _interopRequireDefault(require("../../../Models/Lab/Site/DehydratorModel"));
|
|
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 Dehydrators
|
|
22
|
+
*
|
|
23
|
+
* @class
|
|
24
|
+
*/
|
|
25
|
+
var DehydratorController = /*#__PURE__*/function () {
|
|
26
|
+
function DehydratorController() {
|
|
27
|
+
_classCallCheck(this, DehydratorController);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
_createClass(DehydratorController, null, [{
|
|
31
|
+
key: "getOne",
|
|
32
|
+
value:
|
|
33
|
+
/**
|
|
34
|
+
* Retrieve a Dehydrator [GET /lab/sites/{siteId}/dehydrators/{id}]
|
|
35
|
+
*
|
|
36
|
+
* @static
|
|
37
|
+
* @public
|
|
38
|
+
* @param {number} siteId The Site ID
|
|
39
|
+
* @param {string} id The Dehydrator ID
|
|
40
|
+
* @return {Promise<DehydratorModel>}
|
|
41
|
+
*/
|
|
42
|
+
function getOne(siteId, id) {
|
|
43
|
+
return new Promise(function (resolve, reject) {
|
|
44
|
+
_RequestHelper.default.getRequest("/lab/sites/".concat(siteId, "/dehydrators/").concat(id)).then(function (result) {
|
|
45
|
+
var resolveValue = function () {
|
|
46
|
+
return _DehydratorModel.default.fromJSON(result, siteId);
|
|
47
|
+
}();
|
|
48
|
+
|
|
49
|
+
resolve(resolveValue);
|
|
50
|
+
}).catch(function (error) {
|
|
51
|
+
return reject(error);
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Update a Dehydrator [PATCH /lab/sites/{siteId}/dehydrators/{id}]
|
|
57
|
+
*
|
|
58
|
+
* @static
|
|
59
|
+
* @public
|
|
60
|
+
* @param {number} siteId The Site ID
|
|
61
|
+
* @param {string} id The Dehydrator ID
|
|
62
|
+
* @param {DehydratorController.UpdateData} updateData The Dehydrator Update Data
|
|
63
|
+
* @return {Promise<DehydratorModel>}
|
|
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, "/dehydrators/").concat(id), updateData).then(function (result) {
|
|
71
|
+
var resolveValue = function () {
|
|
72
|
+
return _DehydratorModel.default.fromJSON(result, siteId);
|
|
73
|
+
}();
|
|
74
|
+
|
|
75
|
+
resolve(resolveValue);
|
|
76
|
+
}).catch(function (error) {
|
|
77
|
+
return reject(error);
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Delete a Dehydrator [DELETE /lab/sites/{siteId}/dehydrators/{id}]
|
|
83
|
+
*
|
|
84
|
+
* @static
|
|
85
|
+
* @public
|
|
86
|
+
* @param {number} siteId The Site ID
|
|
87
|
+
* @param {string} id The Dehydrator 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, "/dehydrators/").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 Dehydrators [GET /lab/sites/{siteId}/dehydrators]
|
|
104
|
+
*
|
|
105
|
+
* @static
|
|
106
|
+
* @public
|
|
107
|
+
* @param {number} siteId The Site ID
|
|
108
|
+
* @param {DehydratorController.GetAllQueryParameters} [queryParameters] The Optional Query Parameters
|
|
109
|
+
* @return {Promise<DehydratorModel[]>}
|
|
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, "/dehydrators"), 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 _DehydratorModel.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 Dehydrator [POST /lab/sites/{siteId}/dehydrators]
|
|
138
|
+
*
|
|
139
|
+
* @static
|
|
140
|
+
* @public
|
|
141
|
+
* @param {number} siteId The Site ID
|
|
142
|
+
* @param {DehydratorController.CreateData} createData The Dehydrator Create Data
|
|
143
|
+
* @return {Promise<DehydratorModel>}
|
|
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, "/dehydrators"), createData).then(function (result) {
|
|
151
|
+
var resolveValue = function () {
|
|
152
|
+
return _DehydratorModel.default.fromJSON(result, siteId);
|
|
153
|
+
}();
|
|
154
|
+
|
|
155
|
+
resolve(resolveValue);
|
|
156
|
+
}).catch(function (error) {
|
|
157
|
+
return reject(error);
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
}]);
|
|
162
|
+
|
|
163
|
+
return DehydratorController;
|
|
164
|
+
}();
|
|
165
|
+
|
|
166
|
+
var _default = DehydratorController;
|
|
167
|
+
/**
|
|
168
|
+
* The Optional Query Parameters for the getAll Function
|
|
169
|
+
*
|
|
170
|
+
* @typedef {Object} DehydratorController.GetAllQueryParameters
|
|
171
|
+
* @property {?number} [rtuId] The RTU this Dehydrator belongs to
|
|
172
|
+
* @property {string} [name] The Name of this Dehydrator
|
|
173
|
+
* @property {string} [labId] The Lab that owns this Dehydrator
|
|
174
|
+
* @memberof Controllers.Lab.Site
|
|
175
|
+
*/
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* The Create Data for a Dehydrator
|
|
179
|
+
*
|
|
180
|
+
* @typedef {Object} DehydratorController.CreateData
|
|
181
|
+
* @property {?number} [rtuId] The RTU this Dehydrator belongs to
|
|
182
|
+
* @property {string} name The Name of this Dehydrator
|
|
183
|
+
* @property {{rackPositionId: number}} points The Points used by this Dehydrator
|
|
184
|
+
* @property {string} labId The Lab that owns this Dehydrator
|
|
185
|
+
* @memberof Controllers.Lab.Site
|
|
186
|
+
*/
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* The Update Data for a Dehydrator
|
|
190
|
+
*
|
|
191
|
+
* @typedef {Object} DehydratorController.UpdateData
|
|
192
|
+
* @property {string} [name] The Name of this Dehydrator
|
|
193
|
+
* @property {{rackPositionId: number}} [points] The Points used by this Dehydrator
|
|
194
|
+
* @property {string} [labId] The Lab that owns this Dehydrator
|
|
195
|
+
* @memberof Controllers.Lab.Site
|
|
196
|
+
*/
|
|
197
|
+
|
|
198
|
+
exports.default = _default;
|
|
@@ -0,0 +1,204 @@
|
|
|
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 _FruitProfileModel = _interopRequireDefault(require("../../../Models/Lab/Site/FruitProfileModel"));
|
|
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 Fruit Profiles
|
|
22
|
+
*
|
|
23
|
+
* @class
|
|
24
|
+
*/
|
|
25
|
+
var FruitProfileController = /*#__PURE__*/function () {
|
|
26
|
+
function FruitProfileController() {
|
|
27
|
+
_classCallCheck(this, FruitProfileController);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
_createClass(FruitProfileController, null, [{
|
|
31
|
+
key: "getOne",
|
|
32
|
+
value:
|
|
33
|
+
/**
|
|
34
|
+
* Retrieve a Fruit Profile [GET /lab/sites/{siteId}/fruit-profiles/{id}]
|
|
35
|
+
*
|
|
36
|
+
* @static
|
|
37
|
+
* @public
|
|
38
|
+
* @param {number} siteId The Site ID
|
|
39
|
+
* @param {string} id The Fruit Profile ID
|
|
40
|
+
* @return {Promise<FruitProfileModel>}
|
|
41
|
+
*/
|
|
42
|
+
function getOne(siteId, id) {
|
|
43
|
+
return new Promise(function (resolve, reject) {
|
|
44
|
+
_RequestHelper.default.getRequest("/lab/sites/".concat(siteId, "/fruit-profiles/").concat(id)).then(function (result) {
|
|
45
|
+
var resolveValue = function () {
|
|
46
|
+
return _FruitProfileModel.default.fromJSON(result, siteId);
|
|
47
|
+
}();
|
|
48
|
+
|
|
49
|
+
resolve(resolveValue);
|
|
50
|
+
}).catch(function (error) {
|
|
51
|
+
return reject(error);
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Update a Fruit Profile [PATCH /lab/sites/{siteId}/fruit-profiles/{id}]
|
|
57
|
+
*
|
|
58
|
+
* @static
|
|
59
|
+
* @public
|
|
60
|
+
* @param {number} siteId The Site ID
|
|
61
|
+
* @param {string} id The Fruit Profile ID
|
|
62
|
+
* @param {FruitProfileController.UpdateData} updateData The Fruit Profile Update Data
|
|
63
|
+
* @return {Promise<FruitProfileModel>}
|
|
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, "/fruit-profiles/").concat(id), updateData).then(function (result) {
|
|
71
|
+
var resolveValue = function () {
|
|
72
|
+
return _FruitProfileModel.default.fromJSON(result, siteId);
|
|
73
|
+
}();
|
|
74
|
+
|
|
75
|
+
resolve(resolveValue);
|
|
76
|
+
}).catch(function (error) {
|
|
77
|
+
return reject(error);
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Delete a Fruit Profile [DELETE /lab/sites/{siteId}/fruit-profiles/{id}]
|
|
83
|
+
*
|
|
84
|
+
* @static
|
|
85
|
+
* @public
|
|
86
|
+
* @param {number} siteId The Site ID
|
|
87
|
+
* @param {string} id The Fruit Profile 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, "/fruit-profiles/").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 Fruit Profiles [GET /lab/sites/{siteId}/fruit-profiles]
|
|
104
|
+
*
|
|
105
|
+
* @static
|
|
106
|
+
* @public
|
|
107
|
+
* @param {number} siteId The Site ID
|
|
108
|
+
* @param {FruitProfileController.GetAllQueryParameters} [queryParameters] The Optional Query Parameters
|
|
109
|
+
* @return {Promise<FruitProfileModel[]>}
|
|
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, "/fruit-profiles"), 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 _FruitProfileModel.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 Fruit Profile [POST /lab/sites/{siteId}/fruit-profiles]
|
|
138
|
+
*
|
|
139
|
+
* @static
|
|
140
|
+
* @public
|
|
141
|
+
* @param {number} siteId The Site ID
|
|
142
|
+
* @param {FruitProfileController.CreateData} createData The Fruit Profile Create Data
|
|
143
|
+
* @return {Promise<FruitProfileModel>}
|
|
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, "/fruit-profiles"), createData).then(function (result) {
|
|
151
|
+
var resolveValue = function () {
|
|
152
|
+
return _FruitProfileModel.default.fromJSON(result, siteId);
|
|
153
|
+
}();
|
|
154
|
+
|
|
155
|
+
resolve(resolveValue);
|
|
156
|
+
}).catch(function (error) {
|
|
157
|
+
return reject(error);
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
}]);
|
|
162
|
+
|
|
163
|
+
return FruitProfileController;
|
|
164
|
+
}();
|
|
165
|
+
|
|
166
|
+
var _default = FruitProfileController;
|
|
167
|
+
/**
|
|
168
|
+
* The Optional Query Parameters for the getAll Function
|
|
169
|
+
*
|
|
170
|
+
* @typedef {Object} FruitProfileController.GetAllQueryParameters
|
|
171
|
+
* @property {string} [name] The Fruit Profile Name
|
|
172
|
+
* @memberof Controllers.Lab.Site
|
|
173
|
+
*/
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* The Create Data for a Fruit Profile
|
|
177
|
+
*
|
|
178
|
+
* @typedef {Object} FruitProfileController.CreateData
|
|
179
|
+
* @property {string} [name] The Fruit Profile Name
|
|
180
|
+
* @property {string} description The Fruit Profile Description
|
|
181
|
+
* @property {string} image The Fruit Profile Image Source
|
|
182
|
+
* @property {number} nominalWarmUpDuration The Typical Warm Up Duration (in seconds) for a Sample to reach the Minimum Target Temperature
|
|
183
|
+
* @property {number} minimumWithinTargetDuration The Minimum Duration (in seconds) that a Sample should be within the Min and Max Target Temperatures be Successful
|
|
184
|
+
* @property {number} maximumTotalDuration The Maximum Duration (in seconds) that a Sample should be Dehydrated for before it Fails
|
|
185
|
+
* @property {number} minimumTargetTemperature The Minimum Target Temperature for a Sample to be Successful
|
|
186
|
+
* @property {number} maximumTargetTemperature The Maximum Target Temperature for a Sample to be Successful
|
|
187
|
+
* @memberof Controllers.Lab.Site
|
|
188
|
+
*/
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* The Update Data for a Fruit Profile
|
|
192
|
+
*
|
|
193
|
+
* @typedef {Object} FruitProfileController.UpdateData
|
|
194
|
+
* @property {string} [description] The Fruit Profile Description
|
|
195
|
+
* @property {string} [image] The Fruit Profile Image Source
|
|
196
|
+
* @property {number} [nominalWarmUpDuration] The Typical Warm Up Duration (in seconds) for a Sample to reach the Minimum Target Temperature
|
|
197
|
+
* @property {number} [minimumWithinTargetDuration] The Minimum Duration (in seconds) that a Sample should be within the Min and Max Target Temperatures be Successful
|
|
198
|
+
* @property {number} [maximumTotalDuration] The Maximum Duration (in seconds) that a Sample should be Dehydrated for before it Fails
|
|
199
|
+
* @property {number} [minimumTargetTemperature] The Minimum Target Temperature for a Sample to be Successful
|
|
200
|
+
* @property {number} [maximumTargetTemperature] The Maximum Target Temperature for a Sample to be Successful
|
|
201
|
+
* @memberof Controllers.Lab.Site
|
|
202
|
+
*/
|
|
203
|
+
|
|
204
|
+
exports.default = _default;
|
|
@@ -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 _LabModel = _interopRequireDefault(require("../../../Models/Lab/Site/LabModel"));
|
|
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 Labs
|
|
22
|
+
*
|
|
23
|
+
* @class
|
|
24
|
+
*/
|
|
25
|
+
var LabController = /*#__PURE__*/function () {
|
|
26
|
+
function LabController() {
|
|
27
|
+
_classCallCheck(this, LabController);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
_createClass(LabController, null, [{
|
|
31
|
+
key: "getOne",
|
|
32
|
+
value:
|
|
33
|
+
/**
|
|
34
|
+
* Retrieve a Lab [GET /lab/sites/{siteId}/labs/{id}]
|
|
35
|
+
*
|
|
36
|
+
* @static
|
|
37
|
+
* @public
|
|
38
|
+
* @param {number} siteId The Site ID
|
|
39
|
+
* @param {string} id The Lab ID
|
|
40
|
+
* @return {Promise<LabModel>}
|
|
41
|
+
*/
|
|
42
|
+
function getOne(siteId, id) {
|
|
43
|
+
return new Promise(function (resolve, reject) {
|
|
44
|
+
_RequestHelper.default.getRequest("/lab/sites/".concat(siteId, "/labs/").concat(id)).then(function (result) {
|
|
45
|
+
var resolveValue = function () {
|
|
46
|
+
return _LabModel.default.fromJSON(result, siteId);
|
|
47
|
+
}();
|
|
48
|
+
|
|
49
|
+
resolve(resolveValue);
|
|
50
|
+
}).catch(function (error) {
|
|
51
|
+
return reject(error);
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Update a Lab [PATCH /lab/sites/{siteId}/labs/{id}]
|
|
57
|
+
*
|
|
58
|
+
* @static
|
|
59
|
+
* @public
|
|
60
|
+
* @param {number} siteId The Site ID
|
|
61
|
+
* @param {string} id The Lab ID
|
|
62
|
+
* @param {LabController.UpdateData} updateData The Lab Update Data
|
|
63
|
+
* @return {Promise<LabModel>}
|
|
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, "/labs/").concat(id), updateData).then(function (result) {
|
|
71
|
+
var resolveValue = function () {
|
|
72
|
+
return _LabModel.default.fromJSON(result, siteId);
|
|
73
|
+
}();
|
|
74
|
+
|
|
75
|
+
resolve(resolveValue);
|
|
76
|
+
}).catch(function (error) {
|
|
77
|
+
return reject(error);
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Delete a Lab [DELETE /lab/sites/{siteId}/labs/{id}]
|
|
83
|
+
*
|
|
84
|
+
* @static
|
|
85
|
+
* @public
|
|
86
|
+
* @param {number} siteId The Site ID
|
|
87
|
+
* @param {string} id The Lab 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, "/labs/").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 Labs [GET /lab/sites/{siteId}/labs]
|
|
104
|
+
*
|
|
105
|
+
* @static
|
|
106
|
+
* @public
|
|
107
|
+
* @param {number} siteId The Site ID
|
|
108
|
+
* @param {LabController.GetAllQueryParameters} [queryParameters] The Optional Query Parameters
|
|
109
|
+
* @return {Promise<LabModel[]>}
|
|
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, "/labs"), 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 _LabModel.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 Lab [POST /lab/sites/{siteId}/labs]
|
|
138
|
+
*
|
|
139
|
+
* @static
|
|
140
|
+
* @public
|
|
141
|
+
* @param {number} siteId The Site ID
|
|
142
|
+
* @param {LabController.CreateData} createData The Lab Create Data
|
|
143
|
+
* @return {Promise<LabModel>}
|
|
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, "/labs"), createData).then(function (result) {
|
|
151
|
+
var resolveValue = function () {
|
|
152
|
+
return _LabModel.default.fromJSON(result, siteId);
|
|
153
|
+
}();
|
|
154
|
+
|
|
155
|
+
resolve(resolveValue);
|
|
156
|
+
}).catch(function (error) {
|
|
157
|
+
return reject(error);
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
}]);
|
|
162
|
+
|
|
163
|
+
return LabController;
|
|
164
|
+
}();
|
|
165
|
+
|
|
166
|
+
var _default = LabController;
|
|
167
|
+
/**
|
|
168
|
+
* The Optional Query Parameters for the getAll Function
|
|
169
|
+
*
|
|
170
|
+
* @typedef {Object} LabController.GetAllQueryParameters
|
|
171
|
+
* @property {?number} [rtuId] The RTU this Lab belongs to
|
|
172
|
+
* @property {string} [name] The Lab Name
|
|
173
|
+
* @memberof Controllers.Lab.Site
|
|
174
|
+
*/
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* The Create Data for a Lab
|
|
178
|
+
*
|
|
179
|
+
* @typedef {Object} LabController.CreateData
|
|
180
|
+
* @property {?number} [rtuId] The RTU this Lab belongs to
|
|
181
|
+
* @property {string} name The Lab Name
|
|
182
|
+
* @property {string} [shortName] A Short Name for the Lab Name. Typically used in Reports and Tables showing multiple Labs
|
|
183
|
+
* @property {Object} points The Points used by this Lab
|
|
184
|
+
* @property {Array<LabController.RackReference>} [racks] The Rack Objects that belong to this Lab
|
|
185
|
+
* @property {string[]} [alarmGroups] The Alarm Groups that are used by this Lab
|
|
186
|
+
* @property {?LabController.InspectIntegration} [inspectIntegration] The Inspect Integration Configuration for this Lab
|
|
187
|
+
* @memberof Controllers.Lab.Site
|
|
188
|
+
*/
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* The Update Data for a Lab
|
|
192
|
+
*
|
|
193
|
+
* @typedef {Object} LabController.UpdateData
|
|
194
|
+
* @property {string} [name] The Lab Name
|
|
195
|
+
* @property {string} [shortName] A Short Name for the Lab Name. Typically used in Reports and Tables showing multiple Labs
|
|
196
|
+
* @property {Object} [points] The Points used by this Lab
|
|
197
|
+
* @property {Array<LabController.RackReference>} [racks] The Rack Objects that belong to this Lab
|
|
198
|
+
* @property {string[]} [alarmGroups] The Alarm Groups that are used by this Lab
|
|
199
|
+
* @property {?LabController.InspectIntegration} [inspectIntegration] The Inspect Integration Configuration for this Lab
|
|
200
|
+
* @memberof Controllers.Lab.Site
|
|
201
|
+
*/
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* A **RackReference** Type
|
|
205
|
+
*
|
|
206
|
+
* @typedef {Object} LabController.RackReference
|
|
207
|
+
* @property {string} id ID of a Rack Object
|
|
208
|
+
* @property {number} displayOrder Display Order of the Rack
|
|
209
|
+
* @memberof Controllers.Lab.Site
|
|
210
|
+
*/
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* A **InspectIntegration** Type
|
|
214
|
+
*
|
|
215
|
+
* @typedef {Object} LabController.InspectIntegration
|
|
216
|
+
* @property {Object} points The Points used for this Inspect Integration
|
|
217
|
+
* @property {boolean} enabled Whether the Inspect Integration is Enabled on this Lab
|
|
218
|
+
* @property {string} apiBaseUrl Base URL of the Inspect API
|
|
219
|
+
* @memberof Controllers.Lab.Site
|
|
220
|
+
*/
|
|
221
|
+
|
|
222
|
+
exports.default = _default;
|