@ricado/api-client 2.1.1 → 2.2.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/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/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/index.js +12 -0
- package/lib/Models/Packhouse/Site/BinTipBinModel.js +367 -0
- package/lib/Models/Packhouse/Site/CompacSizerModel.js +1 -1
- package/lib/Models/Packhouse/Site/FreshQualityPackrunSummaryModel.js +481 -0
- package/lib/Models/Packhouse/Site/PackingLineModel.js +524 -1
- package/lib/Models/Packhouse/Site/PackrunModel.js +66 -0
- package/lib/Models/Packhouse/Site/ShiftHourlyEntryModel.js +167 -1
- package/lib/Models/Packhouse/Site/ShiftQualitySummaryModel.js +599 -0
- package/lib/Models/Packhouse/Site/ShiftTaskModel.js +373 -0
- package/lib/Models/Packhouse/Site/index.js +12 -0
- package/lib/PackageVersion.js +1 -1
- package/lib/index.d.ts +2241 -146
- 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/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/index.js +8 -0
- package/src/Models/Packhouse/Site/BinTipBinModel.js +365 -0
- package/src/Models/Packhouse/Site/CompacSizerModel.js +1 -1
- package/src/Models/Packhouse/Site/FreshQualityPackrunSummaryModel.js +523 -0
- package/src/Models/Packhouse/Site/PackingLineModel.js +705 -1
- package/src/Models/Packhouse/Site/PackrunModel.js +75 -0
- package/src/Models/Packhouse/Site/ShiftHourlyEntryModel.js +192 -1
- package/src/Models/Packhouse/Site/ShiftQualitySummaryModel.js +664 -0
- package/src/Models/Packhouse/Site/ShiftTaskModel.js +369 -0
- package/src/Models/Packhouse/Site/index.js +8 -0
- package/src/PackageVersion.js +1 -1
|
@@ -0,0 +1,622 @@
|
|
|
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 _BinTipBinModel = _interopRequireDefault(require("../../../Models/Packhouse/Site/BinTipBinModel"));
|
|
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 Bin Tip Bins
|
|
24
|
+
*
|
|
25
|
+
* @class
|
|
26
|
+
*/
|
|
27
|
+
var BinTipBinController = /*#__PURE__*/function () {
|
|
28
|
+
function BinTipBinController() {
|
|
29
|
+
_classCallCheck(this, BinTipBinController);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
_createClass(BinTipBinController, null, [{
|
|
33
|
+
key: "getOne",
|
|
34
|
+
value:
|
|
35
|
+
/**
|
|
36
|
+
* Retrieve a Bin Tip Bin [GET /packhouse/sites/{siteId}/bin-tip-bins/{id}]
|
|
37
|
+
*
|
|
38
|
+
* @static
|
|
39
|
+
* @public
|
|
40
|
+
* @param {number} siteId The Site ID
|
|
41
|
+
* @param {string} id The Bin Tip Bin ID
|
|
42
|
+
* @return {Promise<BinTipBinModel>}
|
|
43
|
+
*/
|
|
44
|
+
function getOne(siteId, id) {
|
|
45
|
+
return new Promise(function (resolve, reject) {
|
|
46
|
+
_RequestHelper.default.getRequest("/packhouse/sites/".concat(siteId, "/bin-tip-bins/").concat(id)).then(function (result) {
|
|
47
|
+
var resolveValue = function () {
|
|
48
|
+
return _BinTipBinModel.default.fromJSON(result, siteId);
|
|
49
|
+
}();
|
|
50
|
+
|
|
51
|
+
resolve(resolveValue);
|
|
52
|
+
}).catch(function (error) {
|
|
53
|
+
return reject(error);
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Update a Bin Tip Bin [PATCH /packhouse/sites/{siteId}/bin-tip-bins/{id}]
|
|
59
|
+
*
|
|
60
|
+
* @static
|
|
61
|
+
* @public
|
|
62
|
+
* @param {number} siteId The Site ID
|
|
63
|
+
* @param {string} id The Bin Tip Bin ID
|
|
64
|
+
* @param {BinTipBinController.UpdateData} updateData The Bin Tip Bin Update Data
|
|
65
|
+
* @return {Promise<BinTipBinModel>}
|
|
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, "/bin-tip-bins/").concat(id), updateData).then(function (result) {
|
|
73
|
+
var resolveValue = function () {
|
|
74
|
+
return _BinTipBinModel.default.fromJSON(result, siteId);
|
|
75
|
+
}();
|
|
76
|
+
|
|
77
|
+
resolve(resolveValue);
|
|
78
|
+
}).catch(function (error) {
|
|
79
|
+
return reject(error);
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Delete a Bin Tip Bin [DELETE /packhouse/sites/{siteId}/bin-tip-bins/{id}]
|
|
85
|
+
*
|
|
86
|
+
* @static
|
|
87
|
+
* @public
|
|
88
|
+
* @param {number} siteId The Site ID
|
|
89
|
+
* @param {string} id The Bin Tip Bin 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, "/bin-tip-bins/").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 Comments [GET /packhouse/sites/{siteId}/bin-tip-bins/{id}/comments]
|
|
106
|
+
*
|
|
107
|
+
* Retrieves Comments for a Bin Tip Bin
|
|
108
|
+
*
|
|
109
|
+
* @static
|
|
110
|
+
* @public
|
|
111
|
+
* @param {number} siteId The Site ID
|
|
112
|
+
* @param {string} id The Bin Tip Bin ID
|
|
113
|
+
* @return {Promise<Array<BinTipBinController.CommentItem>>}
|
|
114
|
+
*/
|
|
115
|
+
|
|
116
|
+
}, {
|
|
117
|
+
key: "getComments",
|
|
118
|
+
value: function getComments(siteId, id) {
|
|
119
|
+
return new Promise(function (resolve, reject) {
|
|
120
|
+
_RequestHelper.default.getRequest("/packhouse/sites/".concat(siteId, "/bin-tip-bins/").concat(id, "/comments")).then(function (result) {
|
|
121
|
+
var resolveValue = function () {
|
|
122
|
+
if (Array.isArray(result) !== true) {
|
|
123
|
+
return [];
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return result.map(function (resultItem) {
|
|
127
|
+
return function () {
|
|
128
|
+
var resultItemObject = {};
|
|
129
|
+
|
|
130
|
+
if (_typeof(resultItem) === 'object' && 'id' in resultItem) {
|
|
131
|
+
resultItemObject.id = function () {
|
|
132
|
+
if (typeof resultItem.id !== 'string') {
|
|
133
|
+
return String(resultItem.id);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
return resultItem.id;
|
|
137
|
+
}();
|
|
138
|
+
} else {
|
|
139
|
+
resultItemObject.id = "";
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
if (_typeof(resultItem) === 'object' && 'content' in resultItem) {
|
|
143
|
+
resultItemObject.content = function () {
|
|
144
|
+
if (resultItem.content === null) {
|
|
145
|
+
return null;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
if (typeof resultItem.content !== 'string') {
|
|
149
|
+
return String(resultItem.content);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
return resultItem.content;
|
|
153
|
+
}();
|
|
154
|
+
} else {
|
|
155
|
+
resultItemObject.content = null;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
if (_typeof(resultItem) === 'object' && 'createdTimestamp' in resultItem) {
|
|
159
|
+
resultItemObject.createdTimestamp = function () {
|
|
160
|
+
if (resultItem.createdTimestamp === null) {
|
|
161
|
+
return null;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
if (typeof resultItem.createdTimestamp !== 'string') {
|
|
165
|
+
return new Date(String(resultItem.createdTimestamp));
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return new Date(resultItem.createdTimestamp);
|
|
169
|
+
}();
|
|
170
|
+
} else {
|
|
171
|
+
resultItemObject.createdTimestamp = null;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
if (_typeof(resultItem) === 'object' && 'updatedTimestamp' in resultItem) {
|
|
175
|
+
resultItemObject.updatedTimestamp = function () {
|
|
176
|
+
if (resultItem.updatedTimestamp === null) {
|
|
177
|
+
return null;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
if (typeof resultItem.updatedTimestamp !== 'string') {
|
|
181
|
+
return new Date(String(resultItem.updatedTimestamp));
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
return new Date(resultItem.updatedTimestamp);
|
|
185
|
+
}();
|
|
186
|
+
} else {
|
|
187
|
+
resultItemObject.updatedTimestamp = null;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
return resultItemObject;
|
|
191
|
+
}();
|
|
192
|
+
});
|
|
193
|
+
}();
|
|
194
|
+
|
|
195
|
+
resolve(resolveValue);
|
|
196
|
+
}).catch(function (error) {
|
|
197
|
+
return reject(error);
|
|
198
|
+
});
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Create a Comment [POST /packhouse/sites/{siteId}/bin-tip-bins/{id}/comments]
|
|
203
|
+
*
|
|
204
|
+
* Create a Comment for a Bin Tip Bin
|
|
205
|
+
*
|
|
206
|
+
* @static
|
|
207
|
+
* @public
|
|
208
|
+
* @param {number} siteId The Site ID
|
|
209
|
+
* @param {string} id The Bin Tip Bin ID
|
|
210
|
+
* @param {string} content The Content of the New Comment
|
|
211
|
+
* @return {Promise<BinTipBinController.CommentItem>}
|
|
212
|
+
*/
|
|
213
|
+
|
|
214
|
+
}, {
|
|
215
|
+
key: "createComment",
|
|
216
|
+
value: function createComment(siteId, id, content) {
|
|
217
|
+
return new Promise(function (resolve, reject) {
|
|
218
|
+
_RequestHelper.default.postRequest("/packhouse/sites/".concat(siteId, "/bin-tip-bins/").concat(id, "/comments"), {
|
|
219
|
+
content: content
|
|
220
|
+
}).then(function (result) {
|
|
221
|
+
var resolveValue = function () {
|
|
222
|
+
var resultObject = {};
|
|
223
|
+
|
|
224
|
+
if (_typeof(result) === 'object' && 'id' in result) {
|
|
225
|
+
resultObject.id = function () {
|
|
226
|
+
if (typeof result.id !== 'string') {
|
|
227
|
+
return String(result.id);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
return result.id;
|
|
231
|
+
}();
|
|
232
|
+
} else {
|
|
233
|
+
resultObject.id = "";
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
if (_typeof(result) === 'object' && 'content' in result) {
|
|
237
|
+
resultObject.content = function () {
|
|
238
|
+
if (result.content === null) {
|
|
239
|
+
return null;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
if (typeof result.content !== 'string') {
|
|
243
|
+
return String(result.content);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
return result.content;
|
|
247
|
+
}();
|
|
248
|
+
} else {
|
|
249
|
+
resultObject.content = null;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
if (_typeof(result) === 'object' && 'createdTimestamp' in result) {
|
|
253
|
+
resultObject.createdTimestamp = function () {
|
|
254
|
+
if (result.createdTimestamp === null) {
|
|
255
|
+
return null;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
if (typeof result.createdTimestamp !== 'string') {
|
|
259
|
+
return new Date(String(result.createdTimestamp));
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
return new Date(result.createdTimestamp);
|
|
263
|
+
}();
|
|
264
|
+
} else {
|
|
265
|
+
resultObject.createdTimestamp = null;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
if (_typeof(result) === 'object' && 'updatedTimestamp' in result) {
|
|
269
|
+
resultObject.updatedTimestamp = function () {
|
|
270
|
+
if (result.updatedTimestamp === null) {
|
|
271
|
+
return null;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
if (typeof result.updatedTimestamp !== 'string') {
|
|
275
|
+
return new Date(String(result.updatedTimestamp));
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
return new Date(result.updatedTimestamp);
|
|
279
|
+
}();
|
|
280
|
+
} else {
|
|
281
|
+
resultObject.updatedTimestamp = null;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
return resultObject;
|
|
285
|
+
}();
|
|
286
|
+
|
|
287
|
+
resolve(resolveValue);
|
|
288
|
+
}).catch(function (error) {
|
|
289
|
+
return reject(error);
|
|
290
|
+
});
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Retrieve a Comment [GET /packhouse/sites/{siteId}/bin-tip-bins/{id}/comments/{commentId}]
|
|
295
|
+
*
|
|
296
|
+
* Retrieves Comments for a Bin Tip Bin
|
|
297
|
+
*
|
|
298
|
+
* @static
|
|
299
|
+
* @public
|
|
300
|
+
* @param {number} siteId The Site ID
|
|
301
|
+
* @param {string} id The Bin Tip Bin ID
|
|
302
|
+
* @param {string} commentId The Comment ID
|
|
303
|
+
* @return {Promise<BinTipBinController.CommentItem>}
|
|
304
|
+
*/
|
|
305
|
+
|
|
306
|
+
}, {
|
|
307
|
+
key: "getOneComment",
|
|
308
|
+
value: function getOneComment(siteId, id, commentId) {
|
|
309
|
+
return new Promise(function (resolve, reject) {
|
|
310
|
+
_RequestHelper.default.getRequest("/packhouse/sites/".concat(siteId, "/bin-tip-bins/").concat(id, "/comments/").concat(commentId)).then(function (result) {
|
|
311
|
+
var resolveValue = function () {
|
|
312
|
+
var resultObject = {};
|
|
313
|
+
|
|
314
|
+
if (_typeof(result) === 'object' && 'id' in result) {
|
|
315
|
+
resultObject.id = function () {
|
|
316
|
+
if (typeof result.id !== 'string') {
|
|
317
|
+
return String(result.id);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
return result.id;
|
|
321
|
+
}();
|
|
322
|
+
} else {
|
|
323
|
+
resultObject.id = "";
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
if (_typeof(result) === 'object' && 'content' in result) {
|
|
327
|
+
resultObject.content = function () {
|
|
328
|
+
if (result.content === null) {
|
|
329
|
+
return null;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
if (typeof result.content !== 'string') {
|
|
333
|
+
return String(result.content);
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
return result.content;
|
|
337
|
+
}();
|
|
338
|
+
} else {
|
|
339
|
+
resultObject.content = null;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
if (_typeof(result) === 'object' && 'createdTimestamp' in result) {
|
|
343
|
+
resultObject.createdTimestamp = function () {
|
|
344
|
+
if (result.createdTimestamp === null) {
|
|
345
|
+
return null;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
if (typeof result.createdTimestamp !== 'string') {
|
|
349
|
+
return new Date(String(result.createdTimestamp));
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
return new Date(result.createdTimestamp);
|
|
353
|
+
}();
|
|
354
|
+
} else {
|
|
355
|
+
resultObject.createdTimestamp = null;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
if (_typeof(result) === 'object' && 'updatedTimestamp' in result) {
|
|
359
|
+
resultObject.updatedTimestamp = function () {
|
|
360
|
+
if (result.updatedTimestamp === null) {
|
|
361
|
+
return null;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
if (typeof result.updatedTimestamp !== 'string') {
|
|
365
|
+
return new Date(String(result.updatedTimestamp));
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
return new Date(result.updatedTimestamp);
|
|
369
|
+
}();
|
|
370
|
+
} else {
|
|
371
|
+
resultObject.updatedTimestamp = null;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
return resultObject;
|
|
375
|
+
}();
|
|
376
|
+
|
|
377
|
+
resolve(resolveValue);
|
|
378
|
+
}).catch(function (error) {
|
|
379
|
+
return reject(error);
|
|
380
|
+
});
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* Update a Comment [PATCH /packhouse/sites/{siteId}/bin-tip-bins/{id}/comments/{commentId}]
|
|
385
|
+
*
|
|
386
|
+
* Update a Comment for a Bin Tip Bin
|
|
387
|
+
*
|
|
388
|
+
* @static
|
|
389
|
+
* @public
|
|
390
|
+
* @param {number} siteId The Site ID
|
|
391
|
+
* @param {string} id The Bin Tip Bin ID
|
|
392
|
+
* @param {string} commentId The Comment ID
|
|
393
|
+
* @param {string} content The Updated Content for the Comment
|
|
394
|
+
* @return {Promise<BinTipBinController.CommentItem>}
|
|
395
|
+
*/
|
|
396
|
+
|
|
397
|
+
}, {
|
|
398
|
+
key: "updateOneComment",
|
|
399
|
+
value: function updateOneComment(siteId, id, commentId, content) {
|
|
400
|
+
return new Promise(function (resolve, reject) {
|
|
401
|
+
_RequestHelper.default.patchRequest("/packhouse/sites/".concat(siteId, "/bin-tip-bins/").concat(id, "/comments/").concat(commentId), {
|
|
402
|
+
content: content
|
|
403
|
+
}).then(function (result) {
|
|
404
|
+
var resolveValue = function () {
|
|
405
|
+
var resultObject = {};
|
|
406
|
+
|
|
407
|
+
if (_typeof(result) === 'object' && 'id' in result) {
|
|
408
|
+
resultObject.id = function () {
|
|
409
|
+
if (typeof result.id !== 'string') {
|
|
410
|
+
return String(result.id);
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
return result.id;
|
|
414
|
+
}();
|
|
415
|
+
} else {
|
|
416
|
+
resultObject.id = "";
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
if (_typeof(result) === 'object' && 'content' in result) {
|
|
420
|
+
resultObject.content = function () {
|
|
421
|
+
if (result.content === null) {
|
|
422
|
+
return null;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
if (typeof result.content !== 'string') {
|
|
426
|
+
return String(result.content);
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
return result.content;
|
|
430
|
+
}();
|
|
431
|
+
} else {
|
|
432
|
+
resultObject.content = null;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
if (_typeof(result) === 'object' && 'createdTimestamp' in result) {
|
|
436
|
+
resultObject.createdTimestamp = function () {
|
|
437
|
+
if (result.createdTimestamp === null) {
|
|
438
|
+
return null;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
if (typeof result.createdTimestamp !== 'string') {
|
|
442
|
+
return new Date(String(result.createdTimestamp));
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
return new Date(result.createdTimestamp);
|
|
446
|
+
}();
|
|
447
|
+
} else {
|
|
448
|
+
resultObject.createdTimestamp = null;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
if (_typeof(result) === 'object' && 'updatedTimestamp' in result) {
|
|
452
|
+
resultObject.updatedTimestamp = function () {
|
|
453
|
+
if (result.updatedTimestamp === null) {
|
|
454
|
+
return null;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
if (typeof result.updatedTimestamp !== 'string') {
|
|
458
|
+
return new Date(String(result.updatedTimestamp));
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
return new Date(result.updatedTimestamp);
|
|
462
|
+
}();
|
|
463
|
+
} else {
|
|
464
|
+
resultObject.updatedTimestamp = null;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
return resultObject;
|
|
468
|
+
}();
|
|
469
|
+
|
|
470
|
+
resolve(resolveValue);
|
|
471
|
+
}).catch(function (error) {
|
|
472
|
+
return reject(error);
|
|
473
|
+
});
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
/**
|
|
477
|
+
* Delete a Comment [DELETE /packhouse/sites/{siteId}/bin-tip-bins/{id}/comments/{commentId}]
|
|
478
|
+
*
|
|
479
|
+
* Delete a Comment for a Bin Tip Bin
|
|
480
|
+
*
|
|
481
|
+
* @static
|
|
482
|
+
* @public
|
|
483
|
+
* @param {number} siteId The Site ID
|
|
484
|
+
* @param {string} id The Bin Tip Bin ID
|
|
485
|
+
* @param {string} commentId The Comment ID
|
|
486
|
+
* @return {Promise<boolean>}
|
|
487
|
+
*/
|
|
488
|
+
|
|
489
|
+
}, {
|
|
490
|
+
key: "deleteOneComment",
|
|
491
|
+
value: function deleteOneComment(siteId, id, commentId) {
|
|
492
|
+
return new Promise(function (resolve, reject) {
|
|
493
|
+
_RequestHelper.default.deleteRequest("/packhouse/sites/".concat(siteId, "/bin-tip-bins/").concat(id, "/comments/").concat(commentId)).then(function (result) {
|
|
494
|
+
resolve(result !== null && result !== void 0 ? result : true);
|
|
495
|
+
}).catch(function (error) {
|
|
496
|
+
return reject(error);
|
|
497
|
+
});
|
|
498
|
+
});
|
|
499
|
+
}
|
|
500
|
+
/**
|
|
501
|
+
* List all Bin Tip Bins [GET /packhouse/sites/{siteId}/bin-tip-bins]
|
|
502
|
+
*
|
|
503
|
+
* @static
|
|
504
|
+
* @public
|
|
505
|
+
* @param {number} siteId The Site ID
|
|
506
|
+
* @param {BinTipBinController.GetAllQueryParameters} [queryParameters] The Optional Query Parameters
|
|
507
|
+
* @return {Promise<BinTipBinModel[]>}
|
|
508
|
+
*/
|
|
509
|
+
|
|
510
|
+
}, {
|
|
511
|
+
key: "getAll",
|
|
512
|
+
value: function getAll(siteId) {
|
|
513
|
+
var queryParameters = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
514
|
+
return new Promise(function (resolve, reject) {
|
|
515
|
+
_RequestHelper.default.getRequest("/packhouse/sites/".concat(siteId, "/bin-tip-bins"), queryParameters).then(function (result) {
|
|
516
|
+
var resolveValue = function () {
|
|
517
|
+
if (Array.isArray(result) !== true) {
|
|
518
|
+
return [];
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
return result.map(function (resultItem) {
|
|
522
|
+
return function () {
|
|
523
|
+
return _BinTipBinModel.default.fromJSON(resultItem, siteId);
|
|
524
|
+
}();
|
|
525
|
+
});
|
|
526
|
+
}();
|
|
527
|
+
|
|
528
|
+
resolve(resolveValue);
|
|
529
|
+
}).catch(function (error) {
|
|
530
|
+
return reject(error);
|
|
531
|
+
});
|
|
532
|
+
});
|
|
533
|
+
}
|
|
534
|
+
/**
|
|
535
|
+
* Create a Bin Tip Bin [POST /packhouse/sites/{siteId}/bin-tip-bins]
|
|
536
|
+
*
|
|
537
|
+
* @static
|
|
538
|
+
* @public
|
|
539
|
+
* @param {number} siteId The Site ID
|
|
540
|
+
* @param {BinTipBinController.CreateData} createData The Bin Tip Bin Create Data
|
|
541
|
+
* @return {Promise<BinTipBinModel>}
|
|
542
|
+
*/
|
|
543
|
+
|
|
544
|
+
}, {
|
|
545
|
+
key: "create",
|
|
546
|
+
value: function create(siteId, createData) {
|
|
547
|
+
return new Promise(function (resolve, reject) {
|
|
548
|
+
_RequestHelper.default.postRequest("/packhouse/sites/".concat(siteId, "/bin-tip-bins"), createData).then(function (result) {
|
|
549
|
+
var resolveValue = function () {
|
|
550
|
+
return _BinTipBinModel.default.fromJSON(result, siteId);
|
|
551
|
+
}();
|
|
552
|
+
|
|
553
|
+
resolve(resolveValue);
|
|
554
|
+
}).catch(function (error) {
|
|
555
|
+
return reject(error);
|
|
556
|
+
});
|
|
557
|
+
});
|
|
558
|
+
}
|
|
559
|
+
}]);
|
|
560
|
+
|
|
561
|
+
return BinTipBinController;
|
|
562
|
+
}();
|
|
563
|
+
|
|
564
|
+
var _default = BinTipBinController;
|
|
565
|
+
/**
|
|
566
|
+
* The Optional Query Parameters for the getAll Function
|
|
567
|
+
*
|
|
568
|
+
* @typedef {Object} BinTipBinController.GetAllQueryParameters
|
|
569
|
+
* @property {string} [binTipId] The Bin Tip ID associated with this Bin
|
|
570
|
+
* @property {string} [packrunId] The Packrun ID associated with this Bin
|
|
571
|
+
* @property {?string} [fullBinWeightId] The `BinTipWeight` ID as the Source for the Full Weight of this Bin
|
|
572
|
+
* @property {?string} [emptyBinWeightId] The `BinTipWeight` ID as the Source for the Empty Weight of this Bin
|
|
573
|
+
* @property {Date} [createdTimestampBegin] Filter by the Timestamp when this Bin was Created. Results Greater than or Equal to Timestamp
|
|
574
|
+
* @property {Date} [createdTimestampEnd] Filter by the Timestamp when this Bin was Created. Results Less than or Equal to Timestamp
|
|
575
|
+
* @memberof Controllers.Packhouse.Site
|
|
576
|
+
*/
|
|
577
|
+
|
|
578
|
+
/**
|
|
579
|
+
* The Create Data for a Bin Tip Bin
|
|
580
|
+
*
|
|
581
|
+
* @typedef {Object} BinTipBinController.CreateData
|
|
582
|
+
* @property {string} binTipId The Bin Tip ID associated with this Bin
|
|
583
|
+
* @property {string} [packrunId] The Packrun ID associated with this Bin
|
|
584
|
+
* @property {Date} [createdTimestamp] When this Bin was Created
|
|
585
|
+
* @property {?string} [binNumber] A 10-Digit Bin Number made up of a Bin Lot (4-Digits) and a Unique Number (6-Digits)
|
|
586
|
+
* @property {?string} [timeBatchId] The Time Batch ID associated with this Bin
|
|
587
|
+
* @property {?number} [fullWeight] The Full Weight for this Bin
|
|
588
|
+
* @property {?number} [emptyWeight] The Empty Weight for this Bin
|
|
589
|
+
* @property {?string} [fullBinWeightId] The `BinTipWeight` ID as the Source for the Full Weight of this Bin
|
|
590
|
+
* @property {?string} [emptyBinWeightId] The `BinTipWeight` ID as the Source for the Empty Weight of this Bin
|
|
591
|
+
* @property {?Object} [freshPackFieldBinWeightApi] The FreshPack Field Bin Weight API Data
|
|
592
|
+
* @memberof Controllers.Packhouse.Site
|
|
593
|
+
*/
|
|
594
|
+
|
|
595
|
+
/**
|
|
596
|
+
* The Update Data for a Bin Tip Bin
|
|
597
|
+
*
|
|
598
|
+
* @typedef {Object} BinTipBinController.UpdateData
|
|
599
|
+
* @property {string} [binTipId] The Bin Tip ID associated with this Bin
|
|
600
|
+
* @property {Date} [createdTimestamp] When this Bin was Created
|
|
601
|
+
* @property {?string} [binNumber] A 10-Digit Bin Number made up of a Bin Lot (4-Digits) and a Unique Number (6-Digits)
|
|
602
|
+
* @property {?string} [timeBatchId] The Time Batch ID associated with this Bin
|
|
603
|
+
* @property {?number} [fullWeight] The Full Weight for this Bin
|
|
604
|
+
* @property {?number} [emptyWeight] The Empty Weight for this Bin
|
|
605
|
+
* @property {?string} [fullBinWeightId] The `BinTipWeight` ID as the Source for the Full Weight of this Bin
|
|
606
|
+
* @property {?string} [emptyBinWeightId] The `BinTipWeight` ID as the Source for the Empty Weight of this Bin
|
|
607
|
+
* @property {?Object} [freshPackFieldBinWeightApi] The FreshPack Field Bin Weight API Data
|
|
608
|
+
* @memberof Controllers.Packhouse.Site
|
|
609
|
+
*/
|
|
610
|
+
|
|
611
|
+
/**
|
|
612
|
+
* A **CommentItem** Type
|
|
613
|
+
*
|
|
614
|
+
* @typedef {Object} BinTipBinController.CommentItem
|
|
615
|
+
* @property {string} id The Comment ID
|
|
616
|
+
* @property {?string} content The Content of the Comment
|
|
617
|
+
* @property {?Date} createdTimestamp When the Comment was Created
|
|
618
|
+
* @property {?Date} updatedTimestamp When the Comment was last Updated
|
|
619
|
+
* @memberof Controllers.Packhouse.Site
|
|
620
|
+
*/
|
|
621
|
+
|
|
622
|
+
exports.default = _default;
|
|
@@ -171,7 +171,7 @@ var _default = CompacSizerController;
|
|
|
171
171
|
* @property {?number} [rtuId] The RTU this Compac Sizer belongs to
|
|
172
172
|
* @property {string} [name] The Compac Sizer Name
|
|
173
173
|
* @property {string} [sizerType] The Sizer Type
|
|
174
|
-
* @property {string} [packingLineId] The Packing Line ID this Compac Sizer
|
|
174
|
+
* @property {string} [packingLineId] The Packing Line ID that manages this Compac Sizer
|
|
175
175
|
* @memberof Controllers.Packhouse.Site
|
|
176
176
|
*/
|
|
177
177
|
|
|
@@ -187,7 +187,7 @@ var _default = CompacSizerController;
|
|
|
187
187
|
* @property {string} sizerType The Sizer Type
|
|
188
188
|
* @property {number} [autoCreateBatchDelay] The Auto Create Batch Delay in Seconds for this Compac Sizer
|
|
189
189
|
* @property {Object[]} [fruitSizes] The Fruit Sizes defined and handled by this Compac Sizer
|
|
190
|
-
* @property {string} packingLineId The Packing Line ID this Compac Sizer
|
|
190
|
+
* @property {string} packingLineId The Packing Line ID that manages this Compac Sizer
|
|
191
191
|
* @property {?Object} [freshPackIntegration] The FreshPack Integration Configuration for this Compac Sizer
|
|
192
192
|
* @property {Object[]} [sources] An Array of Sources that deliver Fruit to this Compac Sizer
|
|
193
193
|
* @memberof Controllers.Packhouse.Site
|
|
@@ -204,7 +204,7 @@ var _default = CompacSizerController;
|
|
|
204
204
|
* @property {string} [sizerType] The Sizer Type
|
|
205
205
|
* @property {number} [autoCreateBatchDelay] The Auto Create Batch Delay in Seconds for this Compac Sizer
|
|
206
206
|
* @property {Object[]} [fruitSizes] The Fruit Sizes defined and handled by this Compac Sizer
|
|
207
|
-
* @property {string} [packingLineId] The Packing Line ID this Compac Sizer
|
|
207
|
+
* @property {string} [packingLineId] The Packing Line ID that manages this Compac Sizer
|
|
208
208
|
* @property {?Object} [freshPackIntegration] The FreshPack Integration Configuration for this Compac Sizer
|
|
209
209
|
* @property {Object[]} [sources] An Array of Sources that deliver Fruit to this Compac Sizer
|
|
210
210
|
* @memberof Controllers.Packhouse.Site
|