@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 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
|
|
@@ -29,172 +29,65 @@ class PermanentObjectModel extends BaseSiteModel
|
|
|
29
29
|
* The Permanent 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 RTU this Permanent Object belongs to
|
|
38
38
|
*
|
|
39
39
|
* @type {?number}
|
|
40
|
-
* @
|
|
40
|
+
* @public
|
|
41
41
|
*/
|
|
42
|
-
this.
|
|
42
|
+
this.rtuId = undefined;
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
* The Permanent Object Key Index
|
|
46
46
|
*
|
|
47
47
|
* @type {string}
|
|
48
|
-
* @
|
|
48
|
+
* @public
|
|
49
49
|
*/
|
|
50
|
-
this.
|
|
50
|
+
this.keyIndex = undefined;
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
53
|
* The Permanent Object Type
|
|
54
54
|
*
|
|
55
55
|
* @type {string}
|
|
56
|
-
* @
|
|
56
|
+
* @public
|
|
57
57
|
*/
|
|
58
|
-
this.
|
|
58
|
+
this.type = undefined;
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
61
|
* The Permanent Object Definition
|
|
62
62
|
*
|
|
63
63
|
* @type {Object}
|
|
64
|
-
* @
|
|
64
|
+
* @public
|
|
65
65
|
*/
|
|
66
|
-
this.
|
|
66
|
+
this.definition = undefined;
|
|
67
67
|
|
|
68
68
|
/**
|
|
69
69
|
* Whether the Permanent Object has been deleted
|
|
70
70
|
*
|
|
71
71
|
* @type {boolean}
|
|
72
|
-
* @
|
|
72
|
+
* @public
|
|
73
73
|
*/
|
|
74
|
-
this.
|
|
74
|
+
this.deleted = undefined;
|
|
75
75
|
|
|
76
76
|
/**
|
|
77
77
|
* When the Permanent Object was last updated
|
|
78
78
|
*
|
|
79
79
|
* @type {Date}
|
|
80
|
-
* @
|
|
80
|
+
* @public
|
|
81
81
|
*/
|
|
82
|
-
this.
|
|
82
|
+
this.updateTimestamp = undefined;
|
|
83
83
|
|
|
84
84
|
/**
|
|
85
85
|
* The Site ID associated with this Permanent Object
|
|
86
86
|
*
|
|
87
87
|
* @type {number}
|
|
88
|
-
* @
|
|
88
|
+
* @public
|
|
89
89
|
*/
|
|
90
|
-
this.
|
|
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
|
-
};
|
|
90
|
+
this.siteId = siteId;
|
|
198
91
|
}
|
|
199
92
|
|
|
200
93
|
/**
|
|
@@ -228,7 +121,7 @@ class PermanentObjectModel extends BaseSiteModel
|
|
|
228
121
|
|
|
229
122
|
if('id' in jsonObject)
|
|
230
123
|
{
|
|
231
|
-
model.
|
|
124
|
+
model.id = (function(){
|
|
232
125
|
if(typeof jsonObject['id'] !== 'string')
|
|
233
126
|
{
|
|
234
127
|
return String(jsonObject['id']);
|
|
@@ -240,7 +133,7 @@ class PermanentObjectModel extends BaseSiteModel
|
|
|
240
133
|
|
|
241
134
|
if('rtuId' in jsonObject)
|
|
242
135
|
{
|
|
243
|
-
model.
|
|
136
|
+
model.rtuId = (function(){
|
|
244
137
|
if(jsonObject['rtuId'] === null)
|
|
245
138
|
{
|
|
246
139
|
return null;
|
|
@@ -257,7 +150,7 @@ class PermanentObjectModel extends BaseSiteModel
|
|
|
257
150
|
|
|
258
151
|
if('keyIndex' in jsonObject)
|
|
259
152
|
{
|
|
260
|
-
model.
|
|
153
|
+
model.keyIndex = (function(){
|
|
261
154
|
if(typeof jsonObject['keyIndex'] !== 'string')
|
|
262
155
|
{
|
|
263
156
|
return String(jsonObject['keyIndex']);
|
|
@@ -269,7 +162,7 @@ class PermanentObjectModel extends BaseSiteModel
|
|
|
269
162
|
|
|
270
163
|
if('type' in jsonObject)
|
|
271
164
|
{
|
|
272
|
-
model.
|
|
165
|
+
model.type = (function(){
|
|
273
166
|
if(typeof jsonObject['type'] !== 'string')
|
|
274
167
|
{
|
|
275
168
|
return String(jsonObject['type']);
|
|
@@ -281,7 +174,7 @@ class PermanentObjectModel extends BaseSiteModel
|
|
|
281
174
|
|
|
282
175
|
if('definition' in jsonObject)
|
|
283
176
|
{
|
|
284
|
-
model.
|
|
177
|
+
model.definition = (function(){
|
|
285
178
|
if(typeof jsonObject['definition'] !== 'object')
|
|
286
179
|
{
|
|
287
180
|
return Object(jsonObject['definition']);
|
|
@@ -293,7 +186,7 @@ class PermanentObjectModel extends BaseSiteModel
|
|
|
293
186
|
|
|
294
187
|
if('deleted' in jsonObject)
|
|
295
188
|
{
|
|
296
|
-
model.
|
|
189
|
+
model.deleted = (function(){
|
|
297
190
|
if(typeof jsonObject['deleted'] !== 'boolean')
|
|
298
191
|
{
|
|
299
192
|
return Boolean(jsonObject['deleted']);
|
|
@@ -305,7 +198,7 @@ class PermanentObjectModel extends BaseSiteModel
|
|
|
305
198
|
|
|
306
199
|
if('updateTimestamp' in jsonObject)
|
|
307
200
|
{
|
|
308
|
-
model.
|
|
201
|
+
model.updateTimestamp = (function(){
|
|
309
202
|
if(typeof jsonObject['updateTimestamp'] !== 'string')
|
|
310
203
|
{
|
|
311
204
|
return new Date(String(jsonObject['updateTimestamp']));
|
|
@@ -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 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
|
|
@@ -29,252 +29,97 @@ class PointModel extends BaseSiteModel
|
|
|
29
29
|
* The Point ID
|
|
30
30
|
*
|
|
31
31
|
* @type {number}
|
|
32
|
-
* @
|
|
32
|
+
* @public
|
|
33
33
|
*/
|
|
34
|
-
this.
|
|
34
|
+
this.id = undefined;
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* The RTU this Point belongs to
|
|
38
38
|
*
|
|
39
39
|
* @type {?number}
|
|
40
|
-
* @
|
|
40
|
+
* @public
|
|
41
41
|
*/
|
|
42
|
-
this.
|
|
42
|
+
this.rtuId = undefined;
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
* The Plugin ID
|
|
46
46
|
*
|
|
47
47
|
* @type {?number}
|
|
48
|
-
* @
|
|
48
|
+
* @public
|
|
49
49
|
*/
|
|
50
|
-
this.
|
|
50
|
+
this.pluginId = undefined;
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
53
|
* The Point Name
|
|
54
54
|
*
|
|
55
55
|
* @type {string}
|
|
56
|
-
* @
|
|
56
|
+
* @public
|
|
57
57
|
*/
|
|
58
|
-
this.
|
|
58
|
+
this.name = undefined;
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
61
|
* The Point Type
|
|
62
62
|
*
|
|
63
63
|
* @type {string}
|
|
64
|
-
* @
|
|
64
|
+
* @public
|
|
65
65
|
*/
|
|
66
|
-
this.
|
|
66
|
+
this.type = undefined;
|
|
67
67
|
|
|
68
68
|
/**
|
|
69
69
|
* The Point's Value Type
|
|
70
70
|
*
|
|
71
71
|
* @type {string}
|
|
72
|
-
* @
|
|
72
|
+
* @public
|
|
73
73
|
*/
|
|
74
|
-
this.
|
|
74
|
+
this.valueType = undefined;
|
|
75
75
|
|
|
76
76
|
/**
|
|
77
77
|
* The Permissions
|
|
78
78
|
*
|
|
79
79
|
* @type {string}
|
|
80
|
-
* @
|
|
80
|
+
* @public
|
|
81
81
|
*/
|
|
82
|
-
this.
|
|
82
|
+
this.permissions = undefined;
|
|
83
83
|
|
|
84
84
|
/**
|
|
85
85
|
* Whether the Point is Enabled
|
|
86
86
|
*
|
|
87
87
|
* @type {boolean}
|
|
88
|
-
* @
|
|
88
|
+
* @public
|
|
89
89
|
*/
|
|
90
|
-
this.
|
|
90
|
+
this.enabled = undefined;
|
|
91
91
|
|
|
92
92
|
/**
|
|
93
93
|
* The Point Settings
|
|
94
94
|
*
|
|
95
95
|
* @type {Object}
|
|
96
|
-
* @
|
|
96
|
+
* @public
|
|
97
97
|
*/
|
|
98
|
-
this.
|
|
98
|
+
this.settings = undefined;
|
|
99
99
|
|
|
100
100
|
/**
|
|
101
101
|
* Whether the Point has been deleted
|
|
102
102
|
*
|
|
103
103
|
* @type {boolean}
|
|
104
|
-
* @
|
|
104
|
+
* @public
|
|
105
105
|
*/
|
|
106
|
-
this.
|
|
106
|
+
this.deleted = undefined;
|
|
107
107
|
|
|
108
108
|
/**
|
|
109
109
|
* When the Point was last updated
|
|
110
110
|
*
|
|
111
111
|
* @type {Date}
|
|
112
|
-
* @
|
|
112
|
+
* @public
|
|
113
113
|
*/
|
|
114
|
-
this.
|
|
114
|
+
this.updateTimestamp = undefined;
|
|
115
115
|
|
|
116
116
|
/**
|
|
117
117
|
* The Site ID associated with this Point
|
|
118
118
|
*
|
|
119
119
|
* @type {number}
|
|
120
|
-
* @
|
|
120
|
+
* @public
|
|
121
121
|
*/
|
|
122
|
-
this.
|
|
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
|
-
};
|
|
122
|
+
this.siteId = siteId;
|
|
278
123
|
}
|
|
279
124
|
|
|
280
125
|
/**
|
|
@@ -308,7 +153,7 @@ class PointModel extends BaseSiteModel
|
|
|
308
153
|
|
|
309
154
|
if('id' in jsonObject)
|
|
310
155
|
{
|
|
311
|
-
model.
|
|
156
|
+
model.id = (function(){
|
|
312
157
|
if(typeof jsonObject['id'] !== 'number')
|
|
313
158
|
{
|
|
314
159
|
return Number.isInteger(Number(jsonObject['id'])) ? Number(jsonObject['id']) : Math.floor(Number(jsonObject['id']));
|
|
@@ -320,7 +165,7 @@ class PointModel extends BaseSiteModel
|
|
|
320
165
|
|
|
321
166
|
if('rtuId' in jsonObject)
|
|
322
167
|
{
|
|
323
|
-
model.
|
|
168
|
+
model.rtuId = (function(){
|
|
324
169
|
if(jsonObject['rtuId'] === null)
|
|
325
170
|
{
|
|
326
171
|
return null;
|
|
@@ -337,7 +182,7 @@ class PointModel extends BaseSiteModel
|
|
|
337
182
|
|
|
338
183
|
if('pluginId' in jsonObject)
|
|
339
184
|
{
|
|
340
|
-
model.
|
|
185
|
+
model.pluginId = (function(){
|
|
341
186
|
if(jsonObject['pluginId'] === null)
|
|
342
187
|
{
|
|
343
188
|
return null;
|
|
@@ -354,7 +199,7 @@ class PointModel extends BaseSiteModel
|
|
|
354
199
|
|
|
355
200
|
if('name' in jsonObject)
|
|
356
201
|
{
|
|
357
|
-
model.
|
|
202
|
+
model.name = (function(){
|
|
358
203
|
if(typeof jsonObject['name'] !== 'string')
|
|
359
204
|
{
|
|
360
205
|
return String(jsonObject['name']);
|
|
@@ -366,7 +211,7 @@ class PointModel extends BaseSiteModel
|
|
|
366
211
|
|
|
367
212
|
if('type' in jsonObject)
|
|
368
213
|
{
|
|
369
|
-
model.
|
|
214
|
+
model.type = (function(){
|
|
370
215
|
if(typeof jsonObject['type'] !== 'string')
|
|
371
216
|
{
|
|
372
217
|
return String(jsonObject['type']);
|
|
@@ -378,7 +223,7 @@ class PointModel extends BaseSiteModel
|
|
|
378
223
|
|
|
379
224
|
if('valueType' in jsonObject)
|
|
380
225
|
{
|
|
381
|
-
model.
|
|
226
|
+
model.valueType = (function(){
|
|
382
227
|
if(typeof jsonObject['valueType'] !== 'string')
|
|
383
228
|
{
|
|
384
229
|
return String(jsonObject['valueType']);
|
|
@@ -390,7 +235,7 @@ class PointModel extends BaseSiteModel
|
|
|
390
235
|
|
|
391
236
|
if('permissions' in jsonObject)
|
|
392
237
|
{
|
|
393
|
-
model.
|
|
238
|
+
model.permissions = (function(){
|
|
394
239
|
if(typeof jsonObject['permissions'] !== 'string')
|
|
395
240
|
{
|
|
396
241
|
return String(jsonObject['permissions']);
|
|
@@ -402,7 +247,7 @@ class PointModel extends BaseSiteModel
|
|
|
402
247
|
|
|
403
248
|
if('enabled' in jsonObject)
|
|
404
249
|
{
|
|
405
|
-
model.
|
|
250
|
+
model.enabled = (function(){
|
|
406
251
|
if(typeof jsonObject['enabled'] !== 'boolean')
|
|
407
252
|
{
|
|
408
253
|
return Boolean(jsonObject['enabled']);
|
|
@@ -414,7 +259,7 @@ class PointModel extends BaseSiteModel
|
|
|
414
259
|
|
|
415
260
|
if('settings' in jsonObject)
|
|
416
261
|
{
|
|
417
|
-
model.
|
|
262
|
+
model.settings = (function(){
|
|
418
263
|
if(typeof jsonObject['settings'] !== 'object')
|
|
419
264
|
{
|
|
420
265
|
return Object(jsonObject['settings']);
|
|
@@ -426,7 +271,7 @@ class PointModel extends BaseSiteModel
|
|
|
426
271
|
|
|
427
272
|
if('deleted' in jsonObject)
|
|
428
273
|
{
|
|
429
|
-
model.
|
|
274
|
+
model.deleted = (function(){
|
|
430
275
|
if(typeof jsonObject['deleted'] !== 'boolean')
|
|
431
276
|
{
|
|
432
277
|
return Boolean(jsonObject['deleted']);
|
|
@@ -438,7 +283,7 @@ class PointModel extends BaseSiteModel
|
|
|
438
283
|
|
|
439
284
|
if('updateTimestamp' in jsonObject)
|
|
440
285
|
{
|
|
441
|
-
model.
|
|
286
|
+
model.updateTimestamp = (function(){
|
|
442
287
|
if(typeof jsonObject['updateTimestamp'] !== 'string')
|
|
443
288
|
{
|
|
444
289
|
return new Date(String(jsonObject['updateTimestamp']));
|