@ricado/api-client 2.7.7 → 2.7.8
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/PackingLineController.js +14 -3
- package/lib/Controllers/Packhouse/Site/PackrunGrowerNotificationController.js +940 -0
- package/lib/Controllers/Packhouse/Site/index.js +3 -0
- package/lib/Models/Packhouse/Site/PackingLineModel.js +283 -2
- package/lib/Models/Packhouse/Site/PackrunGrowerNotificationModel.js +669 -0
- package/lib/Models/Packhouse/Site/index.js +3 -0
- package/lib/PackageVersion.js +1 -1
- package/lib/index.d.ts +620 -2
- package/package.json +1 -1
- package/src/Controllers/Packhouse/Site/PackingLineController.js +14 -3
- package/src/Controllers/Packhouse/Site/PackrunGrowerNotificationController.js +1071 -0
- package/src/Controllers/Packhouse/Site/index.js +2 -0
- package/src/Models/Packhouse/Site/PackingLineModel.js +380 -2
- package/src/Models/Packhouse/Site/PackrunGrowerNotificationModel.js +763 -0
- package/src/Models/Packhouse/Site/index.js +2 -0
- package/src/PackageVersion.js +1 -1
|
@@ -0,0 +1,669 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _BaseModel2 = _interopRequireDefault(require("../../../Models/BaseModel"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
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); }
|
|
13
|
+
|
|
14
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
15
|
+
|
|
16
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
17
|
+
|
|
18
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
19
|
+
|
|
20
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
21
|
+
|
|
22
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
23
|
+
|
|
24
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
25
|
+
|
|
26
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
27
|
+
|
|
28
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
29
|
+
|
|
30
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
31
|
+
|
|
32
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Model Class for a Packrun Grower Notification
|
|
36
|
+
*
|
|
37
|
+
* @class
|
|
38
|
+
* @hideconstructor
|
|
39
|
+
* @extends BaseModel
|
|
40
|
+
*/
|
|
41
|
+
var PackrunGrowerNotificationModel = /*#__PURE__*/function (_BaseModel) {
|
|
42
|
+
_inherits(PackrunGrowerNotificationModel, _BaseModel);
|
|
43
|
+
|
|
44
|
+
var _super = _createSuper(PackrunGrowerNotificationModel);
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* PackrunGrowerNotificationModel Constructor
|
|
48
|
+
*
|
|
49
|
+
* @protected
|
|
50
|
+
* @param {number} siteId The Site ID associated with this Packrun Grower Notification
|
|
51
|
+
*/
|
|
52
|
+
function PackrunGrowerNotificationModel(siteId) {
|
|
53
|
+
var _this;
|
|
54
|
+
|
|
55
|
+
_classCallCheck(this, PackrunGrowerNotificationModel);
|
|
56
|
+
|
|
57
|
+
_this = _super.call(this);
|
|
58
|
+
/**
|
|
59
|
+
* The Packrun Grower Notification ID
|
|
60
|
+
*
|
|
61
|
+
* @type {string}
|
|
62
|
+
* @public
|
|
63
|
+
*/
|
|
64
|
+
|
|
65
|
+
_this.id = "";
|
|
66
|
+
/**
|
|
67
|
+
* The Packing Line ID this Grower Notification is associated with
|
|
68
|
+
*
|
|
69
|
+
* @type {string}
|
|
70
|
+
* @public
|
|
71
|
+
*/
|
|
72
|
+
|
|
73
|
+
_this.packingLineId = "";
|
|
74
|
+
/**
|
|
75
|
+
* The Packrun ID this Grower Notification is associated with
|
|
76
|
+
*
|
|
77
|
+
* @type {string}
|
|
78
|
+
* @public
|
|
79
|
+
*/
|
|
80
|
+
|
|
81
|
+
_this.packrunId = "";
|
|
82
|
+
/**
|
|
83
|
+
* When this Grower Notification was Created
|
|
84
|
+
*
|
|
85
|
+
* @type {Date}
|
|
86
|
+
* @public
|
|
87
|
+
*/
|
|
88
|
+
|
|
89
|
+
_this.createdTimestamp = new Date();
|
|
90
|
+
/**
|
|
91
|
+
* The Grower Notification Type
|
|
92
|
+
*
|
|
93
|
+
* @type {string}
|
|
94
|
+
* @public
|
|
95
|
+
*/
|
|
96
|
+
|
|
97
|
+
_this.notificationType = "";
|
|
98
|
+
/**
|
|
99
|
+
* The SMS Request Statuses indicating progress when sending SMS Messages
|
|
100
|
+
*
|
|
101
|
+
* @type {Array<{mobileNumber: string, messageId: ?string, messageStatus: ?string, sendRequestCount: number, sendRequestTimestamp: ?Date, sendResponseCode: ?number, sendResponseMessage: ?string, getStatusRequestCount: number, getStatusRequestTimestamp: ?Date, getStatusResponseCode: ?number, getStatusResponseMessage: ?string, completed: boolean}>}
|
|
102
|
+
* @public
|
|
103
|
+
*/
|
|
104
|
+
|
|
105
|
+
_this.smsRequests = [];
|
|
106
|
+
/**
|
|
107
|
+
* The Email Request Status indicating progress when sending Emails
|
|
108
|
+
*
|
|
109
|
+
* @type {?{requestCount: number, requestTimestamp: ?Date, responseCode: ?number, responseMessage: ?string, completed: boolean}}
|
|
110
|
+
* @public
|
|
111
|
+
*/
|
|
112
|
+
|
|
113
|
+
_this.emailRequest = null;
|
|
114
|
+
/**
|
|
115
|
+
* Whether the Grower Notification is in the process of being Sent
|
|
116
|
+
*
|
|
117
|
+
* @type {string}
|
|
118
|
+
* @public
|
|
119
|
+
*/
|
|
120
|
+
|
|
121
|
+
_this.status = "";
|
|
122
|
+
/**
|
|
123
|
+
* An Array of SMS Contacts for this Grower Notification
|
|
124
|
+
*
|
|
125
|
+
* @type {Array<{mobileNumber: string, firstName: string, lastName: ?string}>}
|
|
126
|
+
* @public
|
|
127
|
+
*/
|
|
128
|
+
|
|
129
|
+
_this.smsContacts = [];
|
|
130
|
+
/**
|
|
131
|
+
* An Array of Email Contacts for this Grower Notification
|
|
132
|
+
*
|
|
133
|
+
* @type {Array<{email: string, firstName: string, lastName: ?string}>}
|
|
134
|
+
* @public
|
|
135
|
+
*/
|
|
136
|
+
|
|
137
|
+
_this.emailContacts = [];
|
|
138
|
+
/**
|
|
139
|
+
* Whether the Packrun Grower Notification has been deleted
|
|
140
|
+
*
|
|
141
|
+
* @type {boolean}
|
|
142
|
+
* @public
|
|
143
|
+
*/
|
|
144
|
+
|
|
145
|
+
_this.deleted = false;
|
|
146
|
+
/**
|
|
147
|
+
* When the Packrun Grower Notification was last updated
|
|
148
|
+
*
|
|
149
|
+
* @type {Date}
|
|
150
|
+
* @public
|
|
151
|
+
*/
|
|
152
|
+
|
|
153
|
+
_this.updateTimestamp = new Date();
|
|
154
|
+
/**
|
|
155
|
+
* The Site ID associated with this Packrun Grower Notification
|
|
156
|
+
*
|
|
157
|
+
* @type {number}
|
|
158
|
+
* @public
|
|
159
|
+
*/
|
|
160
|
+
|
|
161
|
+
_this.siteId = siteId;
|
|
162
|
+
return _this;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Create a new **PackrunGrowerNotificationModel** from a JSON Object or JSON String
|
|
166
|
+
*
|
|
167
|
+
* @static
|
|
168
|
+
* @public
|
|
169
|
+
* @param {Object<string, any>|string} json A JSON Object or JSON String
|
|
170
|
+
* @param {number} siteId The Site ID associated with this Packrun Grower Notification
|
|
171
|
+
* @return {PackrunGrowerNotificationModel}
|
|
172
|
+
*/
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
_createClass(PackrunGrowerNotificationModel, null, [{
|
|
176
|
+
key: "fromJSON",
|
|
177
|
+
value: function fromJSON(json, siteId) {
|
|
178
|
+
var model = new PackrunGrowerNotificationModel(siteId);
|
|
179
|
+
/**
|
|
180
|
+
* The JSON Object
|
|
181
|
+
*
|
|
182
|
+
* @type {Object<string, any>}
|
|
183
|
+
*/
|
|
184
|
+
|
|
185
|
+
var jsonObject = {};
|
|
186
|
+
|
|
187
|
+
if (typeof json === 'string') {
|
|
188
|
+
jsonObject = JSON.parse(json);
|
|
189
|
+
} else if (_typeof(json) === 'object') {
|
|
190
|
+
jsonObject = json;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
if ('id' in jsonObject) {
|
|
194
|
+
model.id = function () {
|
|
195
|
+
if (typeof jsonObject['id'] !== 'string') {
|
|
196
|
+
return String(jsonObject['id']);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
return jsonObject['id'];
|
|
200
|
+
}();
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
if ('packingLineId' in jsonObject) {
|
|
204
|
+
model.packingLineId = function () {
|
|
205
|
+
if (typeof jsonObject['packingLineId'] !== 'string') {
|
|
206
|
+
return String(jsonObject['packingLineId']);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
return jsonObject['packingLineId'];
|
|
210
|
+
}();
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
if ('packrunId' in jsonObject) {
|
|
214
|
+
model.packrunId = function () {
|
|
215
|
+
if (typeof jsonObject['packrunId'] !== 'string') {
|
|
216
|
+
return String(jsonObject['packrunId']);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
return jsonObject['packrunId'];
|
|
220
|
+
}();
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
if ('createdTimestamp' in jsonObject) {
|
|
224
|
+
model.createdTimestamp = function () {
|
|
225
|
+
if (typeof jsonObject['createdTimestamp'] !== 'string') {
|
|
226
|
+
return new Date(String(jsonObject['createdTimestamp']));
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
return new Date(jsonObject['createdTimestamp']);
|
|
230
|
+
}();
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
if ('notificationType' in jsonObject) {
|
|
234
|
+
model.notificationType = function () {
|
|
235
|
+
if (typeof jsonObject['notificationType'] !== 'string') {
|
|
236
|
+
return String(jsonObject['notificationType']);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
return jsonObject['notificationType'];
|
|
240
|
+
}();
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
if ('smsRequests' in jsonObject) {
|
|
244
|
+
model.smsRequests = function () {
|
|
245
|
+
if (Array.isArray(jsonObject['smsRequests']) !== true) {
|
|
246
|
+
return [];
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
return jsonObject['smsRequests'].map(function (smsRequestsItem) {
|
|
250
|
+
return function () {
|
|
251
|
+
var smsRequestsItemObject = {};
|
|
252
|
+
|
|
253
|
+
if (_typeof(smsRequestsItem) === 'object' && 'mobileNumber' in smsRequestsItem) {
|
|
254
|
+
smsRequestsItemObject.mobileNumber = function () {
|
|
255
|
+
if (typeof smsRequestsItem.mobileNumber !== 'string') {
|
|
256
|
+
return String(smsRequestsItem.mobileNumber);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
return smsRequestsItem.mobileNumber;
|
|
260
|
+
}();
|
|
261
|
+
} else {
|
|
262
|
+
smsRequestsItemObject.mobileNumber = "";
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
if (_typeof(smsRequestsItem) === 'object' && 'messageId' in smsRequestsItem) {
|
|
266
|
+
smsRequestsItemObject.messageId = function () {
|
|
267
|
+
if (smsRequestsItem.messageId === null) {
|
|
268
|
+
return null;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
if (typeof smsRequestsItem.messageId !== 'string') {
|
|
272
|
+
return String(smsRequestsItem.messageId);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
return smsRequestsItem.messageId;
|
|
276
|
+
}();
|
|
277
|
+
} else {
|
|
278
|
+
smsRequestsItemObject.messageId = null;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
if (_typeof(smsRequestsItem) === 'object' && 'messageStatus' in smsRequestsItem) {
|
|
282
|
+
smsRequestsItemObject.messageStatus = function () {
|
|
283
|
+
if (smsRequestsItem.messageStatus === null) {
|
|
284
|
+
return null;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
if (typeof smsRequestsItem.messageStatus !== 'string') {
|
|
288
|
+
return String(smsRequestsItem.messageStatus);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
return smsRequestsItem.messageStatus;
|
|
292
|
+
}();
|
|
293
|
+
} else {
|
|
294
|
+
smsRequestsItemObject.messageStatus = null;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
if (_typeof(smsRequestsItem) === 'object' && 'sendRequestCount' in smsRequestsItem) {
|
|
298
|
+
smsRequestsItemObject.sendRequestCount = function () {
|
|
299
|
+
if (typeof smsRequestsItem.sendRequestCount !== 'number') {
|
|
300
|
+
return Number.isInteger(Number(smsRequestsItem.sendRequestCount)) ? Number(smsRequestsItem.sendRequestCount) : Math.floor(Number(smsRequestsItem.sendRequestCount));
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
return Number.isInteger(smsRequestsItem.sendRequestCount) ? smsRequestsItem.sendRequestCount : Math.floor(smsRequestsItem.sendRequestCount);
|
|
304
|
+
}();
|
|
305
|
+
} else {
|
|
306
|
+
smsRequestsItemObject.sendRequestCount = 0;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
if (_typeof(smsRequestsItem) === 'object' && 'sendRequestTimestamp' in smsRequestsItem) {
|
|
310
|
+
smsRequestsItemObject.sendRequestTimestamp = function () {
|
|
311
|
+
if (smsRequestsItem.sendRequestTimestamp === null) {
|
|
312
|
+
return null;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
if (typeof smsRequestsItem.sendRequestTimestamp !== 'string') {
|
|
316
|
+
return new Date(String(smsRequestsItem.sendRequestTimestamp));
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
return new Date(smsRequestsItem.sendRequestTimestamp);
|
|
320
|
+
}();
|
|
321
|
+
} else {
|
|
322
|
+
smsRequestsItemObject.sendRequestTimestamp = null;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
if (_typeof(smsRequestsItem) === 'object' && 'sendResponseCode' in smsRequestsItem) {
|
|
326
|
+
smsRequestsItemObject.sendResponseCode = function () {
|
|
327
|
+
if (smsRequestsItem.sendResponseCode === null) {
|
|
328
|
+
return null;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
if (typeof smsRequestsItem.sendResponseCode !== 'number') {
|
|
332
|
+
return Number.isInteger(Number(smsRequestsItem.sendResponseCode)) ? Number(smsRequestsItem.sendResponseCode) : Math.floor(Number(smsRequestsItem.sendResponseCode));
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
return Number.isInteger(smsRequestsItem.sendResponseCode) ? smsRequestsItem.sendResponseCode : Math.floor(smsRequestsItem.sendResponseCode);
|
|
336
|
+
}();
|
|
337
|
+
} else {
|
|
338
|
+
smsRequestsItemObject.sendResponseCode = null;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
if (_typeof(smsRequestsItem) === 'object' && 'sendResponseMessage' in smsRequestsItem) {
|
|
342
|
+
smsRequestsItemObject.sendResponseMessage = function () {
|
|
343
|
+
if (smsRequestsItem.sendResponseMessage === null) {
|
|
344
|
+
return null;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
if (typeof smsRequestsItem.sendResponseMessage !== 'string') {
|
|
348
|
+
return String(smsRequestsItem.sendResponseMessage);
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
return smsRequestsItem.sendResponseMessage;
|
|
352
|
+
}();
|
|
353
|
+
} else {
|
|
354
|
+
smsRequestsItemObject.sendResponseMessage = null;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
if (_typeof(smsRequestsItem) === 'object' && 'getStatusRequestCount' in smsRequestsItem) {
|
|
358
|
+
smsRequestsItemObject.getStatusRequestCount = function () {
|
|
359
|
+
if (typeof smsRequestsItem.getStatusRequestCount !== 'number') {
|
|
360
|
+
return Number.isInteger(Number(smsRequestsItem.getStatusRequestCount)) ? Number(smsRequestsItem.getStatusRequestCount) : Math.floor(Number(smsRequestsItem.getStatusRequestCount));
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
return Number.isInteger(smsRequestsItem.getStatusRequestCount) ? smsRequestsItem.getStatusRequestCount : Math.floor(smsRequestsItem.getStatusRequestCount);
|
|
364
|
+
}();
|
|
365
|
+
} else {
|
|
366
|
+
smsRequestsItemObject.getStatusRequestCount = 0;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
if (_typeof(smsRequestsItem) === 'object' && 'getStatusRequestTimestamp' in smsRequestsItem) {
|
|
370
|
+
smsRequestsItemObject.getStatusRequestTimestamp = function () {
|
|
371
|
+
if (smsRequestsItem.getStatusRequestTimestamp === null) {
|
|
372
|
+
return null;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
if (typeof smsRequestsItem.getStatusRequestTimestamp !== 'string') {
|
|
376
|
+
return new Date(String(smsRequestsItem.getStatusRequestTimestamp));
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
return new Date(smsRequestsItem.getStatusRequestTimestamp);
|
|
380
|
+
}();
|
|
381
|
+
} else {
|
|
382
|
+
smsRequestsItemObject.getStatusRequestTimestamp = null;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
if (_typeof(smsRequestsItem) === 'object' && 'getStatusResponseCode' in smsRequestsItem) {
|
|
386
|
+
smsRequestsItemObject.getStatusResponseCode = function () {
|
|
387
|
+
if (smsRequestsItem.getStatusResponseCode === null) {
|
|
388
|
+
return null;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
if (typeof smsRequestsItem.getStatusResponseCode !== 'number') {
|
|
392
|
+
return Number.isInteger(Number(smsRequestsItem.getStatusResponseCode)) ? Number(smsRequestsItem.getStatusResponseCode) : Math.floor(Number(smsRequestsItem.getStatusResponseCode));
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
return Number.isInteger(smsRequestsItem.getStatusResponseCode) ? smsRequestsItem.getStatusResponseCode : Math.floor(smsRequestsItem.getStatusResponseCode);
|
|
396
|
+
}();
|
|
397
|
+
} else {
|
|
398
|
+
smsRequestsItemObject.getStatusResponseCode = null;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
if (_typeof(smsRequestsItem) === 'object' && 'getStatusResponseMessage' in smsRequestsItem) {
|
|
402
|
+
smsRequestsItemObject.getStatusResponseMessage = function () {
|
|
403
|
+
if (smsRequestsItem.getStatusResponseMessage === null) {
|
|
404
|
+
return null;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
if (typeof smsRequestsItem.getStatusResponseMessage !== 'string') {
|
|
408
|
+
return String(smsRequestsItem.getStatusResponseMessage);
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
return smsRequestsItem.getStatusResponseMessage;
|
|
412
|
+
}();
|
|
413
|
+
} else {
|
|
414
|
+
smsRequestsItemObject.getStatusResponseMessage = null;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
if (_typeof(smsRequestsItem) === 'object' && 'completed' in smsRequestsItem) {
|
|
418
|
+
smsRequestsItemObject.completed = function () {
|
|
419
|
+
if (typeof smsRequestsItem.completed !== 'boolean') {
|
|
420
|
+
return Boolean(smsRequestsItem.completed);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
return smsRequestsItem.completed;
|
|
424
|
+
}();
|
|
425
|
+
} else {
|
|
426
|
+
smsRequestsItemObject.completed = false;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
return smsRequestsItemObject;
|
|
430
|
+
}();
|
|
431
|
+
});
|
|
432
|
+
}();
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
if ('emailRequest' in jsonObject) {
|
|
436
|
+
model.emailRequest = function () {
|
|
437
|
+
if (jsonObject['emailRequest'] === null) {
|
|
438
|
+
return null;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
var emailRequestObject = {};
|
|
442
|
+
|
|
443
|
+
if (_typeof(jsonObject['emailRequest']) === 'object' && 'requestCount' in jsonObject['emailRequest']) {
|
|
444
|
+
emailRequestObject.requestCount = function () {
|
|
445
|
+
if (typeof jsonObject['emailRequest'].requestCount !== 'number') {
|
|
446
|
+
return Number.isInteger(Number(jsonObject['emailRequest'].requestCount)) ? Number(jsonObject['emailRequest'].requestCount) : Math.floor(Number(jsonObject['emailRequest'].requestCount));
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
return Number.isInteger(jsonObject['emailRequest'].requestCount) ? jsonObject['emailRequest'].requestCount : Math.floor(jsonObject['emailRequest'].requestCount);
|
|
450
|
+
}();
|
|
451
|
+
} else {
|
|
452
|
+
emailRequestObject.requestCount = 0;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
if (_typeof(jsonObject['emailRequest']) === 'object' && 'requestTimestamp' in jsonObject['emailRequest']) {
|
|
456
|
+
emailRequestObject.requestTimestamp = function () {
|
|
457
|
+
if (jsonObject['emailRequest'].requestTimestamp === null) {
|
|
458
|
+
return null;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
if (typeof jsonObject['emailRequest'].requestTimestamp !== 'string') {
|
|
462
|
+
return new Date(String(jsonObject['emailRequest'].requestTimestamp));
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
return new Date(jsonObject['emailRequest'].requestTimestamp);
|
|
466
|
+
}();
|
|
467
|
+
} else {
|
|
468
|
+
emailRequestObject.requestTimestamp = null;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
if (_typeof(jsonObject['emailRequest']) === 'object' && 'responseCode' in jsonObject['emailRequest']) {
|
|
472
|
+
emailRequestObject.responseCode = function () {
|
|
473
|
+
if (jsonObject['emailRequest'].responseCode === null) {
|
|
474
|
+
return null;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
if (typeof jsonObject['emailRequest'].responseCode !== 'number') {
|
|
478
|
+
return Number.isInteger(Number(jsonObject['emailRequest'].responseCode)) ? Number(jsonObject['emailRequest'].responseCode) : Math.floor(Number(jsonObject['emailRequest'].responseCode));
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
return Number.isInteger(jsonObject['emailRequest'].responseCode) ? jsonObject['emailRequest'].responseCode : Math.floor(jsonObject['emailRequest'].responseCode);
|
|
482
|
+
}();
|
|
483
|
+
} else {
|
|
484
|
+
emailRequestObject.responseCode = null;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
if (_typeof(jsonObject['emailRequest']) === 'object' && 'responseMessage' in jsonObject['emailRequest']) {
|
|
488
|
+
emailRequestObject.responseMessage = function () {
|
|
489
|
+
if (jsonObject['emailRequest'].responseMessage === null) {
|
|
490
|
+
return null;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
if (typeof jsonObject['emailRequest'].responseMessage !== 'string') {
|
|
494
|
+
return String(jsonObject['emailRequest'].responseMessage);
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
return jsonObject['emailRequest'].responseMessage;
|
|
498
|
+
}();
|
|
499
|
+
} else {
|
|
500
|
+
emailRequestObject.responseMessage = null;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
if (_typeof(jsonObject['emailRequest']) === 'object' && 'completed' in jsonObject['emailRequest']) {
|
|
504
|
+
emailRequestObject.completed = function () {
|
|
505
|
+
if (typeof jsonObject['emailRequest'].completed !== 'boolean') {
|
|
506
|
+
return Boolean(jsonObject['emailRequest'].completed);
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
return jsonObject['emailRequest'].completed;
|
|
510
|
+
}();
|
|
511
|
+
} else {
|
|
512
|
+
emailRequestObject.completed = false;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
return emailRequestObject;
|
|
516
|
+
}();
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
if ('status' in jsonObject) {
|
|
520
|
+
model.status = function () {
|
|
521
|
+
if (typeof jsonObject['status'] !== 'string') {
|
|
522
|
+
return String(jsonObject['status']);
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
return jsonObject['status'];
|
|
526
|
+
}();
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
if ('smsContacts' in jsonObject) {
|
|
530
|
+
model.smsContacts = function () {
|
|
531
|
+
if (Array.isArray(jsonObject['smsContacts']) !== true) {
|
|
532
|
+
return [];
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
return jsonObject['smsContacts'].map(function (smsContactsItem) {
|
|
536
|
+
return function () {
|
|
537
|
+
var smsContactsItemObject = {};
|
|
538
|
+
|
|
539
|
+
if (_typeof(smsContactsItem) === 'object' && 'mobileNumber' in smsContactsItem) {
|
|
540
|
+
smsContactsItemObject.mobileNumber = function () {
|
|
541
|
+
if (typeof smsContactsItem.mobileNumber !== 'string') {
|
|
542
|
+
return String(smsContactsItem.mobileNumber);
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
return smsContactsItem.mobileNumber;
|
|
546
|
+
}();
|
|
547
|
+
} else {
|
|
548
|
+
smsContactsItemObject.mobileNumber = "";
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
if (_typeof(smsContactsItem) === 'object' && 'firstName' in smsContactsItem) {
|
|
552
|
+
smsContactsItemObject.firstName = function () {
|
|
553
|
+
if (typeof smsContactsItem.firstName !== 'string') {
|
|
554
|
+
return String(smsContactsItem.firstName);
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
return smsContactsItem.firstName;
|
|
558
|
+
}();
|
|
559
|
+
} else {
|
|
560
|
+
smsContactsItemObject.firstName = "";
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
if (_typeof(smsContactsItem) === 'object' && 'lastName' in smsContactsItem) {
|
|
564
|
+
smsContactsItemObject.lastName = function () {
|
|
565
|
+
if (smsContactsItem.lastName === null) {
|
|
566
|
+
return null;
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
if (typeof smsContactsItem.lastName !== 'string') {
|
|
570
|
+
return String(smsContactsItem.lastName);
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
return smsContactsItem.lastName;
|
|
574
|
+
}();
|
|
575
|
+
} else {
|
|
576
|
+
smsContactsItemObject.lastName = null;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
return smsContactsItemObject;
|
|
580
|
+
}();
|
|
581
|
+
});
|
|
582
|
+
}();
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
if ('emailContacts' in jsonObject) {
|
|
586
|
+
model.emailContacts = function () {
|
|
587
|
+
if (Array.isArray(jsonObject['emailContacts']) !== true) {
|
|
588
|
+
return [];
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
return jsonObject['emailContacts'].map(function (emailContactsItem) {
|
|
592
|
+
return function () {
|
|
593
|
+
var emailContactsItemObject = {};
|
|
594
|
+
|
|
595
|
+
if (_typeof(emailContactsItem) === 'object' && 'email' in emailContactsItem) {
|
|
596
|
+
emailContactsItemObject.email = function () {
|
|
597
|
+
if (typeof emailContactsItem.email !== 'string') {
|
|
598
|
+
return String(emailContactsItem.email);
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
return emailContactsItem.email;
|
|
602
|
+
}();
|
|
603
|
+
} else {
|
|
604
|
+
emailContactsItemObject.email = "";
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
if (_typeof(emailContactsItem) === 'object' && 'firstName' in emailContactsItem) {
|
|
608
|
+
emailContactsItemObject.firstName = function () {
|
|
609
|
+
if (typeof emailContactsItem.firstName !== 'string') {
|
|
610
|
+
return String(emailContactsItem.firstName);
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
return emailContactsItem.firstName;
|
|
614
|
+
}();
|
|
615
|
+
} else {
|
|
616
|
+
emailContactsItemObject.firstName = "";
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
if (_typeof(emailContactsItem) === 'object' && 'lastName' in emailContactsItem) {
|
|
620
|
+
emailContactsItemObject.lastName = function () {
|
|
621
|
+
if (emailContactsItem.lastName === null) {
|
|
622
|
+
return null;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
if (typeof emailContactsItem.lastName !== 'string') {
|
|
626
|
+
return String(emailContactsItem.lastName);
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
return emailContactsItem.lastName;
|
|
630
|
+
}();
|
|
631
|
+
} else {
|
|
632
|
+
emailContactsItemObject.lastName = null;
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
return emailContactsItemObject;
|
|
636
|
+
}();
|
|
637
|
+
});
|
|
638
|
+
}();
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
if ('deleted' in jsonObject) {
|
|
642
|
+
model.deleted = function () {
|
|
643
|
+
if (typeof jsonObject['deleted'] !== 'boolean') {
|
|
644
|
+
return Boolean(jsonObject['deleted']);
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
return jsonObject['deleted'];
|
|
648
|
+
}();
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
if ('updateTimestamp' in jsonObject) {
|
|
652
|
+
model.updateTimestamp = function () {
|
|
653
|
+
if (typeof jsonObject['updateTimestamp'] !== 'string') {
|
|
654
|
+
return new Date(String(jsonObject['updateTimestamp']));
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
return new Date(jsonObject['updateTimestamp']);
|
|
658
|
+
}();
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
return model;
|
|
662
|
+
}
|
|
663
|
+
}]);
|
|
664
|
+
|
|
665
|
+
return PackrunGrowerNotificationModel;
|
|
666
|
+
}(_BaseModel2.default);
|
|
667
|
+
|
|
668
|
+
var _default = PackrunGrowerNotificationModel;
|
|
669
|
+
exports.default = _default;
|
|
@@ -53,6 +53,8 @@ var _PackTypeModel = _interopRequireDefault(require("./PackTypeModel"));
|
|
|
53
53
|
|
|
54
54
|
var _PackingLineModel = _interopRequireDefault(require("./PackingLineModel"));
|
|
55
55
|
|
|
56
|
+
var _PackrunGrowerNotificationModel = _interopRequireDefault(require("./PackrunGrowerNotificationModel"));
|
|
57
|
+
|
|
56
58
|
var _PackrunModel = _interopRequireDefault(require("./PackrunModel"));
|
|
57
59
|
|
|
58
60
|
var _PrePackSampleModel = _interopRequireDefault(require("./PrePackSampleModel"));
|
|
@@ -127,6 +129,7 @@ var Site = {
|
|
|
127
129
|
MAFSizerPackrunSummaryModel: _MAFSizerPackrunSummaryModel.default,
|
|
128
130
|
PackTypeModel: _PackTypeModel.default,
|
|
129
131
|
PackingLineModel: _PackingLineModel.default,
|
|
132
|
+
PackrunGrowerNotificationModel: _PackrunGrowerNotificationModel.default,
|
|
130
133
|
PackrunModel: _PackrunModel.default,
|
|
131
134
|
PrePackSampleModel: _PrePackSampleModel.default,
|
|
132
135
|
ReemoonSizerBatchModel: _ReemoonSizerBatchModel.default,
|
package/lib/PackageVersion.js
CHANGED