@ricado/api-client 2.0.2 → 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.
Files changed (155) hide show
  1. package/README.md +5 -7
  2. package/dist/ricado.api.client.js +1 -1
  3. package/lib/Controllers/Packhouse/Site/BinTipBinController.js +622 -0
  4. package/lib/Controllers/Packhouse/Site/BinTipWeightController.js +4 -4
  5. package/lib/Controllers/Packhouse/Site/CompacSizerBatchController.js +4 -4
  6. package/lib/Controllers/Packhouse/Site/CompacSizerController.js +7 -7
  7. package/lib/Controllers/Packhouse/Site/CompacSizerOutletProductChangeController.js +4 -4
  8. package/lib/Controllers/Packhouse/Site/CompacSizerOutletTypeChangeController.js +4 -4
  9. package/lib/Controllers/Packhouse/Site/CompacSizerOutletTypeController.js +4 -4
  10. package/lib/Controllers/Packhouse/Site/CompacSizerPackrunSummaryController.js +4 -4
  11. package/lib/Controllers/Packhouse/Site/DowntimeEventController.js +4 -4
  12. package/lib/Controllers/Packhouse/Site/FreshPackPackrunSummaryController.js +4 -4
  13. package/lib/Controllers/Packhouse/Site/FreshQualityPackrunSummaryController.js +657 -0
  14. package/lib/Controllers/Packhouse/Site/GrowingMethodController.js +4 -4
  15. package/lib/Controllers/Packhouse/Site/PackTypeController.js +4 -4
  16. package/lib/Controllers/Packhouse/Site/PackingLineController.js +29 -5
  17. package/lib/Controllers/Packhouse/Site/PackrunController.js +46 -4
  18. package/lib/Controllers/Packhouse/Site/RejectBinController.js +4 -4
  19. package/lib/Controllers/Packhouse/Site/RejectBinScaleController.js +28 -6
  20. package/lib/Controllers/Packhouse/Site/RejectBinWeightController.js +4 -4
  21. package/lib/Controllers/Packhouse/Site/ShiftController.js +4 -4
  22. package/lib/Controllers/Packhouse/Site/ShiftFocusMeetingController.js +4 -4
  23. package/lib/Controllers/Packhouse/Site/ShiftHourlyEntryController.js +19 -4
  24. package/lib/Controllers/Packhouse/Site/ShiftQualitySummaryController.js +661 -0
  25. package/lib/Controllers/Packhouse/Site/ShiftTaskController.js +628 -0
  26. package/lib/Controllers/Packhouse/Site/SoftSortBeltController.js +453 -0
  27. package/lib/Controllers/Packhouse/Site/VarietyController.js +4 -4
  28. package/lib/Controllers/Packhouse/Site/index.js +15 -0
  29. package/lib/Controllers/Site/AlarmController.js +4 -4
  30. package/lib/Controllers/Site/AlarmGroupController.js +4 -4
  31. package/lib/Controllers/Site/DefinitionController.js +4 -4
  32. package/lib/Controllers/Site/PermanentObjectController.js +4 -4
  33. package/lib/Controllers/Site/PermanentObjectDataController.js +4 -4
  34. package/lib/Controllers/Site/PointController.js +4 -4
  35. package/lib/Controllers/Site/TemporaryObjectController.js +4 -4
  36. package/lib/Errors/BadRequestError.js +1 -1
  37. package/lib/Errors/ForbiddenError.js +1 -1
  38. package/lib/Errors/NetworkError.js +1 -1
  39. package/lib/Errors/NotAllowedError.js +1 -1
  40. package/lib/Errors/NotFoundError.js +1 -1
  41. package/lib/Errors/ServerError.js +1 -1
  42. package/lib/Errors/UnauthorizedError.js +1 -1
  43. package/lib/Models/AccountPolicyModel.js +1 -1
  44. package/lib/Models/ApiAccountModel.js +1 -1
  45. package/lib/Models/CompanyModel.js +1 -1
  46. package/lib/Models/FirebaseTokenModel.js +1 -1
  47. package/lib/Models/Packhouse/Site/BinTipBinModel.js +367 -0
  48. package/lib/Models/Packhouse/Site/BinTipWeightModel.js +14 -4
  49. package/lib/Models/Packhouse/Site/CompacSizerBatchModel.js +14 -4
  50. package/lib/Models/Packhouse/Site/CompacSizerModel.js +15 -5
  51. package/lib/Models/Packhouse/Site/CompacSizerOutletProductChangeModel.js +14 -4
  52. package/lib/Models/Packhouse/Site/CompacSizerOutletTypeChangeModel.js +14 -4
  53. package/lib/Models/Packhouse/Site/CompacSizerOutletTypeModel.js +14 -4
  54. package/lib/Models/Packhouse/Site/CompacSizerPackrunSummaryModel.js +14 -4
  55. package/lib/Models/Packhouse/Site/DowntimeEventModel.js +14 -4
  56. package/lib/Models/Packhouse/Site/FreshPackPackrunSummaryModel.js +14 -4
  57. package/lib/Models/Packhouse/Site/FreshQualityPackrunSummaryModel.js +481 -0
  58. package/lib/Models/Packhouse/Site/GrowingMethodModel.js +14 -4
  59. package/lib/Models/Packhouse/Site/PackTypeModel.js +14 -4
  60. package/lib/Models/Packhouse/Site/PackingLineModel.js +538 -5
  61. package/lib/Models/Packhouse/Site/PackrunModel.js +80 -4
  62. package/lib/Models/Packhouse/Site/RejectBinModel.js +14 -4
  63. package/lib/Models/Packhouse/Site/RejectBinScaleModel.js +274 -8
  64. package/lib/Models/Packhouse/Site/RejectBinWeightModel.js +14 -4
  65. package/lib/Models/Packhouse/Site/ShiftFocusMeetingModel.js +14 -4
  66. package/lib/Models/Packhouse/Site/ShiftHourlyEntryModel.js +181 -5
  67. package/lib/Models/Packhouse/Site/ShiftModel.js +14 -4
  68. package/lib/Models/Packhouse/Site/ShiftQualitySummaryModel.js +599 -0
  69. package/lib/Models/Packhouse/Site/ShiftTaskModel.js +373 -0
  70. package/lib/Models/Packhouse/Site/SoftSortBeltModel.js +235 -0
  71. package/lib/Models/Packhouse/Site/VarietyModel.js +14 -4
  72. package/lib/Models/Packhouse/Site/index.js +15 -0
  73. package/lib/Models/RTUModel.js +1 -1
  74. package/lib/Models/RTUPluginModel.js +1 -1
  75. package/lib/Models/Site/AlarmGroupModel.js +14 -4
  76. package/lib/Models/Site/AlarmModel.js +14 -4
  77. package/lib/Models/Site/DefinitionModel.js +14 -4
  78. package/lib/Models/Site/PermanentObjectDataModel.js +14 -4
  79. package/lib/Models/Site/PermanentObjectModel.js +14 -4
  80. package/lib/Models/Site/PointModel.js +14 -4
  81. package/lib/Models/Site/TemporaryObjectModel.js +14 -4
  82. package/lib/Models/SiteModel.js +1 -1
  83. package/lib/Models/TokenModel.js +1 -1
  84. package/lib/Models/UserAccountActionTokenModel.js +1 -1
  85. package/lib/Models/UserAccountModel.js +1 -1
  86. package/lib/PackageVersion.js +1 -1
  87. package/lib/index.d.ts +4039 -1071
  88. package/package.json +1 -1
  89. package/src/Controllers/Packhouse/Site/BinTipBinController.js +665 -0
  90. package/src/Controllers/Packhouse/Site/BinTipWeightController.js +4 -4
  91. package/src/Controllers/Packhouse/Site/CompacSizerBatchController.js +4 -4
  92. package/src/Controllers/Packhouse/Site/CompacSizerController.js +7 -7
  93. package/src/Controllers/Packhouse/Site/CompacSizerOutletProductChangeController.js +4 -4
  94. package/src/Controllers/Packhouse/Site/CompacSizerOutletTypeChangeController.js +4 -4
  95. package/src/Controllers/Packhouse/Site/CompacSizerOutletTypeController.js +4 -4
  96. package/src/Controllers/Packhouse/Site/CompacSizerPackrunSummaryController.js +4 -4
  97. package/src/Controllers/Packhouse/Site/DowntimeEventController.js +4 -4
  98. package/src/Controllers/Packhouse/Site/FreshPackPackrunSummaryController.js +4 -4
  99. package/src/Controllers/Packhouse/Site/FreshQualityPackrunSummaryController.js +700 -0
  100. package/src/Controllers/Packhouse/Site/GrowingMethodController.js +4 -4
  101. package/src/Controllers/Packhouse/Site/PackTypeController.js +4 -4
  102. package/src/Controllers/Packhouse/Site/PackingLineController.js +29 -5
  103. package/src/Controllers/Packhouse/Site/PackrunController.js +56 -4
  104. package/src/Controllers/Packhouse/Site/RejectBinController.js +4 -4
  105. package/src/Controllers/Packhouse/Site/RejectBinScaleController.js +28 -6
  106. package/src/Controllers/Packhouse/Site/RejectBinWeightController.js +4 -4
  107. package/src/Controllers/Packhouse/Site/ShiftController.js +4 -4
  108. package/src/Controllers/Packhouse/Site/ShiftFocusMeetingController.js +4 -4
  109. package/src/Controllers/Packhouse/Site/ShiftHourlyEntryController.js +19 -4
  110. package/src/Controllers/Packhouse/Site/ShiftQualitySummaryController.js +704 -0
  111. package/src/Controllers/Packhouse/Site/ShiftTaskController.js +671 -0
  112. package/src/Controllers/Packhouse/Site/SoftSortBeltController.js +474 -0
  113. package/src/Controllers/Packhouse/Site/VarietyController.js +4 -4
  114. package/src/Controllers/Packhouse/Site/index.js +10 -0
  115. package/src/Controllers/Site/AlarmController.js +4 -4
  116. package/src/Controllers/Site/AlarmGroupController.js +4 -4
  117. package/src/Controllers/Site/DefinitionController.js +4 -4
  118. package/src/Controllers/Site/PermanentObjectController.js +4 -4
  119. package/src/Controllers/Site/PermanentObjectDataController.js +4 -4
  120. package/src/Controllers/Site/PointController.js +4 -4
  121. package/src/Controllers/Site/TemporaryObjectController.js +4 -4
  122. package/src/Models/Packhouse/Site/BinTipBinModel.js +365 -0
  123. package/src/Models/Packhouse/Site/BinTipWeightModel.js +13 -3
  124. package/src/Models/Packhouse/Site/CompacSizerBatchModel.js +13 -3
  125. package/src/Models/Packhouse/Site/CompacSizerModel.js +14 -4
  126. package/src/Models/Packhouse/Site/CompacSizerOutletProductChangeModel.js +13 -3
  127. package/src/Models/Packhouse/Site/CompacSizerOutletTypeChangeModel.js +13 -3
  128. package/src/Models/Packhouse/Site/CompacSizerOutletTypeModel.js +13 -3
  129. package/src/Models/Packhouse/Site/CompacSizerPackrunSummaryModel.js +13 -3
  130. package/src/Models/Packhouse/Site/DowntimeEventModel.js +13 -3
  131. package/src/Models/Packhouse/Site/FreshPackPackrunSummaryModel.js +13 -3
  132. package/src/Models/Packhouse/Site/FreshQualityPackrunSummaryModel.js +523 -0
  133. package/src/Models/Packhouse/Site/GrowingMethodModel.js +13 -3
  134. package/src/Models/Packhouse/Site/PackTypeModel.js +13 -3
  135. package/src/Models/Packhouse/Site/PackingLineModel.js +718 -4
  136. package/src/Models/Packhouse/Site/PackrunModel.js +88 -3
  137. package/src/Models/Packhouse/Site/RejectBinModel.js +13 -3
  138. package/src/Models/Packhouse/Site/RejectBinScaleModel.js +310 -7
  139. package/src/Models/Packhouse/Site/RejectBinWeightModel.js +13 -3
  140. package/src/Models/Packhouse/Site/ShiftFocusMeetingModel.js +13 -3
  141. package/src/Models/Packhouse/Site/ShiftHourlyEntryModel.js +205 -4
  142. package/src/Models/Packhouse/Site/ShiftModel.js +13 -3
  143. package/src/Models/Packhouse/Site/ShiftQualitySummaryModel.js +664 -0
  144. package/src/Models/Packhouse/Site/ShiftTaskModel.js +369 -0
  145. package/src/Models/Packhouse/Site/SoftSortBeltModel.js +215 -0
  146. package/src/Models/Packhouse/Site/VarietyModel.js +13 -3
  147. package/src/Models/Packhouse/Site/index.js +10 -0
  148. package/src/Models/Site/AlarmGroupModel.js +13 -3
  149. package/src/Models/Site/AlarmModel.js +13 -3
  150. package/src/Models/Site/DefinitionModel.js +13 -3
  151. package/src/Models/Site/PermanentObjectDataModel.js +13 -3
  152. package/src/Models/Site/PermanentObjectModel.js +13 -3
  153. package/src/Models/Site/PointModel.js +13 -3
  154. package/src/Models/Site/TemporaryObjectModel.js +13 -3
  155. 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;
@@ -45,7 +45,7 @@ var BinTipWeightController = /*#__PURE__*/function () {
45
45
  return new Promise(function (resolve, reject) {
46
46
  _RequestHelper.default.getRequest("/packhouse/sites/".concat(siteId, "/bin-tip-weights/").concat(id)).then(function (result) {
47
47
  var resolveValue = function () {
48
- return _BinTipWeightModel.default.fromJSON(result);
48
+ return _BinTipWeightModel.default.fromJSON(result, siteId);
49
49
  }();
50
50
 
51
51
  resolve(resolveValue);
@@ -71,7 +71,7 @@ var BinTipWeightController = /*#__PURE__*/function () {
71
71
  return new Promise(function (resolve, reject) {
72
72
  _RequestHelper.default.patchRequest("/packhouse/sites/".concat(siteId, "/bin-tip-weights/").concat(id), updateData).then(function (result) {
73
73
  var resolveValue = function () {
74
- return _BinTipWeightModel.default.fromJSON(result);
74
+ return _BinTipWeightModel.default.fromJSON(result, siteId);
75
75
  }();
76
76
 
77
77
  resolve(resolveValue);
@@ -520,7 +520,7 @@ var BinTipWeightController = /*#__PURE__*/function () {
520
520
 
521
521
  return result.map(function (resultItem) {
522
522
  return function () {
523
- return _BinTipWeightModel.default.fromJSON(resultItem);
523
+ return _BinTipWeightModel.default.fromJSON(resultItem, siteId);
524
524
  }();
525
525
  });
526
526
  }();
@@ -547,7 +547,7 @@ var BinTipWeightController = /*#__PURE__*/function () {
547
547
  return new Promise(function (resolve, reject) {
548
548
  _RequestHelper.default.postRequest("/packhouse/sites/".concat(siteId, "/bin-tip-weights"), createData).then(function (result) {
549
549
  var resolveValue = function () {
550
- return _BinTipWeightModel.default.fromJSON(result);
550
+ return _BinTipWeightModel.default.fromJSON(result, siteId);
551
551
  }();
552
552
 
553
553
  resolve(resolveValue);
@@ -45,7 +45,7 @@ var CompacSizerBatchController = /*#__PURE__*/function () {
45
45
  return new Promise(function (resolve, reject) {
46
46
  _RequestHelper.default.getRequest("/packhouse/sites/".concat(siteId, "/compac-sizer-batches/").concat(id)).then(function (result) {
47
47
  var resolveValue = function () {
48
- return _CompacSizerBatchModel.default.fromJSON(result);
48
+ return _CompacSizerBatchModel.default.fromJSON(result, siteId);
49
49
  }();
50
50
 
51
51
  resolve(resolveValue);
@@ -71,7 +71,7 @@ var CompacSizerBatchController = /*#__PURE__*/function () {
71
71
  return new Promise(function (resolve, reject) {
72
72
  _RequestHelper.default.patchRequest("/packhouse/sites/".concat(siteId, "/compac-sizer-batches/").concat(id), updateData).then(function (result) {
73
73
  var resolveValue = function () {
74
- return _CompacSizerBatchModel.default.fromJSON(result);
74
+ return _CompacSizerBatchModel.default.fromJSON(result, siteId);
75
75
  }();
76
76
 
77
77
  resolve(resolveValue);
@@ -520,7 +520,7 @@ var CompacSizerBatchController = /*#__PURE__*/function () {
520
520
 
521
521
  return result.map(function (resultItem) {
522
522
  return function () {
523
- return _CompacSizerBatchModel.default.fromJSON(resultItem);
523
+ return _CompacSizerBatchModel.default.fromJSON(resultItem, siteId);
524
524
  }();
525
525
  });
526
526
  }();
@@ -547,7 +547,7 @@ var CompacSizerBatchController = /*#__PURE__*/function () {
547
547
  return new Promise(function (resolve, reject) {
548
548
  _RequestHelper.default.postRequest("/packhouse/sites/".concat(siteId, "/compac-sizer-batches"), createData).then(function (result) {
549
549
  var resolveValue = function () {
550
- return _CompacSizerBatchModel.default.fromJSON(result);
550
+ return _CompacSizerBatchModel.default.fromJSON(result, siteId);
551
551
  }();
552
552
 
553
553
  resolve(resolveValue);