@ricado/api-client 1.4.0 → 2.0.2
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 +6 -6
- package/lib/Controllers/Packhouse/Site/CompacSizerBatchController.js +6 -6
- package/lib/Controllers/Packhouse/Site/CompacSizerController.js +5 -5
- package/lib/Controllers/Packhouse/Site/CompacSizerOutletProductChangeController.js +6 -6
- package/lib/Controllers/Packhouse/Site/CompacSizerOutletTypeChangeController.js +6 -6
- package/lib/Controllers/Packhouse/Site/CompacSizerOutletTypeController.js +5 -5
- package/lib/Controllers/Packhouse/Site/CompacSizerPackrunSummaryController.js +6 -6
- package/lib/Controllers/Packhouse/Site/DowntimeEventController.js +6 -6
- package/lib/Controllers/Packhouse/Site/FreshPackPackrunSummaryController.js +6 -6
- package/lib/Controllers/Packhouse/Site/GrowingMethodController.js +5 -5
- package/lib/Controllers/Packhouse/Site/PackTypeController.js +5 -5
- package/lib/Controllers/Packhouse/Site/PackingLineController.js +5 -5
- package/lib/Controllers/Packhouse/Site/PackrunController.js +292 -6
- package/lib/Controllers/Packhouse/Site/RejectBinController.js +6 -6
- package/lib/Controllers/Packhouse/Site/RejectBinScaleController.js +5 -5
- package/lib/Controllers/Packhouse/Site/RejectBinWeightController.js +6 -6
- package/lib/Controllers/Packhouse/Site/ShiftController.js +6 -6
- package/lib/Controllers/Packhouse/Site/ShiftFocusMeetingController.js +6 -6
- package/lib/Controllers/Packhouse/Site/ShiftHourlyEntryController.js +6 -6
- package/lib/Controllers/Packhouse/Site/VarietyController.js +5 -5
- 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 +6 -6
- package/lib/Controllers/Site/AlarmGroupController.js +5 -5
- package/lib/Controllers/Site/DefinitionController.js +5 -5
- package/lib/Controllers/Site/PermanentObjectController.js +5 -5
- package/lib/Controllers/Site/PermanentObjectDataController.js +6 -6
- package/lib/Controllers/Site/PointController.js +8 -6
- package/lib/Controllers/Site/TemporaryObjectController.js +5 -5
- 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 -195
- package/lib/Models/Packhouse/Site/CompacSizerBatchModel.js +40 -179
- package/lib/Models/Packhouse/Site/CompacSizerModel.js +58 -275
- package/lib/Models/Packhouse/Site/CompacSizerOutletProductChangeModel.js +46 -211
- package/lib/Models/Packhouse/Site/CompacSizerOutletTypeChangeModel.js +40 -179
- package/lib/Models/Packhouse/Site/CompacSizerOutletTypeModel.js +34 -147
- package/lib/Models/Packhouse/Site/CompacSizerPackrunSummaryModel.js +52 -243
- package/lib/Models/Packhouse/Site/DowntimeEventModel.js +58 -275
- package/lib/Models/Packhouse/Site/FreshPackPackrunSummaryModel.js +40 -179
- package/lib/Models/Packhouse/Site/GrowingMethodModel.js +34 -147
- package/lib/Models/Packhouse/Site/PackTypeModel.js +40 -179
- package/lib/Models/Packhouse/Site/PackingLineModel.js +61 -291
- package/lib/Models/Packhouse/Site/PackrunModel.js +61 -291
- package/lib/Models/Packhouse/Site/RejectBinModel.js +43 -195
- package/lib/Models/Packhouse/Site/RejectBinScaleModel.js +52 -243
- package/lib/Models/Packhouse/Site/RejectBinWeightModel.js +46 -211
- package/lib/Models/Packhouse/Site/ShiftFocusMeetingModel.js +52 -243
- package/lib/Models/Packhouse/Site/ShiftHourlyEntryModel.js +127 -643
- package/lib/Models/Packhouse/Site/ShiftModel.js +73 -355
- package/lib/Models/Packhouse/Site/VarietyModel.js +40 -179
- package/lib/Models/RTUModel.js +26 -117
- package/lib/Models/RTUPluginModel.js +23 -101
- package/lib/Models/Site/AlarmGroupModel.js +37 -163
- package/lib/Models/Site/AlarmModel.js +67 -323
- package/lib/Models/Site/DefinitionModel.js +34 -147
- package/lib/Models/Site/PermanentObjectDataModel.js +40 -179
- package/lib/Models/Site/PermanentObjectModel.js +37 -163
- package/lib/Models/Site/PointModel.js +49 -227
- package/lib/Models/Site/TemporaryObjectModel.js +34 -147
- 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 +931 -1589
- package/package.json +3 -3
- package/src/Controllers/Packhouse/Site/BinTipWeightController.js +4 -4
- package/src/Controllers/Packhouse/Site/CompacSizerBatchController.js +4 -4
- package/src/Controllers/Packhouse/Site/CompacSizerController.js +4 -4
- package/src/Controllers/Packhouse/Site/CompacSizerOutletProductChangeController.js +4 -4
- package/src/Controllers/Packhouse/Site/CompacSizerOutletTypeChangeController.js +4 -4
- package/src/Controllers/Packhouse/Site/CompacSizerOutletTypeController.js +4 -4
- package/src/Controllers/Packhouse/Site/CompacSizerPackrunSummaryController.js +4 -4
- package/src/Controllers/Packhouse/Site/DowntimeEventController.js +4 -4
- package/src/Controllers/Packhouse/Site/FreshPackPackrunSummaryController.js +4 -4
- package/src/Controllers/Packhouse/Site/GrowingMethodController.js +4 -4
- package/src/Controllers/Packhouse/Site/PackTypeController.js +4 -4
- package/src/Controllers/Packhouse/Site/PackingLineController.js +4 -4
- package/src/Controllers/Packhouse/Site/PackrunController.js +365 -4
- package/src/Controllers/Packhouse/Site/RejectBinController.js +4 -4
- package/src/Controllers/Packhouse/Site/RejectBinScaleController.js +4 -4
- package/src/Controllers/Packhouse/Site/RejectBinWeightController.js +4 -4
- package/src/Controllers/Packhouse/Site/ShiftController.js +4 -4
- package/src/Controllers/Packhouse/Site/ShiftFocusMeetingController.js +4 -4
- package/src/Controllers/Packhouse/Site/ShiftHourlyEntryController.js +4 -4
- package/src/Controllers/Packhouse/Site/VarietyController.js +4 -4
- package/src/Controllers/Site/AlarmController.js +4 -4
- package/src/Controllers/Site/AlarmGroupController.js +4 -4
- package/src/Controllers/Site/DefinitionController.js +4 -4
- package/src/Controllers/Site/PermanentObjectController.js +4 -4
- package/src/Controllers/Site/PermanentObjectDataController.js +4 -4
- package/src/Controllers/Site/PointController.js +6 -4
- package/src/Controllers/Site/TemporaryObjectController.js +4 -4
- 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 +33 -174
- package/src/Models/Packhouse/Site/CompacSizerBatchModel.js +30 -159
- package/src/Models/Packhouse/Site/CompacSizerModel.js +48 -249
- package/src/Models/Packhouse/Site/CompacSizerOutletProductChangeModel.js +36 -189
- package/src/Models/Packhouse/Site/CompacSizerOutletTypeChangeModel.js +30 -159
- package/src/Models/Packhouse/Site/CompacSizerOutletTypeModel.js +24 -129
- package/src/Models/Packhouse/Site/CompacSizerPackrunSummaryModel.js +42 -219
- package/src/Models/Packhouse/Site/DowntimeEventModel.js +48 -249
- package/src/Models/Packhouse/Site/FreshPackPackrunSummaryModel.js +30 -159
- package/src/Models/Packhouse/Site/GrowingMethodModel.js +24 -129
- package/src/Models/Packhouse/Site/PackTypeModel.js +30 -159
- package/src/Models/Packhouse/Site/PackingLineModel.js +51 -264
- package/src/Models/Packhouse/Site/PackrunModel.js +51 -264
- package/src/Models/Packhouse/Site/RejectBinModel.js +33 -174
- package/src/Models/Packhouse/Site/RejectBinScaleModel.js +42 -219
- package/src/Models/Packhouse/Site/RejectBinWeightModel.js +36 -189
- package/src/Models/Packhouse/Site/ShiftFocusMeetingModel.js +42 -219
- package/src/Models/Packhouse/Site/ShiftHourlyEntryModel.js +117 -594
- package/src/Models/Packhouse/Site/ShiftModel.js +63 -324
- package/src/Models/Packhouse/Site/VarietyModel.js +30 -159
- package/src/Models/RTUModel.js +18 -102
- package/src/Models/RTUPluginModel.js +15 -87
- package/src/Models/Site/AlarmGroupModel.js +27 -144
- package/src/Models/Site/AlarmModel.js +57 -294
- package/src/Models/Site/DefinitionModel.js +24 -129
- package/src/Models/Site/PermanentObjectDataModel.js +30 -159
- package/src/Models/Site/PermanentObjectModel.js +27 -144
- package/src/Models/Site/PointModel.js +39 -204
- package/src/Models/Site/TemporaryObjectModel.js +24 -129
- 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,24 +4,23 @@
|
|
|
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 Permanent Object
|
|
11
11
|
*
|
|
12
12
|
* @class
|
|
13
13
|
* @hideconstructor
|
|
14
|
-
* @extends
|
|
14
|
+
* @extends BaseModel
|
|
15
15
|
*/
|
|
16
|
-
class PermanentObjectModel extends
|
|
16
|
+
class PermanentObjectModel extends BaseModel
|
|
17
17
|
{
|
|
18
18
|
/**
|
|
19
19
|
* PermanentObjectModel Constructor
|
|
20
20
|
*
|
|
21
21
|
* @protected
|
|
22
|
-
* @param {number} siteId The Site ID associated with this Permanent Object
|
|
23
22
|
*/
|
|
24
|
-
constructor(
|
|
23
|
+
constructor()
|
|
25
24
|
{
|
|
26
25
|
super();
|
|
27
26
|
|
|
@@ -29,172 +28,57 @@ class PermanentObjectModel extends BaseSiteModel
|
|
|
29
28
|
* The Permanent Object ID
|
|
30
29
|
*
|
|
31
30
|
* @type {string}
|
|
32
|
-
* @
|
|
31
|
+
* @public
|
|
33
32
|
*/
|
|
34
|
-
this.
|
|
33
|
+
this.id = undefined;
|
|
35
34
|
|
|
36
35
|
/**
|
|
37
36
|
* The RTU this Permanent Object belongs to
|
|
38
37
|
*
|
|
39
38
|
* @type {?number}
|
|
40
|
-
* @
|
|
39
|
+
* @public
|
|
41
40
|
*/
|
|
42
|
-
this.
|
|
41
|
+
this.rtuId = undefined;
|
|
43
42
|
|
|
44
43
|
/**
|
|
45
44
|
* The Permanent Object Key Index
|
|
46
45
|
*
|
|
47
46
|
* @type {string}
|
|
48
|
-
* @
|
|
47
|
+
* @public
|
|
49
48
|
*/
|
|
50
|
-
this.
|
|
49
|
+
this.keyIndex = undefined;
|
|
51
50
|
|
|
52
51
|
/**
|
|
53
52
|
* The Permanent Object Type
|
|
54
53
|
*
|
|
55
54
|
* @type {string}
|
|
56
|
-
* @
|
|
55
|
+
* @public
|
|
57
56
|
*/
|
|
58
|
-
this.
|
|
57
|
+
this.type = undefined;
|
|
59
58
|
|
|
60
59
|
/**
|
|
61
60
|
* The Permanent Object Definition
|
|
62
61
|
*
|
|
63
62
|
* @type {Object}
|
|
64
|
-
* @
|
|
63
|
+
* @public
|
|
65
64
|
*/
|
|
66
|
-
this.
|
|
65
|
+
this.definition = undefined;
|
|
67
66
|
|
|
68
67
|
/**
|
|
69
68
|
* Whether the Permanent Object has been deleted
|
|
70
69
|
*
|
|
71
70
|
* @type {boolean}
|
|
72
|
-
* @
|
|
71
|
+
* @public
|
|
73
72
|
*/
|
|
74
|
-
this.
|
|
73
|
+
this.deleted = undefined;
|
|
75
74
|
|
|
76
75
|
/**
|
|
77
76
|
* When the Permanent Object was last updated
|
|
78
77
|
*
|
|
79
78
|
* @type {Date}
|
|
80
|
-
* @
|
|
79
|
+
* @public
|
|
81
80
|
*/
|
|
82
|
-
this.
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* The Site ID associated with this Permanent Object
|
|
86
|
-
*
|
|
87
|
-
* @type {number}
|
|
88
|
-
* @private
|
|
89
|
-
*/
|
|
90
|
-
this._siteId = siteId;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* The Permanent Object ID
|
|
95
|
-
*
|
|
96
|
-
* @public
|
|
97
|
-
* @type {string}
|
|
98
|
-
*/
|
|
99
|
-
get id()
|
|
100
|
-
{
|
|
101
|
-
return this._id;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* The RTU this Permanent Object belongs to
|
|
106
|
-
*
|
|
107
|
-
* @public
|
|
108
|
-
* @type {?number}
|
|
109
|
-
*/
|
|
110
|
-
get rtuId()
|
|
111
|
-
{
|
|
112
|
-
return this._rtuId;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* The Permanent Object Key Index
|
|
117
|
-
*
|
|
118
|
-
* @public
|
|
119
|
-
* @type {string}
|
|
120
|
-
*/
|
|
121
|
-
get keyIndex()
|
|
122
|
-
{
|
|
123
|
-
return this._keyIndex;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* The Permanent Object Type
|
|
128
|
-
*
|
|
129
|
-
* @public
|
|
130
|
-
* @type {string}
|
|
131
|
-
*/
|
|
132
|
-
get type()
|
|
133
|
-
{
|
|
134
|
-
return this._type;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* The Permanent Object Definition
|
|
139
|
-
*
|
|
140
|
-
* @public
|
|
141
|
-
* @type {Object}
|
|
142
|
-
*/
|
|
143
|
-
get definition()
|
|
144
|
-
{
|
|
145
|
-
return this._definition;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* Whether the Permanent Object has been deleted
|
|
150
|
-
*
|
|
151
|
-
* @public
|
|
152
|
-
* @type {boolean}
|
|
153
|
-
*/
|
|
154
|
-
get deleted()
|
|
155
|
-
{
|
|
156
|
-
return this._deleted;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* When the Permanent Object was last updated
|
|
161
|
-
*
|
|
162
|
-
* @public
|
|
163
|
-
* @type {Date}
|
|
164
|
-
*/
|
|
165
|
-
get updateTimestamp()
|
|
166
|
-
{
|
|
167
|
-
return this._updateTimestamp;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
/**
|
|
171
|
-
* The Site ID associated with this Permanent Object
|
|
172
|
-
*
|
|
173
|
-
* @public
|
|
174
|
-
* @type {number}
|
|
175
|
-
*/
|
|
176
|
-
get siteId()
|
|
177
|
-
{
|
|
178
|
-
return this._siteId;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* Convert this **PermanentObjectModel** to a JSON Object
|
|
183
|
-
*
|
|
184
|
-
* @public
|
|
185
|
-
* @return {Object<string, any>}
|
|
186
|
-
*/
|
|
187
|
-
toJSON()
|
|
188
|
-
{
|
|
189
|
-
return {
|
|
190
|
-
id: this._id,
|
|
191
|
-
rtuId: this._rtuId,
|
|
192
|
-
keyIndex: this._keyIndex,
|
|
193
|
-
type: this._type,
|
|
194
|
-
definition: this._definition,
|
|
195
|
-
deleted: this._deleted,
|
|
196
|
-
updateTimestamp: this._updateTimestamp
|
|
197
|
-
};
|
|
81
|
+
this.updateTimestamp = undefined;
|
|
198
82
|
}
|
|
199
83
|
|
|
200
84
|
/**
|
|
@@ -203,12 +87,11 @@ class PermanentObjectModel extends BaseSiteModel
|
|
|
203
87
|
* @static
|
|
204
88
|
* @public
|
|
205
89
|
* @param {Object<string, any>|string} json A JSON Object or JSON String
|
|
206
|
-
* @param {number} siteId The Site ID associated with this Permanent Object
|
|
207
90
|
* @return {PermanentObjectModel}
|
|
208
91
|
*/
|
|
209
|
-
static fromJSON(json
|
|
92
|
+
static fromJSON(json)
|
|
210
93
|
{
|
|
211
|
-
let model = new PermanentObjectModel(
|
|
94
|
+
let model = new PermanentObjectModel();
|
|
212
95
|
|
|
213
96
|
/**
|
|
214
97
|
* The JSON Object
|
|
@@ -228,7 +111,7 @@ class PermanentObjectModel extends BaseSiteModel
|
|
|
228
111
|
|
|
229
112
|
if('id' in jsonObject)
|
|
230
113
|
{
|
|
231
|
-
model.
|
|
114
|
+
model.id = (function(){
|
|
232
115
|
if(typeof jsonObject['id'] !== 'string')
|
|
233
116
|
{
|
|
234
117
|
return String(jsonObject['id']);
|
|
@@ -240,7 +123,7 @@ class PermanentObjectModel extends BaseSiteModel
|
|
|
240
123
|
|
|
241
124
|
if('rtuId' in jsonObject)
|
|
242
125
|
{
|
|
243
|
-
model.
|
|
126
|
+
model.rtuId = (function(){
|
|
244
127
|
if(jsonObject['rtuId'] === null)
|
|
245
128
|
{
|
|
246
129
|
return null;
|
|
@@ -257,7 +140,7 @@ class PermanentObjectModel extends BaseSiteModel
|
|
|
257
140
|
|
|
258
141
|
if('keyIndex' in jsonObject)
|
|
259
142
|
{
|
|
260
|
-
model.
|
|
143
|
+
model.keyIndex = (function(){
|
|
261
144
|
if(typeof jsonObject['keyIndex'] !== 'string')
|
|
262
145
|
{
|
|
263
146
|
return String(jsonObject['keyIndex']);
|
|
@@ -269,7 +152,7 @@ class PermanentObjectModel extends BaseSiteModel
|
|
|
269
152
|
|
|
270
153
|
if('type' in jsonObject)
|
|
271
154
|
{
|
|
272
|
-
model.
|
|
155
|
+
model.type = (function(){
|
|
273
156
|
if(typeof jsonObject['type'] !== 'string')
|
|
274
157
|
{
|
|
275
158
|
return String(jsonObject['type']);
|
|
@@ -281,7 +164,7 @@ class PermanentObjectModel extends BaseSiteModel
|
|
|
281
164
|
|
|
282
165
|
if('definition' in jsonObject)
|
|
283
166
|
{
|
|
284
|
-
model.
|
|
167
|
+
model.definition = (function(){
|
|
285
168
|
if(typeof jsonObject['definition'] !== 'object')
|
|
286
169
|
{
|
|
287
170
|
return Object(jsonObject['definition']);
|
|
@@ -293,7 +176,7 @@ class PermanentObjectModel extends BaseSiteModel
|
|
|
293
176
|
|
|
294
177
|
if('deleted' in jsonObject)
|
|
295
178
|
{
|
|
296
|
-
model.
|
|
179
|
+
model.deleted = (function(){
|
|
297
180
|
if(typeof jsonObject['deleted'] !== 'boolean')
|
|
298
181
|
{
|
|
299
182
|
return Boolean(jsonObject['deleted']);
|
|
@@ -305,7 +188,7 @@ class PermanentObjectModel extends BaseSiteModel
|
|
|
305
188
|
|
|
306
189
|
if('updateTimestamp' in jsonObject)
|
|
307
190
|
{
|
|
308
|
-
model.
|
|
191
|
+
model.updateTimestamp = (function(){
|
|
309
192
|
if(typeof jsonObject['updateTimestamp'] !== 'string')
|
|
310
193
|
{
|
|
311
194
|
return new Date(String(jsonObject['updateTimestamp']));
|
|
@@ -4,24 +4,23 @@
|
|
|
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 Point
|
|
11
11
|
*
|
|
12
12
|
* @class
|
|
13
13
|
* @hideconstructor
|
|
14
|
-
* @extends
|
|
14
|
+
* @extends BaseModel
|
|
15
15
|
*/
|
|
16
|
-
class PointModel extends
|
|
16
|
+
class PointModel extends BaseModel
|
|
17
17
|
{
|
|
18
18
|
/**
|
|
19
19
|
* PointModel Constructor
|
|
20
20
|
*
|
|
21
21
|
* @protected
|
|
22
|
-
* @param {number} siteId The Site ID associated with this Point
|
|
23
22
|
*/
|
|
24
|
-
constructor(
|
|
23
|
+
constructor()
|
|
25
24
|
{
|
|
26
25
|
super();
|
|
27
26
|
|
|
@@ -29,252 +28,89 @@ class PointModel extends BaseSiteModel
|
|
|
29
28
|
* The Point ID
|
|
30
29
|
*
|
|
31
30
|
* @type {number}
|
|
32
|
-
* @
|
|
31
|
+
* @public
|
|
33
32
|
*/
|
|
34
|
-
this.
|
|
33
|
+
this.id = undefined;
|
|
35
34
|
|
|
36
35
|
/**
|
|
37
36
|
* The RTU this Point belongs to
|
|
38
37
|
*
|
|
39
38
|
* @type {?number}
|
|
40
|
-
* @
|
|
39
|
+
* @public
|
|
41
40
|
*/
|
|
42
|
-
this.
|
|
41
|
+
this.rtuId = undefined;
|
|
43
42
|
|
|
44
43
|
/**
|
|
45
44
|
* The Plugin ID
|
|
46
45
|
*
|
|
47
46
|
* @type {?number}
|
|
48
|
-
* @
|
|
47
|
+
* @public
|
|
49
48
|
*/
|
|
50
|
-
this.
|
|
49
|
+
this.pluginId = undefined;
|
|
51
50
|
|
|
52
51
|
/**
|
|
53
52
|
* The Point Name
|
|
54
53
|
*
|
|
55
54
|
* @type {string}
|
|
56
|
-
* @
|
|
55
|
+
* @public
|
|
57
56
|
*/
|
|
58
|
-
this.
|
|
57
|
+
this.name = undefined;
|
|
59
58
|
|
|
60
59
|
/**
|
|
61
60
|
* The Point Type
|
|
62
61
|
*
|
|
63
62
|
* @type {string}
|
|
64
|
-
* @
|
|
63
|
+
* @public
|
|
65
64
|
*/
|
|
66
|
-
this.
|
|
65
|
+
this.type = undefined;
|
|
67
66
|
|
|
68
67
|
/**
|
|
69
68
|
* The Point's Value Type
|
|
70
69
|
*
|
|
71
70
|
* @type {string}
|
|
72
|
-
* @
|
|
71
|
+
* @public
|
|
73
72
|
*/
|
|
74
|
-
this.
|
|
73
|
+
this.valueType = undefined;
|
|
75
74
|
|
|
76
75
|
/**
|
|
77
76
|
* The Permissions
|
|
78
77
|
*
|
|
79
78
|
* @type {string}
|
|
80
|
-
* @
|
|
79
|
+
* @public
|
|
81
80
|
*/
|
|
82
|
-
this.
|
|
81
|
+
this.permissions = undefined;
|
|
83
82
|
|
|
84
83
|
/**
|
|
85
84
|
* Whether the Point is Enabled
|
|
86
85
|
*
|
|
87
86
|
* @type {boolean}
|
|
88
|
-
* @
|
|
87
|
+
* @public
|
|
89
88
|
*/
|
|
90
|
-
this.
|
|
89
|
+
this.enabled = undefined;
|
|
91
90
|
|
|
92
91
|
/**
|
|
93
92
|
* The Point Settings
|
|
94
93
|
*
|
|
95
94
|
* @type {Object}
|
|
96
|
-
* @
|
|
95
|
+
* @public
|
|
97
96
|
*/
|
|
98
|
-
this.
|
|
97
|
+
this.settings = undefined;
|
|
99
98
|
|
|
100
99
|
/**
|
|
101
100
|
* Whether the Point has been deleted
|
|
102
101
|
*
|
|
103
102
|
* @type {boolean}
|
|
104
|
-
* @
|
|
103
|
+
* @public
|
|
105
104
|
*/
|
|
106
|
-
this.
|
|
105
|
+
this.deleted = undefined;
|
|
107
106
|
|
|
108
107
|
/**
|
|
109
108
|
* When the Point was last updated
|
|
110
109
|
*
|
|
111
110
|
* @type {Date}
|
|
112
|
-
* @
|
|
111
|
+
* @public
|
|
113
112
|
*/
|
|
114
|
-
this.
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* The Site ID associated with this Point
|
|
118
|
-
*
|
|
119
|
-
* @type {number}
|
|
120
|
-
* @private
|
|
121
|
-
*/
|
|
122
|
-
this._siteId = siteId;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* The Point ID
|
|
127
|
-
*
|
|
128
|
-
* @public
|
|
129
|
-
* @type {number}
|
|
130
|
-
*/
|
|
131
|
-
get id()
|
|
132
|
-
{
|
|
133
|
-
return this._id;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* The RTU this Point belongs to
|
|
138
|
-
*
|
|
139
|
-
* @public
|
|
140
|
-
* @type {?number}
|
|
141
|
-
*/
|
|
142
|
-
get rtuId()
|
|
143
|
-
{
|
|
144
|
-
return this._rtuId;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* The Plugin ID
|
|
149
|
-
*
|
|
150
|
-
* @public
|
|
151
|
-
* @type {?number}
|
|
152
|
-
*/
|
|
153
|
-
get pluginId()
|
|
154
|
-
{
|
|
155
|
-
return this._pluginId;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
* The Point Name
|
|
160
|
-
*
|
|
161
|
-
* @public
|
|
162
|
-
* @type {string}
|
|
163
|
-
*/
|
|
164
|
-
get name()
|
|
165
|
-
{
|
|
166
|
-
return this._name;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* The Point Type
|
|
171
|
-
*
|
|
172
|
-
* @public
|
|
173
|
-
* @type {string}
|
|
174
|
-
*/
|
|
175
|
-
get type()
|
|
176
|
-
{
|
|
177
|
-
return this._type;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* The Point's Value Type
|
|
182
|
-
*
|
|
183
|
-
* @public
|
|
184
|
-
* @type {string}
|
|
185
|
-
*/
|
|
186
|
-
get valueType()
|
|
187
|
-
{
|
|
188
|
-
return this._valueType;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* The Permissions
|
|
193
|
-
*
|
|
194
|
-
* @public
|
|
195
|
-
* @type {string}
|
|
196
|
-
*/
|
|
197
|
-
get permissions()
|
|
198
|
-
{
|
|
199
|
-
return this._permissions;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
/**
|
|
203
|
-
* Whether the Point is Enabled
|
|
204
|
-
*
|
|
205
|
-
* @public
|
|
206
|
-
* @type {boolean}
|
|
207
|
-
*/
|
|
208
|
-
get enabled()
|
|
209
|
-
{
|
|
210
|
-
return this._enabled;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
/**
|
|
214
|
-
* The Point Settings
|
|
215
|
-
*
|
|
216
|
-
* @public
|
|
217
|
-
* @type {Object}
|
|
218
|
-
*/
|
|
219
|
-
get settings()
|
|
220
|
-
{
|
|
221
|
-
return this._settings;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
/**
|
|
225
|
-
* Whether the Point has been deleted
|
|
226
|
-
*
|
|
227
|
-
* @public
|
|
228
|
-
* @type {boolean}
|
|
229
|
-
*/
|
|
230
|
-
get deleted()
|
|
231
|
-
{
|
|
232
|
-
return this._deleted;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
/**
|
|
236
|
-
* When the Point was last updated
|
|
237
|
-
*
|
|
238
|
-
* @public
|
|
239
|
-
* @type {Date}
|
|
240
|
-
*/
|
|
241
|
-
get updateTimestamp()
|
|
242
|
-
{
|
|
243
|
-
return this._updateTimestamp;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
/**
|
|
247
|
-
* The Site ID associated with this Point
|
|
248
|
-
*
|
|
249
|
-
* @public
|
|
250
|
-
* @type {number}
|
|
251
|
-
*/
|
|
252
|
-
get siteId()
|
|
253
|
-
{
|
|
254
|
-
return this._siteId;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
/**
|
|
258
|
-
* Convert this **PointModel** to a JSON Object
|
|
259
|
-
*
|
|
260
|
-
* @public
|
|
261
|
-
* @return {Object<string, any>}
|
|
262
|
-
*/
|
|
263
|
-
toJSON()
|
|
264
|
-
{
|
|
265
|
-
return {
|
|
266
|
-
id: this._id,
|
|
267
|
-
rtuId: this._rtuId,
|
|
268
|
-
pluginId: this._pluginId,
|
|
269
|
-
name: this._name,
|
|
270
|
-
type: this._type,
|
|
271
|
-
valueType: this._valueType,
|
|
272
|
-
permissions: this._permissions,
|
|
273
|
-
enabled: this._enabled,
|
|
274
|
-
settings: this._settings,
|
|
275
|
-
deleted: this._deleted,
|
|
276
|
-
updateTimestamp: this._updateTimestamp
|
|
277
|
-
};
|
|
113
|
+
this.updateTimestamp = undefined;
|
|
278
114
|
}
|
|
279
115
|
|
|
280
116
|
/**
|
|
@@ -283,12 +119,11 @@ class PointModel extends BaseSiteModel
|
|
|
283
119
|
* @static
|
|
284
120
|
* @public
|
|
285
121
|
* @param {Object<string, any>|string} json A JSON Object or JSON String
|
|
286
|
-
* @param {number} siteId The Site ID associated with this Point
|
|
287
122
|
* @return {PointModel}
|
|
288
123
|
*/
|
|
289
|
-
static fromJSON(json
|
|
124
|
+
static fromJSON(json)
|
|
290
125
|
{
|
|
291
|
-
let model = new PointModel(
|
|
126
|
+
let model = new PointModel();
|
|
292
127
|
|
|
293
128
|
/**
|
|
294
129
|
* The JSON Object
|
|
@@ -308,7 +143,7 @@ class PointModel extends BaseSiteModel
|
|
|
308
143
|
|
|
309
144
|
if('id' in jsonObject)
|
|
310
145
|
{
|
|
311
|
-
model.
|
|
146
|
+
model.id = (function(){
|
|
312
147
|
if(typeof jsonObject['id'] !== 'number')
|
|
313
148
|
{
|
|
314
149
|
return Number.isInteger(Number(jsonObject['id'])) ? Number(jsonObject['id']) : Math.floor(Number(jsonObject['id']));
|
|
@@ -320,7 +155,7 @@ class PointModel extends BaseSiteModel
|
|
|
320
155
|
|
|
321
156
|
if('rtuId' in jsonObject)
|
|
322
157
|
{
|
|
323
|
-
model.
|
|
158
|
+
model.rtuId = (function(){
|
|
324
159
|
if(jsonObject['rtuId'] === null)
|
|
325
160
|
{
|
|
326
161
|
return null;
|
|
@@ -337,7 +172,7 @@ class PointModel extends BaseSiteModel
|
|
|
337
172
|
|
|
338
173
|
if('pluginId' in jsonObject)
|
|
339
174
|
{
|
|
340
|
-
model.
|
|
175
|
+
model.pluginId = (function(){
|
|
341
176
|
if(jsonObject['pluginId'] === null)
|
|
342
177
|
{
|
|
343
178
|
return null;
|
|
@@ -354,7 +189,7 @@ class PointModel extends BaseSiteModel
|
|
|
354
189
|
|
|
355
190
|
if('name' in jsonObject)
|
|
356
191
|
{
|
|
357
|
-
model.
|
|
192
|
+
model.name = (function(){
|
|
358
193
|
if(typeof jsonObject['name'] !== 'string')
|
|
359
194
|
{
|
|
360
195
|
return String(jsonObject['name']);
|
|
@@ -366,7 +201,7 @@ class PointModel extends BaseSiteModel
|
|
|
366
201
|
|
|
367
202
|
if('type' in jsonObject)
|
|
368
203
|
{
|
|
369
|
-
model.
|
|
204
|
+
model.type = (function(){
|
|
370
205
|
if(typeof jsonObject['type'] !== 'string')
|
|
371
206
|
{
|
|
372
207
|
return String(jsonObject['type']);
|
|
@@ -378,7 +213,7 @@ class PointModel extends BaseSiteModel
|
|
|
378
213
|
|
|
379
214
|
if('valueType' in jsonObject)
|
|
380
215
|
{
|
|
381
|
-
model.
|
|
216
|
+
model.valueType = (function(){
|
|
382
217
|
if(typeof jsonObject['valueType'] !== 'string')
|
|
383
218
|
{
|
|
384
219
|
return String(jsonObject['valueType']);
|
|
@@ -390,7 +225,7 @@ class PointModel extends BaseSiteModel
|
|
|
390
225
|
|
|
391
226
|
if('permissions' in jsonObject)
|
|
392
227
|
{
|
|
393
|
-
model.
|
|
228
|
+
model.permissions = (function(){
|
|
394
229
|
if(typeof jsonObject['permissions'] !== 'string')
|
|
395
230
|
{
|
|
396
231
|
return String(jsonObject['permissions']);
|
|
@@ -402,7 +237,7 @@ class PointModel extends BaseSiteModel
|
|
|
402
237
|
|
|
403
238
|
if('enabled' in jsonObject)
|
|
404
239
|
{
|
|
405
|
-
model.
|
|
240
|
+
model.enabled = (function(){
|
|
406
241
|
if(typeof jsonObject['enabled'] !== 'boolean')
|
|
407
242
|
{
|
|
408
243
|
return Boolean(jsonObject['enabled']);
|
|
@@ -414,7 +249,7 @@ class PointModel extends BaseSiteModel
|
|
|
414
249
|
|
|
415
250
|
if('settings' in jsonObject)
|
|
416
251
|
{
|
|
417
|
-
model.
|
|
252
|
+
model.settings = (function(){
|
|
418
253
|
if(typeof jsonObject['settings'] !== 'object')
|
|
419
254
|
{
|
|
420
255
|
return Object(jsonObject['settings']);
|
|
@@ -426,7 +261,7 @@ class PointModel extends BaseSiteModel
|
|
|
426
261
|
|
|
427
262
|
if('deleted' in jsonObject)
|
|
428
263
|
{
|
|
429
|
-
model.
|
|
264
|
+
model.deleted = (function(){
|
|
430
265
|
if(typeof jsonObject['deleted'] !== 'boolean')
|
|
431
266
|
{
|
|
432
267
|
return Boolean(jsonObject['deleted']);
|
|
@@ -438,7 +273,7 @@ class PointModel extends BaseSiteModel
|
|
|
438
273
|
|
|
439
274
|
if('updateTimestamp' in jsonObject)
|
|
440
275
|
{
|
|
441
|
-
model.
|
|
276
|
+
model.updateTimestamp = (function(){
|
|
442
277
|
if(typeof jsonObject['updateTimestamp'] !== 'string')
|
|
443
278
|
{
|
|
444
279
|
return new Date(String(jsonObject['updateTimestamp']));
|