@ricado/api-client 2.1.0 → 2.1.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.
- package/README.md +5 -7
- package/dist/ricado.api.client.js +1 -1
- package/lib/Controllers/Packhouse/Site/RejectBinScaleController.js +24 -2
- package/lib/Controllers/Packhouse/Site/SoftSortBeltController.js +453 -0
- package/lib/Controllers/Packhouse/Site/index.js +3 -0
- package/lib/Models/Packhouse/Site/RejectBinScaleModel.js +260 -4
- package/lib/Models/Packhouse/Site/SoftSortBeltModel.js +235 -0
- package/lib/Models/Packhouse/Site/index.js +3 -0
- package/lib/PackageVersion.js +1 -1
- package/lib/index.d.ts +471 -3
- package/package.json +1 -1
- package/src/Controllers/Packhouse/Site/RejectBinScaleController.js +24 -2
- package/src/Controllers/Packhouse/Site/SoftSortBeltController.js +474 -0
- package/src/Controllers/Packhouse/Site/index.js +2 -0
- package/src/Models/Packhouse/Site/RejectBinScaleModel.js +297 -4
- package/src/Models/Packhouse/Site/SoftSortBeltModel.js +215 -0
- package/src/Models/Packhouse/Site/index.js +2 -0
- package/src/PackageVersion.js +1 -1
|
@@ -187,7 +187,18 @@ var _default = RejectBinScaleController;
|
|
|
187
187
|
* @property {?string} [packrunSourceId] The Permanent Object that provides the Next Packrun for this Reject Bin Scale
|
|
188
188
|
* @property {?number} [packrunGroup] The Packrun Group this Reject Bin Scale is a part of
|
|
189
189
|
* @property {Object[]} [sources] An Array of Sources that deliver Fruit to this Reject Bin Scale
|
|
190
|
-
* @property {?number} [autoPackrunChange] The Auto Packrun Change Configuration for this Reject Bin Scale
|
|
190
|
+
* @property {?{delay: ?number}} [autoPackrunChange] The Auto Packrun Change Configuration for this Reject Bin Scale
|
|
191
|
+
* @property {?boolean} [supportsLiveWeighing] Whether this Reject Bin Scale supports Live Weighing
|
|
192
|
+
* @property {?number} [autoWeighingStartThreshold] The Minimum Weight Change Required to Automatically Start Live Weighing
|
|
193
|
+
* @property {?number} [autoWeighingStartDelay] The Delay in Milliseconds before Auto Live Weighing would Start
|
|
194
|
+
* @property {?number} [autoWeighingFinishThreshold] The Minimum Weight Change Required to Automatically Finish Live Weighing
|
|
195
|
+
* @property {?number} [autoWeighingFinishDelay] The Delay in Milliseconds before Auto Live Weighing would Finish
|
|
196
|
+
* @property {?number} [manualInterventionMaximumDuration] The Maximum Duration in Milliseconds before a Manual Intervention would end
|
|
197
|
+
* @property {?number} [liveWeighingIncreaseTolerance] The Maximum Weight Increase allowed within a single Live Weighing Update Interval
|
|
198
|
+
* @property {?number} [liveWeighingDecreaseTolerance] The Maximum Weight Decrease allowed within a single Live Weighing Update Interval
|
|
199
|
+
* @property {?number} [liveWeighingUpdateInterval] The Interval in Milliseconds between Live Weighing Updates
|
|
200
|
+
* @property {?boolean} [liveWeighingUsesStableStatus] Whether the Loadcell Stable Status is used to ignore Changes during Live Weighing
|
|
201
|
+
* @property {?number} [incorrectOperationTolerance] The Maximum Weight Change allowed while Live Weighing before an Incorrect Operation is Logged
|
|
191
202
|
* @property {?Object} [freshPackIntegration] The FreshPack Integration Configuration for this Reject Bin Scale
|
|
192
203
|
* @memberof Controllers.Packhouse.Site
|
|
193
204
|
*/
|
|
@@ -202,7 +213,18 @@ var _default = RejectBinScaleController;
|
|
|
202
213
|
* @property {?string} [packrunSourceId] The Permanent Object that provides the Next Packrun for this Reject Bin Scale
|
|
203
214
|
* @property {?number} [packrunGroup] The Packrun Group this Reject Bin Scale is a part of
|
|
204
215
|
* @property {Object[]} [sources] An Array of Sources that deliver Fruit to this Reject Bin Scale
|
|
205
|
-
* @property {?number} [autoPackrunChange] The Auto Packrun Change Configuration for this Reject Bin Scale
|
|
216
|
+
* @property {?{delay: ?number}} [autoPackrunChange] The Auto Packrun Change Configuration for this Reject Bin Scale
|
|
217
|
+
* @property {?boolean} [supportsLiveWeighing] Whether this Reject Bin Scale supports Live Weighing
|
|
218
|
+
* @property {?number} [autoWeighingStartThreshold] The Minimum Weight Change Required to Automatically Start Live Weighing
|
|
219
|
+
* @property {?number} [autoWeighingStartDelay] The Delay in Milliseconds before Auto Live Weighing would Start
|
|
220
|
+
* @property {?number} [autoWeighingFinishThreshold] The Minimum Weight Change Required to Automatically Finish Live Weighing
|
|
221
|
+
* @property {?number} [autoWeighingFinishDelay] The Delay in Milliseconds before Auto Live Weighing would Finish
|
|
222
|
+
* @property {?number} [manualInterventionMaximumDuration] The Maximum Duration in Milliseconds before a Manual Intervention would end
|
|
223
|
+
* @property {?number} [liveWeighingIncreaseTolerance] The Maximum Weight Increase allowed within a single Live Weighing Update Interval
|
|
224
|
+
* @property {?number} [liveWeighingDecreaseTolerance] The Maximum Weight Decrease allowed within a single Live Weighing Update Interval
|
|
225
|
+
* @property {?number} [liveWeighingUpdateInterval] The Interval in Milliseconds between Live Weighing Updates
|
|
226
|
+
* @property {?boolean} [liveWeighingUsesStableStatus] Whether the Loadcell Stable Status is used to ignore Changes during Live Weighing
|
|
227
|
+
* @property {?number} [incorrectOperationTolerance] The Maximum Weight Change allowed while Live Weighing before an Incorrect Operation is Logged
|
|
206
228
|
* @property {?Object} [freshPackIntegration] The FreshPack Integration Configuration for this Reject Bin Scale
|
|
207
229
|
* @memberof Controllers.Packhouse.Site
|
|
208
230
|
*/
|
|
@@ -0,0 +1,453 @@
|
|
|
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 _SoftSortBeltModel = _interopRequireDefault(require("../../../Models/Packhouse/Site/SoftSortBeltModel"));
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
14
|
+
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); }
|
|
15
|
+
|
|
16
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
17
|
+
|
|
18
|
+
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); } }
|
|
19
|
+
|
|
20
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Controller Class for Soft Sort Belts
|
|
24
|
+
*
|
|
25
|
+
* @class
|
|
26
|
+
*/
|
|
27
|
+
var SoftSortBeltController = /*#__PURE__*/function () {
|
|
28
|
+
function SoftSortBeltController() {
|
|
29
|
+
_classCallCheck(this, SoftSortBeltController);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
_createClass(SoftSortBeltController, null, [{
|
|
33
|
+
key: "getOne",
|
|
34
|
+
value:
|
|
35
|
+
/**
|
|
36
|
+
* Retrieve a Soft Sort Belt [GET /packhouse/sites/{siteId}/soft-sort-belts/{id}]
|
|
37
|
+
*
|
|
38
|
+
* @static
|
|
39
|
+
* @public
|
|
40
|
+
* @param {number} siteId The Site ID
|
|
41
|
+
* @param {string} id The Soft Sort Belt ID
|
|
42
|
+
* @return {Promise<SoftSortBeltModel>}
|
|
43
|
+
*/
|
|
44
|
+
function getOne(siteId, id) {
|
|
45
|
+
return new Promise(function (resolve, reject) {
|
|
46
|
+
_RequestHelper.default.getRequest("/packhouse/sites/".concat(siteId, "/soft-sort-belts/").concat(id)).then(function (result) {
|
|
47
|
+
var resolveValue = function () {
|
|
48
|
+
return _SoftSortBeltModel.default.fromJSON(result, siteId);
|
|
49
|
+
}();
|
|
50
|
+
|
|
51
|
+
resolve(resolveValue);
|
|
52
|
+
}).catch(function (error) {
|
|
53
|
+
return reject(error);
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Update a Soft Sort Belt [PATCH /packhouse/sites/{siteId}/soft-sort-belts/{id}]
|
|
59
|
+
*
|
|
60
|
+
* @static
|
|
61
|
+
* @public
|
|
62
|
+
* @param {number} siteId The Site ID
|
|
63
|
+
* @param {string} id The Soft Sort Belt ID
|
|
64
|
+
* @param {SoftSortBeltController.UpdateData} updateData The Soft Sort Belt Update Data
|
|
65
|
+
* @return {Promise<SoftSortBeltModel>}
|
|
66
|
+
*/
|
|
67
|
+
|
|
68
|
+
}, {
|
|
69
|
+
key: "update",
|
|
70
|
+
value: function update(siteId, id, updateData) {
|
|
71
|
+
return new Promise(function (resolve, reject) {
|
|
72
|
+
_RequestHelper.default.patchRequest("/packhouse/sites/".concat(siteId, "/soft-sort-belts/").concat(id), updateData).then(function (result) {
|
|
73
|
+
var resolveValue = function () {
|
|
74
|
+
return _SoftSortBeltModel.default.fromJSON(result, siteId);
|
|
75
|
+
}();
|
|
76
|
+
|
|
77
|
+
resolve(resolveValue);
|
|
78
|
+
}).catch(function (error) {
|
|
79
|
+
return reject(error);
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Delete a Soft Sort Belt [DELETE /packhouse/sites/{siteId}/soft-sort-belts/{id}]
|
|
85
|
+
*
|
|
86
|
+
* @static
|
|
87
|
+
* @public
|
|
88
|
+
* @param {number} siteId The Site ID
|
|
89
|
+
* @param {string} id The Soft Sort Belt ID
|
|
90
|
+
* @return {Promise<boolean>}
|
|
91
|
+
*/
|
|
92
|
+
|
|
93
|
+
}, {
|
|
94
|
+
key: "delete",
|
|
95
|
+
value: function _delete(siteId, id) {
|
|
96
|
+
return new Promise(function (resolve, reject) {
|
|
97
|
+
_RequestHelper.default.deleteRequest("/packhouse/sites/".concat(siteId, "/soft-sort-belts/").concat(id)).then(function (result) {
|
|
98
|
+
resolve(result !== null && result !== void 0 ? result : true);
|
|
99
|
+
}).catch(function (error) {
|
|
100
|
+
return reject(error);
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Retrieve the Events of a Soft Sort Belt [GET /packhouse/sites/{siteId}/soft-sort-belts/{id}/events]
|
|
106
|
+
*
|
|
107
|
+
* Retrieves Events for a Single Soft Sort Belt
|
|
108
|
+
*
|
|
109
|
+
* @static
|
|
110
|
+
* @public
|
|
111
|
+
* @param {number} siteId The Site ID
|
|
112
|
+
* @param {string} id The Soft Sort Belt ID
|
|
113
|
+
* @param {SoftSortBeltController.GetOneEventsQueryParameters} [queryParameters] The Optional Query Parameters
|
|
114
|
+
* @return {Promise<Array<SoftSortBeltController.SoftSortEventItem>>}
|
|
115
|
+
*/
|
|
116
|
+
|
|
117
|
+
}, {
|
|
118
|
+
key: "getOneEvents",
|
|
119
|
+
value: function getOneEvents(siteId, id) {
|
|
120
|
+
var queryParameters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
121
|
+
return new Promise(function (resolve, reject) {
|
|
122
|
+
_RequestHelper.default.getRequest("/packhouse/sites/".concat(siteId, "/soft-sort-belts/").concat(id, "/events"), queryParameters).then(function (result) {
|
|
123
|
+
var resolveValue = function () {
|
|
124
|
+
if (Array.isArray(result) !== true) {
|
|
125
|
+
return [];
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return result.map(function (resultItem) {
|
|
129
|
+
return function () {
|
|
130
|
+
var resultItemObject = {};
|
|
131
|
+
|
|
132
|
+
if (_typeof(resultItem) === 'object' && 'beltId' in resultItem) {
|
|
133
|
+
resultItemObject.beltId = function () {
|
|
134
|
+
if (typeof resultItem.beltId !== 'string') {
|
|
135
|
+
return String(resultItem.beltId);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
return resultItem.beltId;
|
|
139
|
+
}();
|
|
140
|
+
} else {
|
|
141
|
+
resultItemObject.beltId = "";
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
if (_typeof(resultItem) === 'object' && 'packrunId' in resultItem) {
|
|
145
|
+
resultItemObject.packrunId = function () {
|
|
146
|
+
if (typeof resultItem.packrunId !== 'string') {
|
|
147
|
+
return String(resultItem.packrunId);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
return resultItem.packrunId;
|
|
151
|
+
}();
|
|
152
|
+
} else {
|
|
153
|
+
resultItemObject.packrunId = "";
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
if (_typeof(resultItem) === 'object' && 'packrunName' in resultItem) {
|
|
157
|
+
resultItemObject.packrunName = function () {
|
|
158
|
+
if (typeof resultItem.packrunName !== 'string') {
|
|
159
|
+
return String(resultItem.packrunName);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
return resultItem.packrunName;
|
|
163
|
+
}();
|
|
164
|
+
} else {
|
|
165
|
+
resultItemObject.packrunName = "";
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
if (_typeof(resultItem) === 'object' && 'startTimestamp' in resultItem) {
|
|
169
|
+
resultItemObject.startTimestamp = function () {
|
|
170
|
+
if (typeof resultItem.startTimestamp !== 'string') {
|
|
171
|
+
return new Date(String(resultItem.startTimestamp));
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
return new Date(resultItem.startTimestamp);
|
|
175
|
+
}();
|
|
176
|
+
} else {
|
|
177
|
+
resultItemObject.startTimestamp = new Date();
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
if (_typeof(resultItem) === 'object' && 'endTimestamp' in resultItem) {
|
|
181
|
+
resultItemObject.endTimestamp = function () {
|
|
182
|
+
if (typeof resultItem.endTimestamp !== 'string') {
|
|
183
|
+
return new Date(String(resultItem.endTimestamp));
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
return new Date(resultItem.endTimestamp);
|
|
187
|
+
}();
|
|
188
|
+
} else {
|
|
189
|
+
resultItemObject.endTimestamp = new Date();
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
if (_typeof(resultItem) === 'object' && 'duration' in resultItem) {
|
|
193
|
+
resultItemObject.duration = function () {
|
|
194
|
+
if (typeof resultItem.duration !== 'number') {
|
|
195
|
+
return Number.isInteger(Number(resultItem.duration)) ? Number(resultItem.duration) : Math.floor(Number(resultItem.duration));
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
return Number.isInteger(resultItem.duration) ? resultItem.duration : Math.floor(resultItem.duration);
|
|
199
|
+
}();
|
|
200
|
+
} else {
|
|
201
|
+
resultItemObject.duration = 0;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
return resultItemObject;
|
|
205
|
+
}();
|
|
206
|
+
});
|
|
207
|
+
}();
|
|
208
|
+
|
|
209
|
+
resolve(resolveValue);
|
|
210
|
+
}).catch(function (error) {
|
|
211
|
+
return reject(error);
|
|
212
|
+
});
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* List all Soft Sort Belts [GET /packhouse/sites/{siteId}/soft-sort-belts]
|
|
217
|
+
*
|
|
218
|
+
* @static
|
|
219
|
+
* @public
|
|
220
|
+
* @param {number} siteId The Site ID
|
|
221
|
+
* @param {SoftSortBeltController.GetAllQueryParameters} [queryParameters] The Optional Query Parameters
|
|
222
|
+
* @return {Promise<SoftSortBeltModel[]>}
|
|
223
|
+
*/
|
|
224
|
+
|
|
225
|
+
}, {
|
|
226
|
+
key: "getAll",
|
|
227
|
+
value: function getAll(siteId) {
|
|
228
|
+
var queryParameters = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
229
|
+
return new Promise(function (resolve, reject) {
|
|
230
|
+
_RequestHelper.default.getRequest("/packhouse/sites/".concat(siteId, "/soft-sort-belts"), queryParameters).then(function (result) {
|
|
231
|
+
var resolveValue = function () {
|
|
232
|
+
if (Array.isArray(result) !== true) {
|
|
233
|
+
return [];
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
return result.map(function (resultItem) {
|
|
237
|
+
return function () {
|
|
238
|
+
return _SoftSortBeltModel.default.fromJSON(resultItem, siteId);
|
|
239
|
+
}();
|
|
240
|
+
});
|
|
241
|
+
}();
|
|
242
|
+
|
|
243
|
+
resolve(resolveValue);
|
|
244
|
+
}).catch(function (error) {
|
|
245
|
+
return reject(error);
|
|
246
|
+
});
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Create a Soft Sort Belt [POST /packhouse/sites/{siteId}/soft-sort-belts]
|
|
251
|
+
*
|
|
252
|
+
* @static
|
|
253
|
+
* @public
|
|
254
|
+
* @param {number} siteId The Site ID
|
|
255
|
+
* @param {SoftSortBeltController.CreateData} createData The Soft Sort Belt Create Data
|
|
256
|
+
* @return {Promise<SoftSortBeltModel>}
|
|
257
|
+
*/
|
|
258
|
+
|
|
259
|
+
}, {
|
|
260
|
+
key: "create",
|
|
261
|
+
value: function create(siteId, createData) {
|
|
262
|
+
return new Promise(function (resolve, reject) {
|
|
263
|
+
_RequestHelper.default.postRequest("/packhouse/sites/".concat(siteId, "/soft-sort-belts"), createData).then(function (result) {
|
|
264
|
+
var resolveValue = function () {
|
|
265
|
+
return _SoftSortBeltModel.default.fromJSON(result, siteId);
|
|
266
|
+
}();
|
|
267
|
+
|
|
268
|
+
resolve(resolveValue);
|
|
269
|
+
}).catch(function (error) {
|
|
270
|
+
return reject(error);
|
|
271
|
+
});
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Retrieve the Events of all Soft Sort Belts [GET /packhouse/sites/{siteId}/soft-sort-belts/events]
|
|
276
|
+
*
|
|
277
|
+
* Retrieves Events for all Soft Sort Belts
|
|
278
|
+
*
|
|
279
|
+
* @static
|
|
280
|
+
* @public
|
|
281
|
+
* @param {number} siteId The Site ID
|
|
282
|
+
* @param {SoftSortBeltController.GetAllEventsQueryParameters} [queryParameters] The Optional Query Parameters
|
|
283
|
+
* @return {Promise<Array<SoftSortBeltController.SoftSortEventItem>>}
|
|
284
|
+
*/
|
|
285
|
+
|
|
286
|
+
}, {
|
|
287
|
+
key: "getAllEvents",
|
|
288
|
+
value: function getAllEvents(siteId) {
|
|
289
|
+
var queryParameters = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
290
|
+
return new Promise(function (resolve, reject) {
|
|
291
|
+
_RequestHelper.default.getRequest("/packhouse/sites/".concat(siteId, "/soft-sort-belts/events"), queryParameters).then(function (result) {
|
|
292
|
+
var resolveValue = function () {
|
|
293
|
+
if (Array.isArray(result) !== true) {
|
|
294
|
+
return [];
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
return result.map(function (resultItem) {
|
|
298
|
+
return function () {
|
|
299
|
+
var resultItemObject = {};
|
|
300
|
+
|
|
301
|
+
if (_typeof(resultItem) === 'object' && 'beltId' in resultItem) {
|
|
302
|
+
resultItemObject.beltId = function () {
|
|
303
|
+
if (typeof resultItem.beltId !== 'string') {
|
|
304
|
+
return String(resultItem.beltId);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
return resultItem.beltId;
|
|
308
|
+
}();
|
|
309
|
+
} else {
|
|
310
|
+
resultItemObject.beltId = "";
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
if (_typeof(resultItem) === 'object' && 'packrunId' in resultItem) {
|
|
314
|
+
resultItemObject.packrunId = function () {
|
|
315
|
+
if (typeof resultItem.packrunId !== 'string') {
|
|
316
|
+
return String(resultItem.packrunId);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
return resultItem.packrunId;
|
|
320
|
+
}();
|
|
321
|
+
} else {
|
|
322
|
+
resultItemObject.packrunId = "";
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
if (_typeof(resultItem) === 'object' && 'packrunName' in resultItem) {
|
|
326
|
+
resultItemObject.packrunName = function () {
|
|
327
|
+
if (typeof resultItem.packrunName !== 'string') {
|
|
328
|
+
return String(resultItem.packrunName);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
return resultItem.packrunName;
|
|
332
|
+
}();
|
|
333
|
+
} else {
|
|
334
|
+
resultItemObject.packrunName = "";
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
if (_typeof(resultItem) === 'object' && 'startTimestamp' in resultItem) {
|
|
338
|
+
resultItemObject.startTimestamp = function () {
|
|
339
|
+
if (typeof resultItem.startTimestamp !== 'string') {
|
|
340
|
+
return new Date(String(resultItem.startTimestamp));
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
return new Date(resultItem.startTimestamp);
|
|
344
|
+
}();
|
|
345
|
+
} else {
|
|
346
|
+
resultItemObject.startTimestamp = new Date();
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
if (_typeof(resultItem) === 'object' && 'endTimestamp' in resultItem) {
|
|
350
|
+
resultItemObject.endTimestamp = function () {
|
|
351
|
+
if (typeof resultItem.endTimestamp !== 'string') {
|
|
352
|
+
return new Date(String(resultItem.endTimestamp));
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
return new Date(resultItem.endTimestamp);
|
|
356
|
+
}();
|
|
357
|
+
} else {
|
|
358
|
+
resultItemObject.endTimestamp = new Date();
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
if (_typeof(resultItem) === 'object' && 'duration' in resultItem) {
|
|
362
|
+
resultItemObject.duration = function () {
|
|
363
|
+
if (typeof resultItem.duration !== 'number') {
|
|
364
|
+
return Number.isInteger(Number(resultItem.duration)) ? Number(resultItem.duration) : Math.floor(Number(resultItem.duration));
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
return Number.isInteger(resultItem.duration) ? resultItem.duration : Math.floor(resultItem.duration);
|
|
368
|
+
}();
|
|
369
|
+
} else {
|
|
370
|
+
resultItemObject.duration = 0;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
return resultItemObject;
|
|
374
|
+
}();
|
|
375
|
+
});
|
|
376
|
+
}();
|
|
377
|
+
|
|
378
|
+
resolve(resolveValue);
|
|
379
|
+
}).catch(function (error) {
|
|
380
|
+
return reject(error);
|
|
381
|
+
});
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
}]);
|
|
385
|
+
|
|
386
|
+
return SoftSortBeltController;
|
|
387
|
+
}();
|
|
388
|
+
|
|
389
|
+
var _default = SoftSortBeltController;
|
|
390
|
+
/**
|
|
391
|
+
* The Optional Query Parameters for the getOneEvents Function
|
|
392
|
+
*
|
|
393
|
+
* @typedef {Object} SoftSortBeltController.GetOneEventsQueryParameters
|
|
394
|
+
* @property {Date} [timestampBegin] The Beginning Timestamp of the Soft-Sort Event Results. Defaults to 24 Hours ago
|
|
395
|
+
* @property {Date} [timestampEnd] The End Timestamp of the Soft-Sort Event Results. Defaults to Now
|
|
396
|
+
* @memberof Controllers.Packhouse.Site
|
|
397
|
+
*/
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* The Optional Query Parameters for the getAll Function
|
|
401
|
+
*
|
|
402
|
+
* @typedef {Object} SoftSortBeltController.GetAllQueryParameters
|
|
403
|
+
* @property {?number} [rtuId] The RTU this Soft Sort Belt belongs to
|
|
404
|
+
* @property {string} [name] The Name of this Soft Sort Belt
|
|
405
|
+
* @property {string} [packingLineId] The Packing Line that owns this Soft Sort Belt
|
|
406
|
+
* @memberof Controllers.Packhouse.Site
|
|
407
|
+
*/
|
|
408
|
+
|
|
409
|
+
/**
|
|
410
|
+
* The Optional Query Parameters for the getAllEvents Function
|
|
411
|
+
*
|
|
412
|
+
* @typedef {Object} SoftSortBeltController.GetAllEventsQueryParameters
|
|
413
|
+
* @property {string[]} [beltIds] A List of Soft-Sort Belt IDs to Filter by
|
|
414
|
+
* @property {Date} [timestampBegin] The Beginning Timestamp of the Soft-Sort Event Results. Defaults to 24 Hours ago
|
|
415
|
+
* @property {Date} [timestampEnd] The End Timestamp of the Soft-Sort Event Results. Defaults to Now
|
|
416
|
+
* @memberof Controllers.Packhouse.Site
|
|
417
|
+
*/
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* The Create Data for a Soft Sort Belt
|
|
421
|
+
*
|
|
422
|
+
* @typedef {Object} SoftSortBeltController.CreateData
|
|
423
|
+
* @property {?number} [rtuId] The RTU this Soft Sort Belt belongs to
|
|
424
|
+
* @property {string} name The Name of this Soft Sort Belt
|
|
425
|
+
* @property {Object} points The Points used by this Soft Sort Belt
|
|
426
|
+
* @property {string} packingLineId The Packing Line that owns this Soft Sort Belt
|
|
427
|
+
* @memberof Controllers.Packhouse.Site
|
|
428
|
+
*/
|
|
429
|
+
|
|
430
|
+
/**
|
|
431
|
+
* The Update Data for a Soft Sort Belt
|
|
432
|
+
*
|
|
433
|
+
* @typedef {Object} SoftSortBeltController.UpdateData
|
|
434
|
+
* @property {string} [name] The Name of this Soft Sort Belt
|
|
435
|
+
* @property {Object} [points] The Points used by this Soft Sort Belt
|
|
436
|
+
* @property {string} [packingLineId] The Packing Line that owns this Soft Sort Belt
|
|
437
|
+
* @memberof Controllers.Packhouse.Site
|
|
438
|
+
*/
|
|
439
|
+
|
|
440
|
+
/**
|
|
441
|
+
* A **SoftSortEventItem** Type
|
|
442
|
+
*
|
|
443
|
+
* @typedef {Object} SoftSortBeltController.SoftSortEventItem
|
|
444
|
+
* @property {string} beltId The Soft-Sort Belt ID
|
|
445
|
+
* @property {string} packrunId The ID of the associated Packrun
|
|
446
|
+
* @property {string} packrunName The Name of the associated Packrun
|
|
447
|
+
* @property {Date} startTimestamp When the Event Started
|
|
448
|
+
* @property {Date} endTimestamp When the Event Ended
|
|
449
|
+
* @property {number} duration The Duration in Seconds of the Event
|
|
450
|
+
* @memberof Controllers.Packhouse.Site
|
|
451
|
+
*/
|
|
452
|
+
|
|
453
|
+
exports.default = _default;
|
|
@@ -43,6 +43,8 @@ var _ShiftFocusMeetingController = _interopRequireDefault(require("./ShiftFocusM
|
|
|
43
43
|
|
|
44
44
|
var _ShiftHourlyEntryController = _interopRequireDefault(require("./ShiftHourlyEntryController"));
|
|
45
45
|
|
|
46
|
+
var _SoftSortBeltController = _interopRequireDefault(require("./SoftSortBeltController"));
|
|
47
|
+
|
|
46
48
|
var _VarietyController = _interopRequireDefault(require("./VarietyController"));
|
|
47
49
|
|
|
48
50
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -76,6 +78,7 @@ var Site = {
|
|
|
76
78
|
ShiftController: _ShiftController.default,
|
|
77
79
|
ShiftFocusMeetingController: _ShiftFocusMeetingController.default,
|
|
78
80
|
ShiftHourlyEntryController: _ShiftHourlyEntryController.default,
|
|
81
|
+
SoftSortBeltController: _SoftSortBeltController.default,
|
|
79
82
|
VarietyController: _VarietyController.default
|
|
80
83
|
};
|
|
81
84
|
var _default = Site;
|