@ricado/api-client 1.4.1 → 2.1.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/AccountPolicyController.js +1 -1
- package/lib/Controllers/ApiAccountController.js +2 -2
- package/lib/Controllers/CompanyController.js +1 -1
- package/lib/Controllers/FirebaseTokenController.js +1 -1
- package/lib/Controllers/Packhouse/Site/BinTipWeightController.js +2 -2
- package/lib/Controllers/Packhouse/Site/CompacSizerBatchController.js +2 -2
- package/lib/Controllers/Packhouse/Site/CompacSizerController.js +1 -1
- package/lib/Controllers/Packhouse/Site/CompacSizerOutletProductChangeController.js +2 -2
- package/lib/Controllers/Packhouse/Site/CompacSizerOutletTypeChangeController.js +2 -2
- package/lib/Controllers/Packhouse/Site/CompacSizerOutletTypeController.js +1 -1
- package/lib/Controllers/Packhouse/Site/CompacSizerPackrunSummaryController.js +2 -2
- package/lib/Controllers/Packhouse/Site/DowntimeEventController.js +2 -2
- package/lib/Controllers/Packhouse/Site/FreshPackPackrunSummaryController.js +2 -2
- package/lib/Controllers/Packhouse/Site/GrowingMethodController.js +1 -1
- package/lib/Controllers/Packhouse/Site/PackTypeController.js +1 -1
- package/lib/Controllers/Packhouse/Site/PackingLineController.js +1 -1
- package/lib/Controllers/Packhouse/Site/PackrunController.js +288 -2
- package/lib/Controllers/Packhouse/Site/RejectBinController.js +2 -2
- package/lib/Controllers/Packhouse/Site/RejectBinScaleController.js +1 -1
- package/lib/Controllers/Packhouse/Site/RejectBinWeightController.js +2 -2
- package/lib/Controllers/Packhouse/Site/ShiftController.js +2 -2
- package/lib/Controllers/Packhouse/Site/ShiftFocusMeetingController.js +2 -2
- package/lib/Controllers/Packhouse/Site/ShiftHourlyEntryController.js +2 -2
- package/lib/Controllers/Packhouse/Site/VarietyController.js +1 -1
- package/lib/Controllers/RTU/GlobalSettingsController.js +2 -2
- package/lib/Controllers/RTU/PluginSettingsController.js +2 -2
- package/lib/Controllers/RTUController.js +1 -1
- package/lib/Controllers/RTUPluginController.js +1 -1
- package/lib/Controllers/Site/AlarmController.js +2 -2
- package/lib/Controllers/Site/AlarmGroupController.js +1 -1
- package/lib/Controllers/Site/DefinitionController.js +1 -1
- package/lib/Controllers/Site/PermanentObjectController.js +1 -1
- package/lib/Controllers/Site/PermanentObjectDataController.js +2 -2
- package/lib/Controllers/Site/PointController.js +2 -2
- package/lib/Controllers/Site/TemporaryObjectController.js +1 -1
- package/lib/Controllers/SiteController.js +1 -1
- package/lib/Controllers/TokenController.js +2 -2
- package/lib/Controllers/ToolsController.js +1 -1
- package/lib/Controllers/UserAccountActionTokenController.js +2 -2
- package/lib/Controllers/UserAccountController.js +2 -2
- package/lib/DataItems/PointValueItem.js +2 -2
- package/lib/Errors/BadRequestError.js +7 -3
- package/lib/Errors/ForbiddenError.js +7 -3
- package/lib/Errors/NetworkError.js +7 -3
- package/lib/Errors/NotAllowedError.js +7 -3
- package/lib/Errors/NotFoundError.js +7 -3
- package/lib/Errors/ServerError.js +7 -3
- package/lib/Errors/UnauthorizedError.js +7 -3
- package/lib/Models/AccountPolicyModel.js +29 -133
- package/lib/Models/ApiAccountModel.js +29 -133
- package/lib/Models/BaseModel.js +6 -2
- package/lib/Models/CompanyModel.js +23 -101
- package/lib/Models/FirebaseTokenModel.js +32 -149
- package/lib/Models/Packhouse/Site/BinTipWeightModel.js +43 -185
- package/lib/Models/Packhouse/Site/CompacSizerBatchModel.js +40 -169
- package/lib/Models/Packhouse/Site/CompacSizerModel.js +58 -265
- package/lib/Models/Packhouse/Site/CompacSizerOutletProductChangeModel.js +46 -201
- package/lib/Models/Packhouse/Site/CompacSizerOutletTypeChangeModel.js +40 -169
- package/lib/Models/Packhouse/Site/CompacSizerOutletTypeModel.js +34 -137
- package/lib/Models/Packhouse/Site/CompacSizerPackrunSummaryModel.js +52 -233
- package/lib/Models/Packhouse/Site/DowntimeEventModel.js +58 -265
- package/lib/Models/Packhouse/Site/FreshPackPackrunSummaryModel.js +40 -169
- package/lib/Models/Packhouse/Site/GrowingMethodModel.js +34 -137
- package/lib/Models/Packhouse/Site/PackTypeModel.js +40 -169
- package/lib/Models/Packhouse/Site/PackingLineModel.js +61 -281
- package/lib/Models/Packhouse/Site/PackrunModel.js +61 -281
- package/lib/Models/Packhouse/Site/RejectBinModel.js +43 -185
- package/lib/Models/Packhouse/Site/RejectBinScaleModel.js +52 -233
- package/lib/Models/Packhouse/Site/RejectBinWeightModel.js +46 -201
- package/lib/Models/Packhouse/Site/ShiftFocusMeetingModel.js +52 -233
- package/lib/Models/Packhouse/Site/ShiftHourlyEntryModel.js +127 -633
- package/lib/Models/Packhouse/Site/ShiftModel.js +73 -345
- package/lib/Models/Packhouse/Site/VarietyModel.js +40 -169
- package/lib/Models/RTUModel.js +26 -117
- package/lib/Models/RTUPluginModel.js +23 -101
- package/lib/Models/Site/AlarmGroupModel.js +37 -153
- package/lib/Models/Site/AlarmModel.js +67 -313
- package/lib/Models/Site/DefinitionModel.js +34 -137
- package/lib/Models/Site/PermanentObjectDataModel.js +40 -169
- package/lib/Models/Site/PermanentObjectModel.js +37 -153
- package/lib/Models/Site/PointModel.js +49 -217
- package/lib/Models/Site/TemporaryObjectModel.js +34 -137
- package/lib/Models/Site/index.js +0 -3
- package/lib/Models/SiteModel.js +26 -117
- package/lib/Models/TokenModel.js +38 -181
- package/lib/Models/UserAccountActionTokenModel.js +41 -197
- package/lib/Models/UserAccountModel.js +38 -181
- package/lib/PackageVersion.js +1 -1
- package/lib/Points.js +1 -1
- package/lib/RequestHelper.js +2 -2
- package/lib/WebSocketHelper.js +1 -1
- package/lib/index.d.ts +945 -1206
- package/package.json +3 -3
- package/src/Controllers/Packhouse/Site/PackrunController.js +361 -0
- package/src/Models/AccountPolicyModel.js +21 -117
- package/src/Models/ApiAccountModel.js +21 -117
- package/src/Models/CompanyModel.js +15 -87
- package/src/Models/FirebaseTokenModel.js +24 -132
- package/src/Models/Packhouse/Site/BinTipWeightModel.js +32 -163
- package/src/Models/Packhouse/Site/CompacSizerBatchModel.js +29 -148
- package/src/Models/Packhouse/Site/CompacSizerModel.js +47 -238
- package/src/Models/Packhouse/Site/CompacSizerOutletProductChangeModel.js +35 -178
- package/src/Models/Packhouse/Site/CompacSizerOutletTypeChangeModel.js +29 -148
- package/src/Models/Packhouse/Site/CompacSizerOutletTypeModel.js +23 -118
- package/src/Models/Packhouse/Site/CompacSizerPackrunSummaryModel.js +41 -208
- package/src/Models/Packhouse/Site/DowntimeEventModel.js +47 -238
- package/src/Models/Packhouse/Site/FreshPackPackrunSummaryModel.js +29 -148
- package/src/Models/Packhouse/Site/GrowingMethodModel.js +23 -118
- package/src/Models/Packhouse/Site/PackTypeModel.js +29 -148
- package/src/Models/Packhouse/Site/PackingLineModel.js +50 -253
- package/src/Models/Packhouse/Site/PackrunModel.js +50 -253
- package/src/Models/Packhouse/Site/RejectBinModel.js +32 -163
- package/src/Models/Packhouse/Site/RejectBinScaleModel.js +41 -208
- package/src/Models/Packhouse/Site/RejectBinWeightModel.js +35 -178
- package/src/Models/Packhouse/Site/ShiftFocusMeetingModel.js +41 -208
- package/src/Models/Packhouse/Site/ShiftHourlyEntryModel.js +116 -583
- package/src/Models/Packhouse/Site/ShiftModel.js +62 -313
- package/src/Models/Packhouse/Site/VarietyModel.js +29 -148
- package/src/Models/RTUModel.js +18 -102
- package/src/Models/RTUPluginModel.js +15 -87
- package/src/Models/Site/AlarmGroupModel.js +26 -133
- package/src/Models/Site/AlarmModel.js +56 -283
- package/src/Models/Site/DefinitionModel.js +23 -118
- package/src/Models/Site/PermanentObjectDataModel.js +29 -148
- package/src/Models/Site/PermanentObjectModel.js +26 -133
- package/src/Models/Site/PointModel.js +38 -193
- package/src/Models/Site/TemporaryObjectModel.js +23 -118
- package/src/Models/Site/index.js +0 -2
- package/src/Models/SiteModel.js +18 -102
- package/src/Models/TokenModel.js +30 -162
- package/src/Models/UserAccountActionTokenModel.js +33 -177
- package/src/Models/UserAccountModel.js +30 -162
- package/src/PackageVersion.js +1 -1
- package/lib/Models/Site/BaseSiteModel.js +0 -58
- package/src/Models/Site/BaseSiteModel.js +0 -30
|
@@ -4,16 +4,16 @@
|
|
|
4
4
|
* Do Not Edit this File Manually!
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import
|
|
7
|
+
import BaseModel from '../../Models/BaseModel';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Model Class for a Temporary Object
|
|
11
11
|
*
|
|
12
12
|
* @class
|
|
13
13
|
* @hideconstructor
|
|
14
|
-
* @extends
|
|
14
|
+
* @extends BaseModel
|
|
15
15
|
*/
|
|
16
|
-
class TemporaryObjectModel extends
|
|
16
|
+
class TemporaryObjectModel extends BaseModel
|
|
17
17
|
{
|
|
18
18
|
/**
|
|
19
19
|
* TemporaryObjectModel Constructor
|
|
@@ -29,152 +29,57 @@ class TemporaryObjectModel extends BaseSiteModel
|
|
|
29
29
|
* The Temporary Object ID
|
|
30
30
|
*
|
|
31
31
|
* @type {string}
|
|
32
|
-
* @
|
|
32
|
+
* @public
|
|
33
33
|
*/
|
|
34
|
-
this.
|
|
34
|
+
this.id = undefined;
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* The Temporary Object Key Index
|
|
38
38
|
*
|
|
39
39
|
* @type {string}
|
|
40
|
-
* @
|
|
40
|
+
* @public
|
|
41
41
|
*/
|
|
42
|
-
this.
|
|
42
|
+
this.keyIndex = undefined;
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
* The Temporary Object Type
|
|
46
46
|
*
|
|
47
47
|
* @type {string}
|
|
48
|
-
* @
|
|
48
|
+
* @public
|
|
49
49
|
*/
|
|
50
|
-
this.
|
|
50
|
+
this.type = undefined;
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
53
|
* The Temporary Object Definition
|
|
54
54
|
*
|
|
55
55
|
* @type {Object}
|
|
56
|
-
* @
|
|
56
|
+
* @public
|
|
57
57
|
*/
|
|
58
|
-
this.
|
|
58
|
+
this.definition = undefined;
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
61
|
* Whether the Temporary Object has been deleted
|
|
62
62
|
*
|
|
63
63
|
* @type {boolean}
|
|
64
|
-
* @
|
|
64
|
+
* @public
|
|
65
65
|
*/
|
|
66
|
-
this.
|
|
66
|
+
this.deleted = undefined;
|
|
67
67
|
|
|
68
68
|
/**
|
|
69
69
|
* When the Temporary Object was last updated
|
|
70
70
|
*
|
|
71
71
|
* @type {Date}
|
|
72
|
-
* @
|
|
72
|
+
* @public
|
|
73
73
|
*/
|
|
74
|
-
this.
|
|
74
|
+
this.updateTimestamp = undefined;
|
|
75
75
|
|
|
76
76
|
/**
|
|
77
77
|
* The Site ID associated with this Temporary Object
|
|
78
78
|
*
|
|
79
79
|
* @type {number}
|
|
80
|
-
* @
|
|
80
|
+
* @public
|
|
81
81
|
*/
|
|
82
|
-
this.
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* The Temporary Object ID
|
|
87
|
-
*
|
|
88
|
-
* @public
|
|
89
|
-
* @type {string}
|
|
90
|
-
*/
|
|
91
|
-
get id()
|
|
92
|
-
{
|
|
93
|
-
return this._id;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* The Temporary Object Key Index
|
|
98
|
-
*
|
|
99
|
-
* @public
|
|
100
|
-
* @type {string}
|
|
101
|
-
*/
|
|
102
|
-
get keyIndex()
|
|
103
|
-
{
|
|
104
|
-
return this._keyIndex;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* The Temporary Object Type
|
|
109
|
-
*
|
|
110
|
-
* @public
|
|
111
|
-
* @type {string}
|
|
112
|
-
*/
|
|
113
|
-
get type()
|
|
114
|
-
{
|
|
115
|
-
return this._type;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* The Temporary Object Definition
|
|
120
|
-
*
|
|
121
|
-
* @public
|
|
122
|
-
* @type {Object}
|
|
123
|
-
*/
|
|
124
|
-
get definition()
|
|
125
|
-
{
|
|
126
|
-
return this._definition;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Whether the Temporary Object has been deleted
|
|
131
|
-
*
|
|
132
|
-
* @public
|
|
133
|
-
* @type {boolean}
|
|
134
|
-
*/
|
|
135
|
-
get deleted()
|
|
136
|
-
{
|
|
137
|
-
return this._deleted;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* When the Temporary Object was last updated
|
|
142
|
-
*
|
|
143
|
-
* @public
|
|
144
|
-
* @type {Date}
|
|
145
|
-
*/
|
|
146
|
-
get updateTimestamp()
|
|
147
|
-
{
|
|
148
|
-
return this._updateTimestamp;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* The Site ID associated with this Temporary Object
|
|
153
|
-
*
|
|
154
|
-
* @public
|
|
155
|
-
* @type {number}
|
|
156
|
-
*/
|
|
157
|
-
get siteId()
|
|
158
|
-
{
|
|
159
|
-
return this._siteId;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* Convert this **TemporaryObjectModel** to a JSON Object
|
|
164
|
-
*
|
|
165
|
-
* @public
|
|
166
|
-
* @return {Object<string, any>}
|
|
167
|
-
*/
|
|
168
|
-
toJSON()
|
|
169
|
-
{
|
|
170
|
-
return {
|
|
171
|
-
id: this._id,
|
|
172
|
-
keyIndex: this._keyIndex,
|
|
173
|
-
type: this._type,
|
|
174
|
-
definition: this._definition,
|
|
175
|
-
deleted: this._deleted,
|
|
176
|
-
updateTimestamp: this._updateTimestamp
|
|
177
|
-
};
|
|
82
|
+
this.siteId = siteId;
|
|
178
83
|
}
|
|
179
84
|
|
|
180
85
|
/**
|
|
@@ -208,7 +113,7 @@ class TemporaryObjectModel extends BaseSiteModel
|
|
|
208
113
|
|
|
209
114
|
if('id' in jsonObject)
|
|
210
115
|
{
|
|
211
|
-
model.
|
|
116
|
+
model.id = (function(){
|
|
212
117
|
if(typeof jsonObject['id'] !== 'string')
|
|
213
118
|
{
|
|
214
119
|
return String(jsonObject['id']);
|
|
@@ -220,7 +125,7 @@ class TemporaryObjectModel extends BaseSiteModel
|
|
|
220
125
|
|
|
221
126
|
if('keyIndex' in jsonObject)
|
|
222
127
|
{
|
|
223
|
-
model.
|
|
128
|
+
model.keyIndex = (function(){
|
|
224
129
|
if(typeof jsonObject['keyIndex'] !== 'string')
|
|
225
130
|
{
|
|
226
131
|
return String(jsonObject['keyIndex']);
|
|
@@ -232,7 +137,7 @@ class TemporaryObjectModel extends BaseSiteModel
|
|
|
232
137
|
|
|
233
138
|
if('type' in jsonObject)
|
|
234
139
|
{
|
|
235
|
-
model.
|
|
140
|
+
model.type = (function(){
|
|
236
141
|
if(typeof jsonObject['type'] !== 'string')
|
|
237
142
|
{
|
|
238
143
|
return String(jsonObject['type']);
|
|
@@ -244,7 +149,7 @@ class TemporaryObjectModel extends BaseSiteModel
|
|
|
244
149
|
|
|
245
150
|
if('definition' in jsonObject)
|
|
246
151
|
{
|
|
247
|
-
model.
|
|
152
|
+
model.definition = (function(){
|
|
248
153
|
if(typeof jsonObject['definition'] !== 'object')
|
|
249
154
|
{
|
|
250
155
|
return Object(jsonObject['definition']);
|
|
@@ -256,7 +161,7 @@ class TemporaryObjectModel extends BaseSiteModel
|
|
|
256
161
|
|
|
257
162
|
if('deleted' in jsonObject)
|
|
258
163
|
{
|
|
259
|
-
model.
|
|
164
|
+
model.deleted = (function(){
|
|
260
165
|
if(typeof jsonObject['deleted'] !== 'boolean')
|
|
261
166
|
{
|
|
262
167
|
return Boolean(jsonObject['deleted']);
|
|
@@ -268,7 +173,7 @@ class TemporaryObjectModel extends BaseSiteModel
|
|
|
268
173
|
|
|
269
174
|
if('updateTimestamp' in jsonObject)
|
|
270
175
|
{
|
|
271
|
-
model.
|
|
176
|
+
model.updateTimestamp = (function(){
|
|
272
177
|
if(typeof jsonObject['updateTimestamp'] !== 'string')
|
|
273
178
|
{
|
|
274
179
|
return new Date(String(jsonObject['updateTimestamp']));
|
package/src/Models/Site/index.js
CHANGED
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import AlarmGroupModel from './AlarmGroupModel';
|
|
11
11
|
import AlarmModel from './AlarmModel';
|
|
12
|
-
import BaseSiteModel from './BaseSiteModel';
|
|
13
12
|
import DefinitionModel from './DefinitionModel';
|
|
14
13
|
import PermanentObjectDataModel from './PermanentObjectDataModel';
|
|
15
14
|
import PermanentObjectModel from './PermanentObjectModel';
|
|
@@ -19,7 +18,6 @@ import TemporaryObjectModel from './TemporaryObjectModel';
|
|
|
19
18
|
const Site = {
|
|
20
19
|
AlarmGroupModel,
|
|
21
20
|
AlarmModel,
|
|
22
|
-
BaseSiteModel,
|
|
23
21
|
DefinitionModel,
|
|
24
22
|
PermanentObjectDataModel,
|
|
25
23
|
PermanentObjectModel,
|
package/src/Models/SiteModel.js
CHANGED
|
@@ -28,133 +28,49 @@ class SiteModel extends BaseModel
|
|
|
28
28
|
* The Site ID
|
|
29
29
|
*
|
|
30
30
|
* @type {number}
|
|
31
|
-
* @
|
|
31
|
+
* @public
|
|
32
32
|
*/
|
|
33
|
-
this.
|
|
33
|
+
this.id = undefined;
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
36
|
* The Site Name
|
|
37
37
|
*
|
|
38
38
|
* @type {string}
|
|
39
|
-
* @
|
|
39
|
+
* @public
|
|
40
40
|
*/
|
|
41
|
-
this.
|
|
41
|
+
this.name = undefined;
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
44
|
* The Company this Site belongs to
|
|
45
45
|
*
|
|
46
46
|
* @type {string}
|
|
47
|
-
* @
|
|
47
|
+
* @public
|
|
48
48
|
*/
|
|
49
|
-
this.
|
|
49
|
+
this.companyId = undefined;
|
|
50
50
|
|
|
51
51
|
/**
|
|
52
52
|
* Whether the Site is Enabled
|
|
53
53
|
*
|
|
54
54
|
* @type {boolean}
|
|
55
|
-
* @
|
|
55
|
+
* @public
|
|
56
56
|
*/
|
|
57
|
-
this.
|
|
57
|
+
this.enabled = undefined;
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
60
|
* Whether the Site has been deleted
|
|
61
61
|
*
|
|
62
62
|
* @type {boolean}
|
|
63
|
-
* @
|
|
63
|
+
* @public
|
|
64
64
|
*/
|
|
65
|
-
this.
|
|
65
|
+
this.deleted = undefined;
|
|
66
66
|
|
|
67
67
|
/**
|
|
68
68
|
* When the Site was last updated
|
|
69
69
|
*
|
|
70
70
|
* @type {Date}
|
|
71
|
-
* @
|
|
71
|
+
* @public
|
|
72
72
|
*/
|
|
73
|
-
this.
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* The Site ID
|
|
78
|
-
*
|
|
79
|
-
* @public
|
|
80
|
-
* @type {number}
|
|
81
|
-
*/
|
|
82
|
-
get id()
|
|
83
|
-
{
|
|
84
|
-
return this._id;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* The Site Name
|
|
89
|
-
*
|
|
90
|
-
* @public
|
|
91
|
-
* @type {string}
|
|
92
|
-
*/
|
|
93
|
-
get name()
|
|
94
|
-
{
|
|
95
|
-
return this._name;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* The Company this Site belongs to
|
|
100
|
-
*
|
|
101
|
-
* @public
|
|
102
|
-
* @type {string}
|
|
103
|
-
*/
|
|
104
|
-
get companyId()
|
|
105
|
-
{
|
|
106
|
-
return this._companyId;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Whether the Site is Enabled
|
|
111
|
-
*
|
|
112
|
-
* @public
|
|
113
|
-
* @type {boolean}
|
|
114
|
-
*/
|
|
115
|
-
get enabled()
|
|
116
|
-
{
|
|
117
|
-
return this._enabled;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Whether the Site has been deleted
|
|
122
|
-
*
|
|
123
|
-
* @public
|
|
124
|
-
* @type {boolean}
|
|
125
|
-
*/
|
|
126
|
-
get deleted()
|
|
127
|
-
{
|
|
128
|
-
return this._deleted;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* When the Site was last updated
|
|
133
|
-
*
|
|
134
|
-
* @public
|
|
135
|
-
* @type {Date}
|
|
136
|
-
*/
|
|
137
|
-
get updateTimestamp()
|
|
138
|
-
{
|
|
139
|
-
return this._updateTimestamp;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Convert this **SiteModel** to a JSON Object
|
|
144
|
-
*
|
|
145
|
-
* @public
|
|
146
|
-
* @return {Object<string, any>}
|
|
147
|
-
*/
|
|
148
|
-
toJSON()
|
|
149
|
-
{
|
|
150
|
-
return {
|
|
151
|
-
id: this._id,
|
|
152
|
-
name: this._name,
|
|
153
|
-
companyId: this._companyId,
|
|
154
|
-
enabled: this._enabled,
|
|
155
|
-
deleted: this._deleted,
|
|
156
|
-
updateTimestamp: this._updateTimestamp
|
|
157
|
-
};
|
|
73
|
+
this.updateTimestamp = undefined;
|
|
158
74
|
}
|
|
159
75
|
|
|
160
76
|
/**
|
|
@@ -187,7 +103,7 @@ class SiteModel extends BaseModel
|
|
|
187
103
|
|
|
188
104
|
if('id' in jsonObject)
|
|
189
105
|
{
|
|
190
|
-
model.
|
|
106
|
+
model.id = (function(){
|
|
191
107
|
if(typeof jsonObject['id'] !== 'number')
|
|
192
108
|
{
|
|
193
109
|
return Number.isInteger(Number(jsonObject['id'])) ? Number(jsonObject['id']) : Math.floor(Number(jsonObject['id']));
|
|
@@ -199,7 +115,7 @@ class SiteModel extends BaseModel
|
|
|
199
115
|
|
|
200
116
|
if('name' in jsonObject)
|
|
201
117
|
{
|
|
202
|
-
model.
|
|
118
|
+
model.name = (function(){
|
|
203
119
|
if(typeof jsonObject['name'] !== 'string')
|
|
204
120
|
{
|
|
205
121
|
return String(jsonObject['name']);
|
|
@@ -211,7 +127,7 @@ class SiteModel extends BaseModel
|
|
|
211
127
|
|
|
212
128
|
if('companyId' in jsonObject)
|
|
213
129
|
{
|
|
214
|
-
model.
|
|
130
|
+
model.companyId = (function(){
|
|
215
131
|
if(typeof jsonObject['companyId'] !== 'string')
|
|
216
132
|
{
|
|
217
133
|
return String(jsonObject['companyId']);
|
|
@@ -223,7 +139,7 @@ class SiteModel extends BaseModel
|
|
|
223
139
|
|
|
224
140
|
if('enabled' in jsonObject)
|
|
225
141
|
{
|
|
226
|
-
model.
|
|
142
|
+
model.enabled = (function(){
|
|
227
143
|
if(typeof jsonObject['enabled'] !== 'boolean')
|
|
228
144
|
{
|
|
229
145
|
return Boolean(jsonObject['enabled']);
|
|
@@ -235,7 +151,7 @@ class SiteModel extends BaseModel
|
|
|
235
151
|
|
|
236
152
|
if('deleted' in jsonObject)
|
|
237
153
|
{
|
|
238
|
-
model.
|
|
154
|
+
model.deleted = (function(){
|
|
239
155
|
if(typeof jsonObject['deleted'] !== 'boolean')
|
|
240
156
|
{
|
|
241
157
|
return Boolean(jsonObject['deleted']);
|
|
@@ -247,7 +163,7 @@ class SiteModel extends BaseModel
|
|
|
247
163
|
|
|
248
164
|
if('updateTimestamp' in jsonObject)
|
|
249
165
|
{
|
|
250
|
-
model.
|
|
166
|
+
model.updateTimestamp = (function(){
|
|
251
167
|
if(typeof jsonObject['updateTimestamp'] !== 'string')
|
|
252
168
|
{
|
|
253
169
|
return new Date(String(jsonObject['updateTimestamp']));
|