@ricado/api-client 2.1.0 → 2.3.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/README.md +5 -7
- package/dist/ricado.api.client.js +1 -1
- package/lib/Controllers/Packhouse/Site/BinTipBinController.js +622 -0
- package/lib/Controllers/Packhouse/Site/CompacSizerController.js +3 -3
- package/lib/Controllers/Packhouse/Site/FreshQualityPackrunSummaryController.js +657 -0
- package/lib/Controllers/Packhouse/Site/PackingLineController.js +25 -1
- package/lib/Controllers/Packhouse/Site/PackrunController.js +42 -0
- package/lib/Controllers/Packhouse/Site/RejectBinScaleController.js +24 -2
- package/lib/Controllers/Packhouse/Site/ShiftHourlyEntryController.js +15 -0
- package/lib/Controllers/Packhouse/Site/ShiftQualitySummaryController.js +661 -0
- package/lib/Controllers/Packhouse/Site/ShiftTaskController.js +628 -0
- package/lib/Controllers/Packhouse/Site/SoftSortBeltController.js +453 -0
- package/lib/Controllers/Packhouse/Site/index.js +15 -0
- package/lib/DataItems/PointValueItem.js +3 -3
- package/lib/Models/AccountPolicyModel.js +7 -7
- package/lib/Models/ApiAccountModel.js +7 -7
- package/lib/Models/CompanyModel.js +5 -5
- package/lib/Models/FirebaseTokenModel.js +8 -8
- package/lib/Models/Packhouse/Site/BinTipBinModel.js +367 -0
- package/lib/Models/Packhouse/Site/BinTipWeightModel.js +9 -9
- package/lib/Models/Packhouse/Site/CompacSizerBatchModel.js +8 -8
- package/lib/Models/Packhouse/Site/CompacSizerModel.js +15 -15
- package/lib/Models/Packhouse/Site/CompacSizerOutletProductChangeModel.js +10 -10
- package/lib/Models/Packhouse/Site/CompacSizerOutletTypeChangeModel.js +8 -8
- package/lib/Models/Packhouse/Site/CompacSizerOutletTypeModel.js +6 -6
- package/lib/Models/Packhouse/Site/CompacSizerPackrunSummaryModel.js +12 -12
- package/lib/Models/Packhouse/Site/DowntimeEventModel.js +14 -14
- package/lib/Models/Packhouse/Site/FreshPackPackrunSummaryModel.js +8 -8
- package/lib/Models/Packhouse/Site/FreshQualityPackrunSummaryModel.js +481 -0
- package/lib/Models/Packhouse/Site/GrowingMethodModel.js +6 -6
- package/lib/Models/Packhouse/Site/PackTypeModel.js +8 -8
- package/lib/Models/Packhouse/Site/PackingLineModel.js +539 -16
- package/lib/Models/Packhouse/Site/PackrunModel.js +81 -15
- package/lib/Models/Packhouse/Site/RejectBinModel.js +9 -9
- package/lib/Models/Packhouse/Site/RejectBinScaleModel.js +271 -15
- package/lib/Models/Packhouse/Site/RejectBinWeightModel.js +10 -10
- package/lib/Models/Packhouse/Site/ShiftFocusMeetingModel.js +12 -12
- package/lib/Models/Packhouse/Site/ShiftHourlyEntryModel.js +204 -38
- package/lib/Models/Packhouse/Site/ShiftModel.js +26 -19
- package/lib/Models/Packhouse/Site/ShiftQualitySummaryModel.js +599 -0
- package/lib/Models/Packhouse/Site/ShiftTaskModel.js +373 -0
- package/lib/Models/Packhouse/Site/SoftSortBeltModel.js +235 -0
- package/lib/Models/Packhouse/Site/VarietyModel.js +8 -8
- package/lib/Models/Packhouse/Site/index.js +15 -0
- package/lib/Models/RTUModel.js +6 -6
- package/lib/Models/RTUPluginModel.js +5 -5
- package/lib/Models/Site/AlarmGroupModel.js +7 -7
- package/lib/Models/Site/AlarmModel.js +17 -17
- package/lib/Models/Site/DefinitionModel.js +6 -6
- package/lib/Models/Site/PermanentObjectDataModel.js +8 -8
- package/lib/Models/Site/PermanentObjectModel.js +7 -7
- package/lib/Models/Site/PointModel.js +11 -11
- package/lib/Models/Site/TemporaryObjectModel.js +6 -6
- package/lib/Models/SiteModel.js +6 -6
- package/lib/Models/TokenModel.js +10 -10
- package/lib/Models/UserAccountActionTokenModel.js +11 -11
- package/lib/Models/UserAccountModel.js +10 -10
- package/lib/PackageVersion.js +1 -1
- package/lib/Points.js +22 -12
- package/lib/WebSocketHelper.js +29 -13
- package/lib/index.d.ts +3853 -1290
- package/lib/index.js +3 -3
- package/package.json +1 -1
- package/src/Controllers/Packhouse/Site/BinTipBinController.js +665 -0
- package/src/Controllers/Packhouse/Site/CompacSizerController.js +3 -3
- package/src/Controllers/Packhouse/Site/FreshQualityPackrunSummaryController.js +700 -0
- package/src/Controllers/Packhouse/Site/PackingLineController.js +25 -1
- package/src/Controllers/Packhouse/Site/PackrunController.js +52 -0
- package/src/Controllers/Packhouse/Site/RejectBinScaleController.js +24 -2
- package/src/Controllers/Packhouse/Site/ShiftHourlyEntryController.js +15 -0
- package/src/Controllers/Packhouse/Site/ShiftQualitySummaryController.js +704 -0
- package/src/Controllers/Packhouse/Site/ShiftTaskController.js +671 -0
- package/src/Controllers/Packhouse/Site/SoftSortBeltController.js +474 -0
- package/src/Controllers/Packhouse/Site/index.js +10 -0
- package/src/DataItems/PointValueItem.js +3 -3
- package/src/Models/AccountPolicyModel.js +7 -7
- package/src/Models/ApiAccountModel.js +7 -7
- package/src/Models/CompanyModel.js +5 -5
- package/src/Models/FirebaseTokenModel.js +8 -8
- package/src/Models/Packhouse/Site/BinTipBinModel.js +365 -0
- package/src/Models/Packhouse/Site/BinTipWeightModel.js +9 -9
- package/src/Models/Packhouse/Site/CompacSizerBatchModel.js +8 -8
- package/src/Models/Packhouse/Site/CompacSizerModel.js +15 -15
- package/src/Models/Packhouse/Site/CompacSizerOutletProductChangeModel.js +10 -10
- package/src/Models/Packhouse/Site/CompacSizerOutletTypeChangeModel.js +8 -8
- package/src/Models/Packhouse/Site/CompacSizerOutletTypeModel.js +6 -6
- package/src/Models/Packhouse/Site/CompacSizerPackrunSummaryModel.js +12 -12
- package/src/Models/Packhouse/Site/DowntimeEventModel.js +14 -14
- package/src/Models/Packhouse/Site/FreshPackPackrunSummaryModel.js +8 -8
- package/src/Models/Packhouse/Site/FreshQualityPackrunSummaryModel.js +523 -0
- package/src/Models/Packhouse/Site/GrowingMethodModel.js +6 -6
- package/src/Models/Packhouse/Site/PackTypeModel.js +8 -8
- package/src/Models/Packhouse/Site/PackingLineModel.js +720 -16
- package/src/Models/Packhouse/Site/PackrunModel.js +90 -15
- package/src/Models/Packhouse/Site/RejectBinModel.js +9 -9
- package/src/Models/Packhouse/Site/RejectBinScaleModel.js +308 -15
- package/src/Models/Packhouse/Site/RejectBinWeightModel.js +10 -10
- package/src/Models/Packhouse/Site/ShiftFocusMeetingModel.js +12 -12
- package/src/Models/Packhouse/Site/ShiftHourlyEntryModel.js +229 -38
- package/src/Models/Packhouse/Site/ShiftModel.js +29 -19
- package/src/Models/Packhouse/Site/ShiftQualitySummaryModel.js +664 -0
- package/src/Models/Packhouse/Site/ShiftTaskModel.js +369 -0
- package/src/Models/Packhouse/Site/SoftSortBeltModel.js +215 -0
- package/src/Models/Packhouse/Site/VarietyModel.js +8 -8
- package/src/Models/Packhouse/Site/index.js +10 -0
- package/src/Models/RTUModel.js +6 -6
- package/src/Models/RTUPluginModel.js +5 -5
- package/src/Models/Site/AlarmGroupModel.js +7 -7
- package/src/Models/Site/AlarmModel.js +17 -17
- package/src/Models/Site/DefinitionModel.js +6 -6
- package/src/Models/Site/PermanentObjectDataModel.js +8 -8
- package/src/Models/Site/PermanentObjectModel.js +7 -7
- package/src/Models/Site/PointModel.js +11 -11
- package/src/Models/Site/TemporaryObjectModel.js +6 -6
- package/src/Models/SiteModel.js +6 -6
- package/src/Models/TokenModel.js +10 -10
- package/src/Models/UserAccountActionTokenModel.js +11 -11
- package/src/Models/UserAccountModel.js +10 -10
- package/src/PackageVersion.js +1 -1
- package/src/Points.js +24 -12
- package/src/WebSocketHelper.js +34 -13
- package/src/index.js +3 -3
- package/types/tslint.json +2 -1
|
@@ -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;
|
|
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
+
var _BinTipBinController = _interopRequireDefault(require("./BinTipBinController"));
|
|
9
|
+
|
|
8
10
|
var _BinTipWeightController = _interopRequireDefault(require("./BinTipWeightController"));
|
|
9
11
|
|
|
10
12
|
var _CompacSizerBatchController = _interopRequireDefault(require("./CompacSizerBatchController"));
|
|
@@ -23,6 +25,8 @@ var _DowntimeEventController = _interopRequireDefault(require("./DowntimeEventCo
|
|
|
23
25
|
|
|
24
26
|
var _FreshPackPackrunSummaryController = _interopRequireDefault(require("./FreshPackPackrunSummaryController"));
|
|
25
27
|
|
|
28
|
+
var _FreshQualityPackrunSummaryController = _interopRequireDefault(require("./FreshQualityPackrunSummaryController"));
|
|
29
|
+
|
|
26
30
|
var _GrowingMethodController = _interopRequireDefault(require("./GrowingMethodController"));
|
|
27
31
|
|
|
28
32
|
var _PackTypeController = _interopRequireDefault(require("./PackTypeController"));
|
|
@@ -43,6 +47,12 @@ var _ShiftFocusMeetingController = _interopRequireDefault(require("./ShiftFocusM
|
|
|
43
47
|
|
|
44
48
|
var _ShiftHourlyEntryController = _interopRequireDefault(require("./ShiftHourlyEntryController"));
|
|
45
49
|
|
|
50
|
+
var _ShiftQualitySummaryController = _interopRequireDefault(require("./ShiftQualitySummaryController"));
|
|
51
|
+
|
|
52
|
+
var _ShiftTaskController = _interopRequireDefault(require("./ShiftTaskController"));
|
|
53
|
+
|
|
54
|
+
var _SoftSortBeltController = _interopRequireDefault(require("./SoftSortBeltController"));
|
|
55
|
+
|
|
46
56
|
var _VarietyController = _interopRequireDefault(require("./VarietyController"));
|
|
47
57
|
|
|
48
58
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -57,6 +67,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
57
67
|
* @namespace Controllers.Packhouse.Site
|
|
58
68
|
*/
|
|
59
69
|
var Site = {
|
|
70
|
+
BinTipBinController: _BinTipBinController.default,
|
|
60
71
|
BinTipWeightController: _BinTipWeightController.default,
|
|
61
72
|
CompacSizerBatchController: _CompacSizerBatchController.default,
|
|
62
73
|
CompacSizerController: _CompacSizerController.default,
|
|
@@ -66,6 +77,7 @@ var Site = {
|
|
|
66
77
|
CompacSizerPackrunSummaryController: _CompacSizerPackrunSummaryController.default,
|
|
67
78
|
DowntimeEventController: _DowntimeEventController.default,
|
|
68
79
|
FreshPackPackrunSummaryController: _FreshPackPackrunSummaryController.default,
|
|
80
|
+
FreshQualityPackrunSummaryController: _FreshQualityPackrunSummaryController.default,
|
|
69
81
|
GrowingMethodController: _GrowingMethodController.default,
|
|
70
82
|
PackTypeController: _PackTypeController.default,
|
|
71
83
|
PackingLineController: _PackingLineController.default,
|
|
@@ -76,6 +88,9 @@ var Site = {
|
|
|
76
88
|
ShiftController: _ShiftController.default,
|
|
77
89
|
ShiftFocusMeetingController: _ShiftFocusMeetingController.default,
|
|
78
90
|
ShiftHourlyEntryController: _ShiftHourlyEntryController.default,
|
|
91
|
+
ShiftQualitySummaryController: _ShiftQualitySummaryController.default,
|
|
92
|
+
ShiftTaskController: _ShiftTaskController.default,
|
|
93
|
+
SoftSortBeltController: _SoftSortBeltController.default,
|
|
79
94
|
VarietyController: _VarietyController.default
|
|
80
95
|
};
|
|
81
96
|
var _default = Site;
|
|
@@ -40,7 +40,7 @@ var PointValueItem = /*#__PURE__*/function () {
|
|
|
40
40
|
* @type {number}
|
|
41
41
|
* @private
|
|
42
42
|
*/
|
|
43
|
-
this._id =
|
|
43
|
+
this._id = 0;
|
|
44
44
|
/**
|
|
45
45
|
* The Point Value
|
|
46
46
|
*
|
|
@@ -48,7 +48,7 @@ var PointValueItem = /*#__PURE__*/function () {
|
|
|
48
48
|
* @private
|
|
49
49
|
*/
|
|
50
50
|
|
|
51
|
-
this._value =
|
|
51
|
+
this._value = null;
|
|
52
52
|
/**
|
|
53
53
|
* When the Point Value last changed
|
|
54
54
|
*
|
|
@@ -56,7 +56,7 @@ var PointValueItem = /*#__PURE__*/function () {
|
|
|
56
56
|
* @private
|
|
57
57
|
*/
|
|
58
58
|
|
|
59
|
-
this._timestamp =
|
|
59
|
+
this._timestamp = new Date();
|
|
60
60
|
}
|
|
61
61
|
/**
|
|
62
62
|
* The Point ID
|
|
@@ -61,7 +61,7 @@ var AccountPolicyModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
61
61
|
* @public
|
|
62
62
|
*/
|
|
63
63
|
|
|
64
|
-
_this.id =
|
|
64
|
+
_this.id = "";
|
|
65
65
|
/**
|
|
66
66
|
* The Policy Name
|
|
67
67
|
*
|
|
@@ -69,7 +69,7 @@ var AccountPolicyModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
69
69
|
* @public
|
|
70
70
|
*/
|
|
71
71
|
|
|
72
|
-
_this.name =
|
|
72
|
+
_this.name = "";
|
|
73
73
|
/**
|
|
74
74
|
* The Company this Policy belongs to
|
|
75
75
|
*
|
|
@@ -77,7 +77,7 @@ var AccountPolicyModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
77
77
|
* @public
|
|
78
78
|
*/
|
|
79
79
|
|
|
80
|
-
_this.companyId =
|
|
80
|
+
_this.companyId = "";
|
|
81
81
|
/**
|
|
82
82
|
* The Resources this Policy provides
|
|
83
83
|
*
|
|
@@ -85,7 +85,7 @@ var AccountPolicyModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
85
85
|
* @public
|
|
86
86
|
*/
|
|
87
87
|
|
|
88
|
-
_this.resources =
|
|
88
|
+
_this.resources = [];
|
|
89
89
|
/**
|
|
90
90
|
* The Rules this Policy provides
|
|
91
91
|
*
|
|
@@ -93,7 +93,7 @@ var AccountPolicyModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
93
93
|
* @public
|
|
94
94
|
*/
|
|
95
95
|
|
|
96
|
-
_this.rules =
|
|
96
|
+
_this.rules = [];
|
|
97
97
|
/**
|
|
98
98
|
* Whether the Account Policy has been deleted
|
|
99
99
|
*
|
|
@@ -101,7 +101,7 @@ var AccountPolicyModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
101
101
|
* @public
|
|
102
102
|
*/
|
|
103
103
|
|
|
104
|
-
_this.deleted =
|
|
104
|
+
_this.deleted = false;
|
|
105
105
|
/**
|
|
106
106
|
* When the Account Policy was last updated
|
|
107
107
|
*
|
|
@@ -109,7 +109,7 @@ var AccountPolicyModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
109
109
|
* @public
|
|
110
110
|
*/
|
|
111
111
|
|
|
112
|
-
_this.updateTimestamp =
|
|
112
|
+
_this.updateTimestamp = new Date();
|
|
113
113
|
return _this;
|
|
114
114
|
}
|
|
115
115
|
/**
|
|
@@ -61,7 +61,7 @@ var ApiAccountModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
61
61
|
* @public
|
|
62
62
|
*/
|
|
63
63
|
|
|
64
|
-
_this.id =
|
|
64
|
+
_this.id = "";
|
|
65
65
|
/**
|
|
66
66
|
* API Key
|
|
67
67
|
*
|
|
@@ -69,7 +69,7 @@ var ApiAccountModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
69
69
|
* @public
|
|
70
70
|
*/
|
|
71
71
|
|
|
72
|
-
_this.key =
|
|
72
|
+
_this.key = null;
|
|
73
73
|
/**
|
|
74
74
|
* The API Account Name
|
|
75
75
|
*
|
|
@@ -77,7 +77,7 @@ var ApiAccountModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
77
77
|
* @public
|
|
78
78
|
*/
|
|
79
79
|
|
|
80
|
-
_this.name =
|
|
80
|
+
_this.name = "";
|
|
81
81
|
/**
|
|
82
82
|
* The Company this API Account belongs to
|
|
83
83
|
*
|
|
@@ -85,7 +85,7 @@ var ApiAccountModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
85
85
|
* @public
|
|
86
86
|
*/
|
|
87
87
|
|
|
88
|
-
_this.companyId =
|
|
88
|
+
_this.companyId = "";
|
|
89
89
|
/**
|
|
90
90
|
* The Policies that apply to this API Account
|
|
91
91
|
*
|
|
@@ -93,7 +93,7 @@ var ApiAccountModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
93
93
|
* @public
|
|
94
94
|
*/
|
|
95
95
|
|
|
96
|
-
_this.policies =
|
|
96
|
+
_this.policies = [];
|
|
97
97
|
/**
|
|
98
98
|
* Whether the API Account has been deleted
|
|
99
99
|
*
|
|
@@ -101,7 +101,7 @@ var ApiAccountModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
101
101
|
* @public
|
|
102
102
|
*/
|
|
103
103
|
|
|
104
|
-
_this.deleted =
|
|
104
|
+
_this.deleted = false;
|
|
105
105
|
/**
|
|
106
106
|
* When the API Account was last updated
|
|
107
107
|
*
|
|
@@ -109,7 +109,7 @@ var ApiAccountModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
109
109
|
* @public
|
|
110
110
|
*/
|
|
111
111
|
|
|
112
|
-
_this.updateTimestamp =
|
|
112
|
+
_this.updateTimestamp = new Date();
|
|
113
113
|
return _this;
|
|
114
114
|
}
|
|
115
115
|
/**
|